Skip to content

Instantly share code, notes, and snippets.

View RedHatter's full-sized avatar

Ava Johnson RedHatter

View GitHub Profile
@RedHatter
RedHatter / vala-cascade.patch
Last active December 30, 2015 20:29
A patch to the Vala and Genie compilers to add support for cascading member access. Includes vala unit tests. Recursive cascading now supported. Similar to described here: http://news.dartlang.org/2012/02/method-cascades-in-dart-posted-by-gilad.html
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bcf82e1..eb158d7 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -112,6 +112,7 @@ TESTS = \
delegates/bug639751.vala \
delegates/bug659778.vala \
delegates/bug703804.vala \
+ objects/cascade.vala \
objects/chainup.vala \
@RedHatter
RedHatter / patch_ext
Last active December 30, 2015 15:38
Create a patch from 'original_directory' to 'patch_directory' of only the files with the extension 'ext'.
find original_directory patch_directory -type f ! -name '*.ext' -printf '%f\n' | diff -ru original_directory patch_directory -X - > project.patch
@RedHatter
RedHatter / stderr_breakpoint
Created December 4, 2013 07:27
Breakpoint for gdb, breaks when a string containing "your string" is printed to stderr. Useful for breaking on errors that could come from anywhere.
$ gdb break write if 2 == *(int*)($esp + 4) && strstr((char*)*(int*)($esp + 8), "your string") != 0
@RedHatter
RedHatter / valag.patch
Created November 27, 2013 22:45
Valag is a graphviz graph generator for Vala source files. This patch allows it to work with vala 0.22.
diff -rupN a/Makefile valag-1.2/Makefile
--- a/Makefile 2013-11-27 22:30:17.772031704 +0000
+++ valag-1.2/Makefile 2013-11-22 19:01:59.642559732 +0000
@@ -9,7 +9,7 @@ DESTDIR = $(PREFIX)
all: valag
valag: $(SRCS)
- $(VALAC) -g -o valag --thread --pkg libvala-0.14 --pkg libgvc --pkg glib-2.0 --vapidir . $+
+ $(VALAC) -g -o valag --thread --pkg libvala-0.22 --pkg libgvc --pkg glib-2.0 --vapidir . $+