Skip to content

Instantly share code, notes, and snippets.

View aldeka's full-sized avatar

Karen Rustad Tölva aldeka

View GitHub Profile
@coderanger
coderanger / holidays.py
Created March 23, 2013 22:49
Find streaks of days that overlap no holidays
# coding=utf-8
import datetime
from dateutil.parser import parse
# From http://www.huffingtonpost.com/2013/01/01/religious-holidays-2013_n_2372650.html
raw_holidays = """
Baha'i Holidays 2013:
Jan 20 - World Religion Day
Mar 2-20 - Baha'i Fast
Mar 20 - Nowruz (Baha'i, Zoroastrian, Iranian New Year)
gnome-cups-manager
------------------
Once upon a time there was a printer who lived in the woods. He was a
lonely printer, because nobody knew how to configure him. He hoped
and hoped for someone to play with.
One day, the wind passed by the printer's cottage. "Whoosh," said the
wind. The printer became excited. Maybe the wind would be his
friend!
from django.db import models
optional = dict(blank=True, null=True)
class Foo(models.Model):
bar = models.CharField()
baz = models.CharField(**optional)