This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from django.conf import settings | |
from coffin import template | |
from jinja2 import contextfunction, Markup | |
from cms.application import get_rendered_block, get_rendered_image | |
from cms.templatetags.cms_editor import cms_editor | |
from cms.utils import is_editing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkgver=1.2.19 | |
mkdir -p $VIRTUAL_ENV/src && cd $VIRTUAL_ENV/src | |
curl -O http://oligarchy.co.uk/xapian/$pkgver/xapian-core-$pkgver.tar.xz && tar xf xapian-core-$pkgver.tar.xz | |
curl -O http://oligarchy.co.uk/xapian/$pkgver/xapian-bindings-$pkgver.tar.xz && tar xf xapian-bindings-$pkgver.tar.xz | |
cd $VIRTUAL_ENV/src/xapian-core-$pkgver | |
./configure --prefix=$VIRTUAL_ENV && make && make install | |
export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Placeholder @mixin for Sass | |
// | |
// A mixin to style placeholders in HTML5 form elements. | |
// Includes also a .placeholder class to be used with a polyfill e.g. | |
// https://github.com/mathiasbynens/jquery-placeholder | |
// Requires Sass 3.2. | |
// | |
// Example usage (.scss): | |
// | |
// input { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
from PIL import Image | |
except ImportError: | |
import Image | |
from django import forms | |
from django.template.defaultfilters import filesizeformat | |
from django.core.exceptions import ValidationError | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Whoosh backend for haystack that implements character folding, as per | |
http://packages.python.org/Whoosh/stemming.html#character-folding . | |
Tested with Haystack 2.4.0 and Whooch 2.7.0 | |
To use, put this file on your path and add it to your haystack settings, eg. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Example usage: | |
$('ul.dropdown').fancydropdown(); | |
(elements must have a 'title' attribute in order to populate the prompt) | |
*/ | |
$.fn.fancydropdown = (function(options){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import http | |
from django.utils.http import urlquote | |
from django import urls | |
from django.conf import settings | |
from django.utils.deprecation import MiddlewareMixin | |
class AppendOrRemoveSlashMiddleware(MiddlewareMixin): | |
"""Like django's built in APPEND_SLASH functionality, but also works in | |
reverse. Eg. will remove the slash if a slash-appended url won't resolve, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
jquery.aggregate.js by Greg Brown 2011. See | |
http://gregbrown.co.nz/code/jquery-aggregate/ for details. | |
License information: http://gregbrown.co.nz/code/license/ | |
*/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.contrib import admin | |
from django.contrib.auth.models import User | |
from django.contrib.auth.admin import UserAdmin | |
from django.forms.models import inlineformset_factory | |
from django import forms | |
from django.contrib.auth.forms import UserCreationForm, UserChangeForm | |
def upgrade_user_admin(UserProfile=None, unique_email=False, | |
list_display=None): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
from sorl.thumbnail.conf import settings | |
from sorl.thumbnail.base import ThumbnailBackend | |
FORMAT_DICT = { | |
'png': 'PNG', | |
'jpeg': 'JPEG', | |
'jpg': 'JPEG', |