Skip to content

Instantly share code, notes, and snippets.

View codebrainz's full-sized avatar

Matthew Brush codebrainz

View GitHub Profile
@codebrainz
codebrainz / 0001-Add-basic-support-for-loading-binary-files.patch
Created May 11, 2011 00:56
Add basic support for loading binary files.
From 696cc02fa371f75390a6dc28f1551faf34759df0 Mon Sep 17 00:00:00 2001
From: Matthew Brush <matthewbrush(at)gmail(dot)com>
Date: Tue, 10 May 2011 16:53:21 -0700
Subject: [PATCH] Add basic support for loading binary files.
Read the entire file instead of only to the first nul byte, then,
if converting it to UTF-8 fails, assume it's binary, make it read-only,
warn the user and set the text in Scintilla anyway.
Add sci_set_text2() function (terrible name) to support setting
@codebrainz
codebrainz / .fonts.conf
Created April 4, 2011 23:37
Font configuration file to override "emboldening" of fonts without a bold version.
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
This overrides what's in /etc/fonts/conf.d/90-synthetic.conf for
"faking" bold fonts, but only for monospace fonts.
-->
<fontconfig>
<match target="font">
<test name="spacing" compare="eq">
diff --git a/plugins/splitwindow.c b/plugins/splitwindow.c
index ff67508..f5a2d8c 100644
--- a/plugins/splitwindow.c
+++ b/plugins/splitwindow.c
@@ -307,14 +307,25 @@ static void split_view(gboolean horizontal)
set_state(horizontal ? STATE_SPLIT_HORIZONTAL : STATE_SPLIT_VERTICAL);
+#ifndef G_OS_WIN32
/* temporarily put document notebook in main vbox (scintilla widgets must stay
@codebrainz
codebrainz / persistent_gtk_notebooks.py
Created March 22, 2011 01:34
Test code to try and save and restore tabs inside two notebooks, including which notebook and order.
#!/usr/bin/env python
"""
Demo for storing tabs inside two detachable and re-orderable notebooks
to disk on close and reloading them in the correct notebook and in
order on load.
"""
import gtk
from ConfigParser import SafeConfigParser
/* large portions of this were taken from Geany's source code */
#include "geanyplugin.h"
#include <math.h>
GeanyPlugin *geany_plugin;
GeanyData *geany_data;
GeanyFunctions *geany_functions;
PLUGIN_VERSION_CHECK(147)
@codebrainz
codebrainz / "Open in a New Tab" for Geany
Created November 22, 2010 23:14
Patch for notebook.c file in Geany to add an item to open the file in a new instance of Geany to the tabs' right-click menu when the tab contains a saved file.
--- geany-svn/src/notebook.c 2010-11-21 20:53:12.943333841 -0800
+++ geany-local/src/notebook.c 2010-11-21 20:54:20.836667216 -0800
@@ -193,10 +193,35 @@
}
+static void on_open_in_new_window_activate(GtkMenuItem *menuitem, gpointer user_data)
+{
+ gchar **argv;
+ gchar *doc_path;