Skip to content

Instantly share code, notes, and snippets.

View milliams's full-sized avatar

Matt Williams milliams

View GitHub Profile
### Keybase proof
I hereby claim:
* I am milliams on github.
* I am milliams (https://keybase.io/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
milliams / static_vars.py
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()
1
@milliams
milliams / launch_ganga
Last active March 14, 2016 12:58
A wrapper script to try to start Ganga with Python 2.7
#! /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
milliams / TestLittleGanga.py
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()
j.submit()
monitor(j)
assert j.status == 'completed'
@milliams
milliams / Monitoring.py
Created February 9, 2016 15:01
First implementation of the monitoring replacement
"""
Requirements
------------
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
Implementation
--------------
@milliams
milliams / gist:116162
Created May 22, 2009 14:36
mod_falcon error
# /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/mod_falcon.so:
/usr/lib64/apache2/mod_falcon.so: undefined symbol: falcon_module
@milliams
milliams / gist:114248
Created May 19, 2009 17:35
falcon test failing
testsuite % faltest -s -v 109
Falcon unit test package.
Version 0.9.1.6 (crane-RC1)
109b: fail.
109b - Space-saving file operations
Script file: ./files2.fal
Category: rtl
Subcategory: file