Skip to content

Instantly share code, notes, and snippets.

@bwhitman
bwhitman / gist:6263131
Created August 18, 2013 18:17
Suggestions for the Echo Nest Softball Team Name
What's on Second
Itsamateursecco
The Ghost Tracks
Marni & The Greenbergs
I Can't Believe The Echo Nest Has a Softball Team
Family Game Night
The Sonos Whiplash
Echo Best
The Taste Profiles
reallyhit()
@albertsun
albertsun / linebreaks_wp.py
Created August 21, 2011 05:44
Python port of WordPress's wpautop filter
import re
from django import template
from django.utils.functional import allow_lazy
from django.template.defaultfilters import stringfilter
from django.utils.safestring import mark_safe, SafeData
from django.utils.encoding import force_unicode
from django.utils.html import escape
from django.utils.text import normalize_newlines
register = template.Library()
@mikeyk
mikeyk / redis_session_backend.py
Created April 8, 2011 18:01
A redis backend for Django Sessions, tested on Django 1.3+
from django.contrib.sessions.backends.base import SessionBase, CreateError
from django.conf import settings
from django.utils.encoding import force_unicode
import redis
class SessionStore(SessionBase):
""" Redis store for sessions"""
def __init__(self, session_key=None):
self.redis = redis.Redis(
# For Haystack 1.0 or lower
*/15 * * * * cd /path/to/my/site/ && DJANGO_SETTINGS_MODULE=site.settings PYTHONPATH=.:..:../lib python ./manage.py reindex --age=1 > ../../log/search_indexes.log
# For Haystack 1.1 or higher
*/15 * * * * cd /path/to/my/site/ && DJANGO_SETTINGS_MODULE=site.settings PYTHONPATH=.:..:../lib python ./manage.py update_index --age=1 > ../../log/search_indexes.log