Skip to content

Instantly share code, notes, and snippets.

@roadsideseb
roadsideseb / generic.py
Created March 11, 2013 03:20
SearchView wrapper for haystack to bring it in line with Django 1.3+ CBV
from functools import update_wrapper
from django.conf import settings
from django.utils.decorators import classonlymethod
from django.views.generic.base import TemplateResponseMixin
from haystack.query import SearchQuerySet
from haystack.forms import FacetedSearchForm
from haystack.views import FacetedSearchView as HaystackFacetedSearchView
@roadsideseb
roadsideseb / gist:5127613
Created March 10, 2013 08:20
ZenPhoto / nginx config
server {
server_name domain.tld;
root /var/www/zenphoto;
index index.php;
# pass the PHP scripts to php-fpm server
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
@roadsideseb
roadsideseb / oscar_override_app.py
Created January 24, 2013 12:48
This is an unfinished managment command that I use when customising one of Oscar's core apps. It simply copies over all the files of the app (excluding subdirectories) and leaves the rest to you. I'd like to improve it at some point and make it part of Oscar but I didn't have the time for that yet. The command in action might look like this: ```…
import os
import imp
import shutil
import pkgutil
import logging
from optparse import make_option
from django.core.management.base import BaseCommand, CommandError
@roadsideseb
roadsideseb / sentry.conf (nginx)
Created October 2, 2012 12:41
Current configuration of sentry.roadside-developer.com
server {
listen 80;
server_name sentry.roadside-developer.com;
access_log /var/log/nginx/access.sentry.roadside-developer.com;
gzip on;
gzip_proxied any;
gzip_types text/plain application/xml application/x-javascript text/javascript text/css;
location / {