Skip to content

Instantly share code, notes, and snippets.

View milliams's full-sized avatar

Matt Williams milliams

View GitHub Profile
View gist:6ab69b960f490b62902d5e198b9d6361
### Keybase proof
I hereby claim:
* I am milliams on github.
* I am milliams ( on keybase.
* I have a public key whose fingerprint is 6C58 D45D A75C 995D C1B1 49D3 ACDE B490 E9DE 016D
To claim this, I am signing this object:
milliams /
Created May 13, 2016 10:45
Add static variables into a Python function with a decorator
def static_vars(**kwargs):
Decorate a function and provide it with some static variables.
>>> @static_vars(counter=0)
... def foo():
... foo.counter += 1
... return foo.counter
>>> foo()
milliams / launch_ganga
Last active March 14, 2016 12:58
A wrapper script to try to start Ganga with Python 2.7
View launch_ganga
#! /usr/bin/env python
This script will launch Ganga with an appropriate interpreter
from __future__ import print_function
import os
import re
import subprocess
milliams /
Created March 1, 2016 14:07
Example pytest fixtures for little ganga
def test_ganga(ganga, monitor):
Test that we can submit and monitor jobs
j = ganga.Job()
assert j.status == 'completed'
milliams /
Created February 9, 2016 15:01
First implementation of the monitoring replacement
We need a thread-safe list of queued back-ends and of running back-ends
We need to be able to rate-limit per-backend
milliams / gist:116162
Created May 22, 2009 14:36
mod_falcon error
View gist:116162
# /etc/init.d/apache2 restart
httpd2-prefork: Syntax error on line 116 of /etc/apache2/httpd.conf:
Syntax error on line 31 of /etc/apache2/sysconfig.d/loadmodule.conf:
Can't locate API module structure `falcon_module' in file /usr/lib64/apache2/
/usr/lib64/apache2/ undefined symbol: falcon_module
milliams / gist:114248
Created May 19, 2009 17:35
falcon test failing
View gist:114248
testsuite % faltest -s -v 109
Falcon unit test package.
Version (crane-RC1)
109b: fail.
109b - Space-saving file operations
Script file: ./files2.fal
Category: rtl
Subcategory: file