git branch feature # create new branch without checking out
git reset --hard origin/branch # reset current to origin, blowing away changes now in `feature`
git checkout feature
This file contains hidden or 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
| from calendar import monthrange | |
| from datetime import datetime, timedelta | |
| def month_boundaries(year, month): | |
| start = datetime(year, month, 1) | |
| month_days = monthrange(year, month)[1] | |
| return [start, start + timedelta(days=month_days, seconds=-1)] |
This file contains hidden or 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
| +---------+ | |
| | START | | |
| +---------+ | |
| | | |
| V | |
| YES +------------+ NO | |
| +---------------| DOES THE |---------------+ | |
| | | DAMN THING | | | |
| V | WORK? | V | |
| +------------+ +------------+ +--------------+ NO |
This file contains hidden or 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/env python | |
| import sys | |
| import urllib2 | |
| from optparse import OptionParser | |
| from xml.etree import cElementTree as ElementTree | |
| #------------------------------------------------------------------------------- | |
| def get_data(elem): | |
| return dict([(e.tag, e.attrib['data']) for e in elem.getchildren()]) |