Skip to content

Instantly share code, notes, and snippets.

@obriencj
obriencj / xmlrpc_unittest_harness.py
Last active December 24, 2015 20:24
An example harness for testing an XMLRPC client/server relationship
from threading import Thread
from unittest import TestCase
from xmlrpclib import ServerProxy
from SimpleXMLRPCServer import SimpleXMLRPCServer
class Dummy(object):
def __init__(self):
self.data = list(xrange(0,10))
@obriencj
obriencj / keybase.md
Created February 24, 2015 23:55
keybase.md

Keybase proof

I hereby claim:

  • I am obriencj on github.
  • I am obriencj (https://keybase.io/obriencj) on keybase.
  • I have a public key whose fingerprint is B813 6B61 D568 811E 626F 0DBA B5AB A230 5282 9C5C

To claim this, I am signing this object:

@obriencj
obriencj / tailcall.py
Created March 14, 2014 19:52
playing chicken with the python stack using exceptions
#! /usr/bin/env python3
from functools import partial
from inspect import currentframe
import sys
STACK_LIMIT = 64
@obriencj
obriencj / eval_no_closures.py
Created February 26, 2014 02:55
Examples of compile/eval not giving me a chance to provide lexical bindings for it to snag closures from
def attempt_1():
data = list()
# no prob, bob. data is captured as a closure cell of action
action = lambda x: data.append(x)
action(5)
return data
@obriencj
obriencj / despair.scm
Last active August 29, 2015 13:56
Scheme Comedy
((lambda (f)
((lambda (r) (f (lambda () ((r r)))))
(lambda (r) (f (lambda () ((r r)))))))
(lambda (despair)
(lambda () (despair))))