Skip to content

Instantly share code, notes, and snippets.

View montylounge's full-sized avatar

Kevin montylounge

View GitHub Profile
"""
Flopsy
======
A very simple way to interact with python AMQPlib. For my case I'm using
RabbitMQ as my implementation but it should work with others.
settings.py
-----------
class KeepQueryStringModelAdmin(admin.ModelAdmin):
"""
A ModelAdmin that "fixes" the default behavior of redirecting to the
default change list after a save.
This class remembers the change list query string that was used for the
change list and redirects to it after a save, maintaining the ordering,
filtering, & pagination.
Thanks to Vlada Macek http://djangopeople.net/tuttle/
class KeepQueryStringModelAdmin(admin.ModelAdmin):
"""
A ModelAdmin that "fixes" the default behavior of redirecting to the
default change list after a save.
This class remembers the change list query string that was used for the
change list and redirects to it after a save, maintaining the ordering,
filtering, & pagination.
Thanks to Vlada Macek http://djangopeople.net/tuttle/
from mimetypes import guess_type
from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import Storage
from django.utils.encoding import iri_to_uri
import re
try:
import S3
except ImportError:
raise ImproperlyConfigured, "Could not load amazon's S3 bindings.\
"""
Copyright (c) 2009, Sean Creeley
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
"""
Copyright (c) 2008-2009, Nathan Borror
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list
of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
@montylounge
montylounge / .bashrc
Created August 17, 2009 03:34 — forked from justintv/.bashrc
# If you work with git, you've probably had that nagging sensation of not knowing what branch you are on. Worry no longer!
export PS1="\\w:\$(git branch 2>/dev/null | grep '^*' | colrm 1 2)\$ "
# This will change your prompt to display not only your working directory but also your current git branch, if you have one. Pretty nifty!
# ~/code/web:beta_directory$ git checkout master
# Switched to branch "master"
# ~/code/web:master$ git checkout beta_directory
# Switched to branch "beta_directory"
from django.shortcuts import render_to_response
from site.settings import DEBUG
class DevMiddleware:
def process_request(self, request):
if DEBUG == False:
if request.user.is_authenticated() == False:
if '/admin' not in request.path:
return render_to_response('splash.html')
=============================================================
Installing Multicore Solr 1.3.0 / Tomcat 6.0.X on Ubuntu 8.10
=============================================================
Install OpenJDK (comes from universe)::
aptitude install openjdk-6-jre
Download Tomcat 6.X and move it in place::
=============================================================
Installing Multicore Solr 1.3.0 / Tomcat 6.0.X on Ubuntu 8.10
=============================================================
Install OpenJDK (comes from universe)::
aptitude install openjdk-6-jre
Download Tomcat 6.X and move it in place::