View gist:6edfea5857f4cd73e6f1
1 2 3 4 5 6 7 8 9 10
.grid-stack > .grid-stack-item { min-height: 60px }
.grid-stack > .grid-stack-item[data-gs-height="1"] { height: 60px }
.grid-stack > .grid-stack-item[data-gs-height="2"] { height: 140px }
.grid-stack > .grid-stack-item[data-gs-height="3"] { height: 220px }
.grid-stack > .grid-stack-item[data-gs-height="4"] { height: 300px }
.grid-stack > .grid-stack-item[data-gs-height="5"] { height: 380px }
.grid-stack > .grid-stack-item[data-gs-height="6"] { height: 460px }
.grid-stack > .grid-stack-item[data-gs-height="7"] { height: 540px }
.grid-stack > .grid-stack-item[data-gs-height="8"] { height: 620px }
.grid-stack > .grid-stack-item[data-gs-height="9"] { height: 700px }
View date_range.py
1 2 3 4 5 6 7 8 9
# -*- coding: utf-8 -*-
#
# Author: Pavel Reznikov <pashka.reznikov@gmail.com>
# Created: 10/6/11
#
# Id: $Id$
 
from datetime import datetime, timedelta
 
View gist:1140516
1 2 3 4 5 6 7 8 9 10
from django.contrib.auth.models import User, SiteProfileNotAvailable
from django.core.exceptions import ImproperlyConfigured
from django.db import models
from django.db.models.signals import post_init
from django.dispatch.dispatcher import receiver
 
 
@receiver(post_init, sender=User)
def user_post_init(sender, instance, **kwargs):
def get_profile():
View gist:957832
1 2 3 4 5 6 7 8 9 10
def split_on_packets(iterable, packet_size):
'''
>>> a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
>>> list(split_on_packets(a, 3))
[[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11]]
>>> list(split_on_packets(a, 13))
[[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]]
>>> list(split_on_packets(a, 1))
View .bashrc
1 2 3 4 5 6 7 8 9
### PROMPT ####################
 
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
 
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
View counties.json
1 2 3 4 5 6 7 8 9 10
{
"WA": {
"name": "Washington",
"counties": [
"Adams",
"Asotin",
"Benton",
"Chelan",
"Clallam",
"Clark",
View date_utils.py
1 2 3 4 5 6 7 8 9 10
import calendar
from datetime import datetime, date
 
 
def inc_months(d, value, specifying_date=None):
'''
Adds `value` of months to the date `d`. If `specifying_date` is passed, the day of resulting month
will be taken from the `specifying_date` instead of `d`.
>>> inc_months(datetime(2010, 3, 31), 0)
Something went wrong with that request. Please try again.