This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import threading | |
import time | |
import serial | |
from gi.repository import Gtk, Gdk, GObject | |
GObject.threads_init() | |
Gdk.threads_init() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def fix(d): | |
#d = d.copy() | |
for k,v in d.items(): | |
if type(v) == dict: | |
d[k] = fix(v) | |
elif isinstance(v,np.floating): | |
d[k] = float(v) | |
elif isinstance(v,np.integer): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://stackoverflow.com/a/10031877 | |
import numpy | |
import cairo | |
import math | |
from gi.repository import Gtk,Gdk | |
data = numpy.zeros((200, 200, 4), dtype=numpy.uint8) | |
surface = cairo.ImageSurface.create_for_data( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[submodule "documents/latex-makefile"] | |
path = documents/latex-makefile | |
url = git://gist.github.com/503886.git |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: testc testorc | |
clean: | |
rm -f testc testorc out.c out.h | |
testc: out.c test.c | |
$(CC) -DDISABLE_ORC=1 -o $@ $^ | |
testorc: out.c test.c | |
$(CC) -o $@ $^ `pkg-config --cflags --libs orc-0.4` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UserDict | |
class DotDict(UserDict.IterableUserDict): | |
def __init__(self): | |
UserDict.IterableUserDict.__init__(self) | |
def __setitem__(self, key, val): | |
bits = key.split(".") | |
if bits[0] not in self.data: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Python script to make Skype co-operate with GNOME3 notifications. | |
# | |
# | |
# Copyright (c) 2011, John Stowers | |
# | |
# Adapted from skype-notify.py | |
# Copyright (c) 2009, Lightbreeze | |
# | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: test libtest.so testmodule | |
libtest.so: libtest.c | |
$(CC) -Wall -g -fPIC -shared -o $@ $? -lc | |
test: test_main.c libtest.o | |
$(CC) -o $@ $? | |
testmodule: testmodule.c | |
python setup.py build |