Skip to content

Instantly share code, notes, and snippets.

View jmurty's full-sized avatar

James Murty jmurty

View GitHub Profile
@jmurty
jmurty / django-proxy-delete-hack.py
Created February 3, 2016 23:06
Django Proxy Delete Hack: monkey patch Django 1.7 / 1.8 deletion collectors to include proxy ancestors
# USAGE: To apply to your project, call the appropriate APPLY_ method for your
# version of Django at the start of your project's `AppConfig.ready` method:
# - APPLY_hack_django_17_collector_collect
# - APPLY_hack_django_18_get_candidate_relations_to_delete
#
# See comment notes below for references to related Django issues.
# The underlying issue is fixed in Django 1.9+
#
# This gist is intended to help others encountering this issue, and as a
# placeholder until a better work-around and/or a more easily installed
@jmurty
jmurty / jdutil.py
Created April 16, 2018 23:18 — forked from jiffyclub/jdutil.py
Functions for converting dates to/from JD and MJD
"""
Functions for converting dates to/from JD and MJD. Assumes dates are historical
dates, including the transition from the Julian calendar to the Gregorian
calendar in 1582. No support for proleptic Gregorian/Julian calendars.
:Author: Matt Davis
:Website: http://github.com/jiffyclub
"""