Skip to content

Instantly share code, notes, and snippets.

View btimby's full-sized avatar

Ben Timby btimby

View GitHub Profile
Handlebars.registerHelper('trans', function(fn) {
return gettext(fn(this));
});
@btimby
btimby / storage.py
Created February 20, 2012 19:43 — forked from jwineinger/storage.py
Django staticfiles JS-minifying storage backend
import os.path
from django.core.files.storage import FileSystemStorage
from django.core.files.base import ContentFile
from slimit import minify
class StaticFileStorageAndJSMinifier(FileSystemStorage):
"""
A storage backend to be used by the staticfiles app -- STATICFILES_STORAGE
setting. This backend operates just as a normal filesystem storage backend
except when it detects a javascript file.