Skip to content

Instantly share code, notes, and snippets.

@cfobel
cfobel / color-brewer-qualitative.gpl
Created December 4, 2014 13:34
8 colors light/medium/dark color-brewer-qualitative color palette
GIMP Palette
Name: color-brewer-qualitative
Columns: 3
# This color palette combines the following three palletes developed
# by Cynthia Brewer (see http://colorbrewer2.org/):
# - Dark2_8.gpl
# - Pastel2_8.gpl
# - Set2_8.gpl
179 226 205 light_cyan
253 205 172 light_orange
@cfobel
cfobel / gtk_input_greenlet.py
Created December 2, 2014 21:18
Example using greenlets to provide a blocking interface to asynchronously accept values from a GUI.
'''
Example using greenlets to provide a blocking interface to asynchronously
accept values from a GUI.
'''
import gtk
from pygtkhelpers.delegates import WindowView
from greenlet import greenlet
class View(WindowView):
@cfobel
cfobel / README.md
Created December 1, 2014 15:02
pygtk2 gtk.Assistant example

This gist includes a pygtk2 port of the gtk.Assistant example available here.

@cfobel
cfobel / Foo.hpp
Last active December 20, 2015 18:39
Cython stack-allocated struct/class
struct Foo {
Foo() : x(0), y(0) {}
Foo(int x, int y) : x(x), y(y) {}
int x;
int y;
};
inline Foo test_return() {
Foo f(7, 4);
import eventlet
def defer_f(f, *args, **kwargs):
event = eventlet.event.Event()
eventlet.spawn_n(f, event, *args, **kwargs)
return event
def test_long_foo(event, run_count, *args, **kwargs):