Skip to content

Instantly share code, notes, and snippets.

John Stowers nzjrs

Block or report user

Report or block nzjrs

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nzjrs /
Created Oct 28, 2014
Non-table based implementations of crc16 and crc8-maxim
import crcmod.predefined
def _crc16(crc, c):
crc ^= ord(c)
for i in range(8):
if crc & 0x1:
crc = (crc >> 1) ^ 0xA001
crc = (crc >> 1)
return crc
nzjrs /
Created Jan 21, 2009
PyGtk widget that displays color swatches according you your Gtk theme
#!/usr/bin/env python
# gtk-theme-swatch: A PyGtk widget that displays the color swatches of all
# gtk.Styles, in all states. Useful for designing themes
# author: John Stowers <>
import gtk
class ThemeSwatch(gtk.DrawingArea):
SWATCH_SIZE = 50 #swatch size
nzjrs /
Created Feb 2, 2009
Python example demonstrating when callbacks are run in a threaded environment
#!/usr/bin/env python
# Python example demonstrating when callbacks are run in a threaded environment
# John Stowers
import threading
import thread
import time
import gobject
import gtk
nzjrs /
Created Jun 30, 2009
Demo for testing gtk.Curve
#!/usr/bin/env python
# Demo for testing gtk.Curve
# John Stowers 2009
import random
import gtk
class UI:
nzjrs /
Created Jul 12, 2009
python rtgraph demo
#!/usr/bin/env python
# A simple example of using multiple rtgraph HScrollLineGraph widgets
# Micah Dowty <>, John Stowers
import gtk
import time, math, re
import gs.ui.rtgraph as rtgraph
windows = []
nzjrs /
Created Jan 19, 2010
PyGtk client side windows demo
#!/usr/bin/env python
# Gtk+ client-side-windows demo in python
# John Stowers
import gobject
import cairo
import gtk
import gtk.gdk as gdk
#hacks for using functions not exposed in this pygtk version
nzjrs / Makefile
Last active Sep 5, 2015
LaTeX Makefile
View Makefile
# Makefile for LaTeX files
# Original file from
# please check (Roel)
# current version (John)
# Copyright (c) 2009,2010 (in order of appearance):
# Roel Meeuws <>
# John Stowers <>
# ChangeLog:
nzjrs /
Created Oct 16, 2010
Script for building the Py{GObject,GTK} installers using MinGW
# Script for building the Py{GObject,GTK} installers using MinGW
# via wine on ubuntu 10.04
#Install the deps, MinGW and MSYS. GCC 4.5.0
#wine mingw-get.exe install gcc
#wine mingw-get.exe install msys-base
BDIST_TARGETS="wininst msi"
nzjrs / oo-eps.bas
Created Nov 1, 2010
Exporting openoffice charts for LaTeX
View oo-eps.bas
' Export all charts from a Calc spreadsheet to EPS
' (c) Jose Fonseca
' Taken from
Sub Main
Dim oDoc, oDocCtrl, oDocFrame, oDispatchHelper
oDoc = ThisComponent
oDocCtrl = oDoc.getCurrentController()
oDocFrame = oDocCtrl.getFrame()
oDispatchHelper = createUnoService( "" )
nzjrs / gtkview.c
Created Nov 18, 2010
GTK+ Viewer for Microsoft Kinect (uses libfreeconect)
View gtkview.c
* Gtk example to show depth map from Micrsoft Kinect
* Copyright (c) 2010 John Stowers
* Copyright (c) 2010 individual OpenKinect contributors. See the CONTRIB file
* for details.
* This code is licensed to you under the terms of the Apache License, version
* 2.0, or, at your option, the terms of the GNU General Public License,
* version 2.0. See the APACHE20 and GPL2 files for the text of the licenses,
You can’t perform that action at this time.