Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| 1,2012-01-02,New Year Day | |
| 2,2012-01-16,Martin Luther King Jr. Day | |
| 3,2012-02-20,Presidents Day (Washingtons Birthday) | |
| 4,2012-05-28,Memorial Day | |
| 5,2012-07-04,Independence Day | |
| 6,2012-09-03,Labor Day | |
| 7,2012-10-08,Columbus Day | |
| 8,2012-11-12,Veterans Day | |
| 9,2012-11-22,Thanksgiving Day | |
| 10,2012-12-25,Christmas Day | 
| A warning occurred (42 apples) | |
| An error occurred | 
| # stacktrace java as one message | |
| multiline { | |
| #type => "all" # no type means for all inputs | |
| pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)" | |
| what => "previous" | |
| } | |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD | 
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # | 
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| #!/bin/bash | |
| for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done; | |
| /Applications/P4Merge.app/Contents/Resources/launchp4merge "${absargs[@]}" | |
| #!/bin/bash | |
| # | |
| # DESCRIPTION: | |
| # | |
| # Set the bash prompt according to: | |
| # * the active virtualenv | |
| # * the branch/status of the current git repository | |
| # * the return value of the previous command | |
| # * the fact you just came from Windows and are used to having newlines in | |
| # your prompts. | 
Demonstrate use of fixture with Flask-SQLAlchemy and Flask-Testing.
February 13, 2011
Ron DuPlain <[email protected]>
Post any feedback to: [email protected]
Get this gist:
git clone git://gist.github.com/824472.git Flask-SQLAlchemy-Fixture cd Flask-SQLAlchemy-Fixture