Skip to content

Instantly share code, notes, and snippets.

View codebrainz's full-sized avatar

Matthew Brush codebrainz

View GitHub Profile
@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: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: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: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 / 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: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 / gist:1332289
Created November 1, 2011 23:40
Remove editor_lexer_get_type_keyword_idx()
diff --git a/HACKING b/HACKING
index a50c179..420eaa8 100644
--- a/HACKING
+++ b/HACKING
@@ -458,9 +458,6 @@ this prevents calltips and autocompletion when typing in a comment
For brace indentation, update lexer_has_braces() in editor.c;
indentation after ':' is done from on_new_line_added().
-If the Scintilla lexer supports user type keyword highlighting (e.g.
-SCLEX_CPP), update editor_lexer_get_type_keyword_idx() in editor.c.
@codebrainz
codebrainz / gist:1325346
Created October 30, 2011 01:36
Geany ChangeLog, AUTHORS & COMMITTERS from Git log
#!/usr/bin/env python
'''
Helper script for Geany's distribution files generated by Git.
TODO: Use .mailmap or other means to use preferred name and emails.
'''
AUTHORS_HEADER = 'The following people have authored commits:\n'
AUTHORS_FOOTER = '''\nSee the COMMITTERS, ChangeLog and THANKS files for \
@codebrainz
codebrainz / gist:1292214
Created October 17, 2011 08:43
Setting GtkInfoBarColors
gtk_rc_parse_string(
"style \"infobar-style\" {\n"
" color[\"info_bg_color\"] = \"" DEFAULT_BG_COLOR "\"\n"
" color[\"info_fg_color\"] = \"" DEFAULT_FG_COLOR "\"\n"
" color[\"warning_bg_color\"] = \"" DEFAULT_BG_COLOR "\"\n"
" color[\"warning_fg_color\"] = \"" DEFAULT_FG_COLOR "\"\n"
" color[\"question_bg_color\"] = \"" DEFAULT_BG_COLOR "\"\n"
" color[\"question_fg_color\"] = \"" DEFAULT_FG_COLOR "\"\n"
" color[\"error_bg_color\"] = \"" DEFAULT_BG_COLOR "\"\n"
" color[\"error_fg_color\"] = \"" DEFAULT_FG_COLOR "\"\n"
@codebrainz
codebrainz / gist:1290680
Created October 16, 2011 08:54
Use `document_update_highlighting()` in favour of `update_type_keywords()`
diff --git a/src/document.c b/src/document.c
index 57d5881..cdd8015 100644
--- a/src/document.c
+++ b/src/document.c
@@ -2384,69 +2384,6 @@ static gboolean get_project_typenames(const GString **types, gint lang)
}
-/* If sci is NULL, update project typenames for all documents that support typenames,
- * if typenames have changed.