Skip to content

Instantly share code, notes, and snippets.

View wosc's full-sized avatar

Wolfgang Schnerring wosc

View GitHub Profile
def alias(column_name):
"""returns a descriptor that is usable everywhere the original column name
was: (not really a doctest, sorry)
>>> class Foo(SQLBase):
... original = Column(Integer)
... new = alias('original')
>>> foo = Foo()
>>> foo.new = 5
/* Will no-one*/ } catch( Exception e /* ! */ ) {
//No getMessage() shall we ever see,
//No System.exit( THIS_SHOULD_NOT_BE );
//No RuntimeException( WONT_CATCH_ME );
//No closure for Exception e,
//for our programmer, with little thought,
//has left Exception e uncaught!
} //Oh cruel bracket, how you limit the scope of his instance!
@wosc
wosc / .pdbrc
Created September 4, 2012 14:58
pdb persistent history
import os
execfile(os.path.expanduser("~/.pdbrc.py"))
#!/bin/bash
ARGS="$@"
case "$1" in
ci)
shift
DIFF=$(svn diff "$@" | grep --context 5 pdb.set_trace)
if [ -n "$DIFF" ]; then
echo "$DIFF"
read -ep "Continue (y/N): " OK