Skip to content

Instantly share code, notes, and snippets.

View colbypalmer's full-sized avatar
🦉

Colby Palmer colbypalmer

🦉
View GitHub Profile
from django.db import models
from django.utils.translation import ugettext, ugettext_lazy as _
from dateutil import rrule
RRULE_WEEKDAYS = {"MO":0,"TU":1,"WE":2,"TH":3,"FR":4,"SA":5,"SU":6}
freqs = ( ("YEARLY", _("Yearly")),
("MONTHLY", _("Monthly")),
("WEEKLY", _("Weekly")),
@tkersey
tkersey / Undo a commit and redo
Created October 8, 2010 22:36
Git: undo a commit and redo
http://stackoverflow.com/questions/927358/git-undo-last-commit
Undo a commit and redo
$ git commit ...
$ git reset --soft HEAD^ (1)
$ edit (2)
$ git commit -a -c ORIG_HEAD (3)
This is most often done when you remembered what you just committed is incomplete, or you misspelled your commit message, or both. Leaves working tree as it was before "reset".
@artolaluis
artolaluis / gist:8427359
Created January 14, 2014 22:40
Django 1.4 to 1.6 url templatetags syntax update. e.g. From {% url foobar one two %} To {% url "foobar" one two %}
sed -e 's/{% url \([^ %]*\)\(.*\)%}/{% url "\1"\2%}/g' file.in > file.out