Skip to content

Instantly share code, notes, and snippets.

jetpack.future.import("pageMods");
jetpack.pageMods.add(function(doc){
var $doc = $(doc);
$doc.find('#flags, .flags_label').remove();
$doc.find('th[id^="field_label_cf"]').each(function(i, e) {
$(e, doc).parent().remove();
});
},
['https://bugzilla.mozilla.org/*']);
from datetime import datetime
import httplib
import urllib
ROOT = 'addons.mozilla.org'
BUILDER_URL = '/en-US/developers/tools/builder/'
params_ = {
'name': 'unst unst',
create a key from whatever filters are in the query => query_key
as we iterate through objects in the queryset, ask them for their cache key => object_key
maintain maps of object_key => [query_key]
when object_key is invalidated, invalidate all its mapped query_keys
"""
With :class:`~multidb.SlaveQuerySet` and :class:`~multidb.SlaveMixin`, all read
queries will go to a slave database; all inserts, updates, and deletes will do
to the ``default`` database.
First, define ``SLAVE_DATABASES`` in your settings. It should be a list of
database aliases that can be found in ``DATABASES``::
DATABASES = {
'default': {...},
@jbalogh
jbalogh / django-min.po
Created January 8, 2010 23:55
Small set of strings that should be translated for a decent Django l10n experience.
# This file is distributed under the same license as the Django package.
#
msgid ""
msgstr ""
"Project-Id-Version: Django\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-09-02 22:36-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@jbalogh
jbalogh / slim.sh
Created January 10, 2010 15:43
make a small AMO database
#!/bin/sh
DATE=$(date +%Y-%m-%d)
DIR="$(pwd)/amo-slim-$DATE"
rm -rf $DIR
mkdir -p $DIR
cd $DIR
DB='remora'
# WSGI
LoadModule wsgi_module modules/mod_wsgi.so
WSGIPythonHome /Users/jeff/.virtualenvs/baseline
<VirtualHost *:80>
ServerName 127.0.0.1
WSGIScriptAlias / /Users/jeff/dev/zamboni/wsgi/zamboni.wsgi
WSGIDaemonProcess zamboni processes=8 threads=10 \
python-path=/Users/jeff/.virtualenvs/zamboni/lib/python2.6/site-packages
@jbalogh
jbalogh / gist:281294
Created January 19, 2010 21:05
Use `git bisect run` to figure out where you broke it.
cat <<EOF>runtests.sh
#!/bin/sh
python manage.py test --noinput --logging-clear-handlers
EOF
chmod +x runtests.sh
git bisect start
git bisect good master
git bisect bad
git bisect run runtests.sh
#!/bin/sh
# Export our git tree to svn for eternal IT love and happiness.
ROOT=$(pwd)/svn-wankery
GIT_REPO='git://github.com/jbalogh/zamboni.git'
SVN_REPO='https://svn.mozilla.org/projects/zamboni'
SVN=$ROOT/svn-z