Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View lvh's full-sized avatar

lvh lvh

View GitHub Profile
from json import dumps, loads
from twisted.internet.defer import inlineCallbacks
from twisted.protocols.basic import NetstringReceiver
from twisted.python import log
class JSONRPCReceiver(NetstringReceiver):
def stringReceived(self, string):
try:
request = loads(string)
@lvh
lvh / info.txt
Created March 7, 2014 14:02
A notification of my cycled key.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
My old PGP key (8D2E6BACE6D6AAAE) is being replaced by my new key
(DFD13DF7A8DD569B). You can find the new one on key servers near you.
The new key has been signed with the old one. The old key is now (by
time of reading, not writing) revoked. I have no reason to believe
that my old key was compromised.
I have updated my key on PyPI.
@lvh
lvh / keybase.md
Created March 7, 2014 14:35
Keybase verification

Keybase proof

I hereby claim:

  • I am lvh on github.
  • I am lvh (https://keybase.io/lvh) on keybase.
  • I have a public key whose fingerprint is D9DC 4315 772F 8E91 DD22 B153 DFD1 3DF7 A8DD 569B

To claim this, I am signing this object:

@lvh
lvh / cobyla.ipynb
Created April 8, 2014 10:29
PyCon financial aid grant optimization with COBYLA
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lvh
lvh / gist:6adfe51aa42bb268a273
Created February 20, 2015 19:03
Key cycling notice
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I am cycling my GPG key.
My old key has fingerprint:
D9DC 4315 772F 8E91 DD22 B153 DFD1 3DF7 A8DD 569B
My new key has fingerprint:
@lvh
lvh / keybase.md
Created February 20, 2015 19:14
Keybase key cycling notice

Keybase proof

I hereby claim:

  • I am lvh on github.
  • I am lvh (https://keybase.io/lvh) on keybase.
  • I have a public key whose fingerprint is 45DC 13EB 6A01 21E8 5219 8C09 8763 869B E2B2 663E

To claim this, I am signing this object:

meese is a built-in package.
Status: Built-in.
Summary: protect the impressionable young minds of America
Adds a hook to protect the impressionable young minds of America
from reading certain files in the Emacs distribution using Emacs.
This file is named after Ed Meese, the US Attorney General
"""
AMP over WebSockets support.
"""
import json
import txws
from twisted.internet import defer, protocol
from twisted.python import log
class C1(object):
class __metaclass__(type):
def __new__(meta, name, bases, attrs):
attrs["sentinel"] = object()
return type(name, bases, attrs)
class C2(object):
class __metaclass__(type):
def __new__(meta, name, bases, attrs):
attrs["sentinel"] = object()
class ComposedLocator(object):
"""
A responder locator that consists of other locators.
"""
interface.implements(amp.IResponderLocator)
class __metaclass__(type):
def __new__(meta, name, bases, attrs):
"""
Makes sure every subclass gets its own set of locator classes.