Skip to content

Instantly share code, notes, and snippets.

View acdha's full-sized avatar

Chris Adams acdha

View GitHub Profile
acdha /
Last active August 29, 2015 13:55
django-haystack's update_index command extended to activate translations
# encoding: utf-8
"""Haystack's update_index command extended to activate translations
from __future__ import absolute_import
from django.utils import translation
acdha / ie8.patch
Created February 4, 2014 19:37
Partial Intl.js patch for IE8 support
diff --git a/public_website/static/external/intl/Intl.js b/public_website/static/external/intl/Intl.js
index a86c1f3..65befab 100644
--- a/public_website/static/external/intl/Intl.js
+++ b/public_website/static/external/intl/Intl.js
@@ -25,23 +25,30 @@
})(typeof global !== 'undefined' ? global : this, function() {
"use strict";
- Intl = {},
acdha / create-github-milestones
Last active August 29, 2015 13:56
Script to create Github milestones for recurring release windows
#!/usr/bin/env python
"""Create date-based release milestones on Github
By default this created milestones of the form 'Public Website – DATE'
If your git config defines github.user / github.password settings these will be used rather than prompting
for credentials. For sanity, !-prefixed github.password entries are supported so you can e.g. query the
OS X keychain rather than hard-coding passwords in a text file.
acdha / count-page-domains.js
Last active August 29, 2015 13:56
Count the number of domains used to load a page (see
/* global phantom */
// Inspired by
"use strict";
var system = require('system'),
webPage = require('webpage');
if (system.args.length != 2) {
console.log('Usage:', system.args[0], 'URL');
acdha / .jshintrc
Last active August 29, 2015 13:56
WDL's JSHint config
"maxlen": 110,
"indent": 4,
"strict": true,
"browser": true,
"bitwise": true,
"camelcase": true,
"curly": true,
acdha / postactivate
Created March 12, 2014 21:45
Global virtualenvwrapper hooks which add a project's bin directory to the PATH any time you activate a virtualenv
# This hook is run after every virtualenv is activated.
if [ -d "$VIRTUALENV_PROJECT/bin" ]; then
<?xml version='1.0' encoding='UTF-8'?>
<jpylyzer xmlns:dc="" xmlns:rdf="">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
acdha / testlog.js
Last active August 29, 2015 14:02
Performance test-case for pure-CSS expanding sidebar panel. WebKit, and to a lesser extent Blink, browsers render the sidebar expansion slower than expected, with repeated full invalidate/layout/recalc style cycles during the state change. This isn't too bad on a desktop but is noticeable on a mobile browser:…
// Load testcase & connect WebInspector to an iPhone 4S running iOS 7.1.1
// Start timeline capture
// Expand the sidebar:
document.querySelector('input[type=checkbox]').checked = !document.querySelector('input[type=checkbox]').checked
// Timeline profile:
// Collapse the sidebar:
acdha /
Created June 25, 2014 18:26
Quick and dirty HTML index creation for image galleries (see e.g.