Skip to content

Instantly share code, notes, and snippets.

View jphalip's full-sized avatar

Julien Phalip jphalip

View GitHub Profile
@jphalip
jphalip / gist:1341169
Created November 5, 2011 06:01
What could soon become the first Django admin Selenium test...
class SeleniumTests(SeleniumTestCase):
fixtures = ['admin-views-users.xml']
urls = "regressiontests.admin_views.urls"
def admin_login(self, username, password):
"""
Helper function to log into the admin.
"""
self.selenium.open('/test_admin/admin/')
self.selenium.type('username', username)
@jphalip
jphalip / djpatch.py
Created August 25, 2011 11:25 — forked from jezdez/djpatch.py
A helper script to apply patches from Django's trac
#!/usr/bin/env python
"""
Obviously this is only useful if you have to deal with Django's
Trac a lot.
Mostly stolen from Jacob Kaplan-Moss, but improved by Jannis Leidel.
Reads a config file at ~/.djpatchrc, e.g.:
@jphalip
jphalip / TaskPaper-BetterDecrementDateValue.scpt
Created October 27, 2010 11:04
AppleScripts to increment/decrement date values in TaskPaper. Contains improvements made on top of http://www.hogbaysoftware.com/wiki/IncrementDateValue and http://www.hogbaysoftware.com/wiki/DecrementDateValue - Works well with http://gist.github.com/648
on getTextFromDate(vDate)
set dText to ((year of vDate) as text) & "-"
set dayText to (month of vDate as number) as text
if length of dayText is 1 then
set dayText to "0" & dayText
end if
set dText to dText & dayText & "-"
set dayText to (day of vDate as number) as text
if length of dayText is 1 then
set dayText to "0" & dayText
@jphalip
jphalip / TaskPaper-BetterStartAndDueDates.scpt
Created October 27, 2010 10:53
AppleScript to manage dates in TaskPaper. Contains improvements made on top of http://www.hogbaysoftware.com/wiki/StartAndDueDates - Works well with http://gist.github.com/648841
property dueTag : "due"
property startTag : "start"
property repeatTag : "repeat"
property todayTag : "today"
property tomorrowTag : "tomorrow"
property pastDueTag : "overdue"
property upcomingTag : "upcoming"
property doneTag : "done"
property inProgressTag : "inprogress"
property errorTag : "error"