This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"Top News": { | |
"feeds": [ | |
"/api/content/v1/manuallist/5847/?format=json", | |
"/api/content/v1/automaticlist/9121/?format=json" | |
] | |
} | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Blank to start | |
from mongoengine import connect, Document, StringField | |
connect('gist-2944918') | |
class Kard(Document): | |
""" | |
Represents a card on a Kanban board. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import mongoengine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FlowReport(app.db.Document): | |
""" | |
Represents a daily snapshot of cards by state, per team. | |
""" | |
date = app.db.DateTimeField(required=True, unique=False, unique_with=['group', ]) | |
"""The date for the records""" | |
group = app.db.StringField(required=True, default="all", unique_with=['date', ]) | |
"""The report group to which this daily report belongs.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew install git | |
brew update | |
brew install readline | |
brew link readline | |
brew install python | |
brew install postgres | |
brew install postgis | |
brew install gdal | |
brew install geos | |
brew install git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parse_git_dirty { | |
git diff --quiet HEAD &>/dev/null | |
[[ $? == 1 ]] && echo "⚡" | |
} | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
} | |
function proml { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is the one stop prank script for unattended Unix-like workstations. | |
# Use it with the simple one-liner: | |
# curl -L j.mp/__lys | bash | |
linux_specific(){ | |
true | |
} | |
mac_specific(){ | |
true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
lib | |
bin | |
include | |
.Python | |
*.pyc | |
.coverage | |
man | |
pip-log.txt | |
src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import json, urllib, os, textwrap | |
user = 'natbat' | |
url = "http://twitter.com/statuses/user_timeline/%s.json" | |
pipe = os.popen("cowthink -n", 'w') | |
pipe.write('\n'.join(textwrap.wrap( | |
json.load(urllib.urlopen(url % user))[0]['text']) | |
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $WORKSPACE | |
virtualenv -q ve | |
source ./ve/bin/activate | |
pip install -q -E ./ve -r requirements.pip | |
pip install -q -E ./ve -r requirements-test.pip | |
python setup.py --quiet develop | |
django-admin.py test --settings=yourapp.settings.test --with-coverage --cover-package=yourapp --with-xunit --with-xcoverage |