This file contains 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
/* gcc gdk-gstappsrc-stream.c -Wall `pkg-config --cflags --libs gstreamer-app-0.10 gdk-pixbuf-2.0` -o gdkstream */ | |
#include <gst/gst.h> | |
#include <gst/app/gstappsrc.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <gdk-pixbuf/gdk-pixbuf.h> |
This file contains 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 | |
# This function prints the difference between two python datetime objects | |
# in a more human readable form | |
# | |
# Adapted from: http://www.chimeric.de/blog/2008/0711_smart_dates_in_python | |
def humanize_date_difference(now, otherdate=None, offset=None): | |
if otherdate: | |
dt = otherdate - now | |
offset = dt.seconds + (dt.days * 60*60*24) |
This file contains 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
class ConnectPythonLoggingToROS(logging.Handler): | |
MAP = { | |
logging.DEBUG:rospy.logdebug, | |
logging.INFO:rospy.loginfo, | |
logging.WARNING:rospy.logwarn, | |
logging.ERROR:rospy.logerr, | |
logging.CRITICAL:rospy.logfatal | |
} |
This file contains 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/perl -w | |
#Salvaged from archive.org | |
#http://web.archive.org/web/20100309204315/http://www.lysium.de/blog/index.php?/archives/234-Plotting-data-with-gnuplot-in-real-time.html | |
#The input (on stdin or from a file) looks like this, as for the original version: | |
#0:0.09983 | |
#1:0.99500 | |
#2:0.69314 |
This file contains 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 |
This file contains 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 re | |
import socket | |
import struct | |
import logging | |
import subprocess | |
from fcntl import ioctl | |
SIOCGIFMTU = 0x8921 | |
SIOCSIFMTU = 0x8922 |
This file contains 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
# Demo application showing how once can combine the python | |
# threading module with GObject signals to make a simple thread | |
# manager class which can be used to stop horrible blocking GUIs. | |
# | |
# (c) 2008, John Stowers <john.stowers@gmail.com> | |
# | |
# This program serves as an example, and can be freely used, copied, derived | |
# and redistributed by anyone. No warranty is implied or given. | |
import gtk | |
import gobject |
This file contains 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
# Makefile for LaTeX files | |
# Original file from http://www.acoustics.hut.fi/u/mairas/UltimateLatexMakefile | |
# please check http://www.takeonthecity.nl/roels-latex-makefile/ (Roel) | |
# current version http://gist.github.com/503886 (John) | |
# Copyright (c) 2009,2010 (in order of appearance): | |
# Roel Meeuws <r.j.meeuws@gmail.com> | |
# John Stowers <john.stowers@gmail.com> | |
# ChangeLog: |
This file contains 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 | |
# This module provides a 'with' for using curses in Python. | |
# from: http://www.finalcog.com/python-with-curses-with_curses | |
from __future__ import with_statement | |
import curses | |
class WithCurses(object): | |
""" |
This file contains 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 | |
# | |
# |
NewerOlder