Skip to content

Instantly share code, notes, and snippets.

View codebrainz's full-sized avatar

Matthew Brush codebrainz

View GitHub Profile
@codebrainz
codebrainz / gist:1342067
Created November 5, 2011 21:52
Filetype updates
diff --git a/data/filetypes.asm b/data/filetypes.asm
index a2b2867..3ba4961 100644
--- a/data/filetypes.asm
+++ b/data/filetypes.asm
@@ -3,6 +3,8 @@
# Edit these in the colorscheme .conf file instead
default=default
comment=comment_line
+commentblock=comment
+commentdirective=comment
@codebrainz
codebrainz / facedetect.c
Created December 7, 2011 06:37
Detect faces using OpenCV
/*
* Copyright 2011 Matthew Brush <mbrush(at)codebrainz(dot)ca>
* Feel free to use this code however you want to.
*
* This is a VERY minimal example of detecting faces using OpenCV. It
* doesn't do any error handling or anything in an attempt to keep the
* topic code more readable.
*
* To compile (at least on Linux):
* gcc -o facedetect facedetect.c `pkg-config --cflags --libs opencv`
@codebrainz
codebrainz / gist:1446390
Created December 8, 2011 07:38
C function like `mkdir -p`
/*
* Copyright 2011 Matthew Brush <mbrush(at)codebrainz(dot)ca>
* Feel free to use this code however you want to.
*/
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
@codebrainz
codebrainz / gist:1469745
Created December 13, 2011 00:02
GeanyDocMonitor
/*
* geanydocmonitor.c
*
* Copyright 2011 Matthew Brush <matt@geany.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
@codebrainz
codebrainz / gist:1494603
Created December 18, 2011 21:56
Windows Make file for Geany
########################################################################
# Geany Make file for Windows
# ===========================
#
# Simple instructions:
# --------------------
# - Download and install MinGW to C:\MinGW
# - Download and install GTK+ bundle to C:\GTK
# - Add `bin` dir of both of above to PATH environment variable
# - Change into the root of the Geany source code (this directory)
@codebrainz
codebrainz / gist:1516940
Created December 24, 2011 08:54
libv4l2 Vala Bindings
/*
* Bindings for libv4l2 user-space library
* See: http://linuxtv.org/downloads/v4l-dvb-apis/libv4l.html
*/
using Posix; /* For mode_t */
[CCode (lower_case_cprefix="v4l2_", cprefix="v4l2_", cheader_filename="libv4l2.h")]
namespace LibV4l2
{
/* Replacements for standard Posix functions */
@codebrainz
codebrainz / gist:1556120
Created January 3, 2012 18:08
Re-highlight type keywords on tab page switch
diff --git a/src/callbacks.c b/src/callbacks.c
index 7abd6b0..78c1023 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -621,6 +621,7 @@ G_MODULE_EXPORT void on_notebook1_switch_page_after(GtkNotebook *notebook, GtkNo
ui_document_show_hide(doc); /* update the document menu */
build_menu_update(doc);
sidebar_update_tag_list(doc, FALSE);
+ document_highlight_tags(doc);
@codebrainz
codebrainz / gist:1562301
Created January 4, 2012 21:39
Simple bounded queue
/*
* A very basic (and fast) fixed-sized queue data structure.
*
* Author: Matthew Brush <mbrush@codebrainz.ca>
* License: GNU Lesser General Public License, version 2.1
* Edit Date: January 4th, 2011
*/
#include <stdlib.h>
#include "fixedqueue.h"
@codebrainz
codebrainz / sci-shadow.patch
Created February 7, 2012 09:52
Scintilla GTK patch to add drop shadow below text
diff --git a/scintilla/gtk/PlatGTK.cxx b/scintilla/gtk/PlatGTK.cxx
index 90f5c07..2206847 100644
--- a/scintilla/gtk/PlatGTK.cxx
+++ b/scintilla/gtk/PlatGTK.cxx
@@ -45,6 +45,8 @@
#define USE_CAIRO 1
+static double shadow_colour;
+
@codebrainz
codebrainz / gist:1815807
Created February 13, 2012 10:22
Plugin to highlight escape sequences in Geany
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <geanyplugin.h>
GeanyPlugin *geany_plugin;
GeanyData *geany_data;
GeanyFunctions *geany_functions;
PLUGIN_VERSION_CHECK(147)