Skip to content

Instantly share code, notes, and snippets.

"""Here's how you implement Foo(pkid) with postgres.orm 2.1.x.
Discovered at PyTennesse with @wlphoenix @PederSchacht et al.
"""
class Foo(Model):
typname = 'foo'
def __new__(cls, pkid_or_record):

Keybase proof

I hereby claim:

  • I am whit537 on github.
  • I am whit537 (https://keybase.io/whit537) on keybase.
  • I have a public key whose fingerprint is C328 C24F 685E 8D29 13C1 0A4C 6EE1 8A8D C479 77C2

To claim this, I am signing this object:

@chadwhitacre
chadwhitacre / of this file.html
Created August 1, 2011 19:16
What's the gist?
<div>Blah!</div>
@chadwhitacre
chadwhitacre / connect4.py
Created March 19, 2012 13:01
My submission for the Thumbtack PyCon schwag
#!/usr/bin/env python
import json
import sys
# Set up directions.
# ==================
# a b c
# d e
# f g h
We couldn’t find that file to show.
@chadwhitacre
chadwhitacre / repair.py
Created July 27, 2012 22:42
This is the script I used to repair Gittip.com issue #202
#!/usr/bin/env python
from gittip import wireup
db = wireup.db()
names = open('affected.txt').read().splitlines()
for name in names:
@chadwhitacre
chadwhitacre / repair.py
Created July 27, 2012 23:14
This is the script I used to repair Gittip.com issue #202 for $0.50 people
#!/usr/bin/env python
import datetime
from gittip import wireup
db = wireup.db()
names = open('affected-less.txt')
@chadwhitacre
chadwhitacre / migrate.py
Created August 16, 2012 13:43
Script used to wire up balanced_card_uri migrated from Stripe
#!./env/bin/python
import csv
import sys
from gittip import billing, wireup
db = wireup.db()
wireup.billing()
"""Used when a person needed to go to Balanced to verify their merchant details
they are redirected here after the fact.
"""
from aspen import Response
from gittip import billing
#=========================================================================== ^L
if user.ANON:
raise Response(404)
"""Used when a person needed to go to Balanced to verify their merchant details
they are redirected here after the fact.
"""
from aspen import Response
from gittip import billing
#=========================================================================== ^L
if user.ANON:
raise Response(404)