Skip to content

Instantly share code, notes, and snippets.

from django.db.models.signals import post_save
from project.app_name.models import MyModel
def do_something(sender, *args, **kwargs):
#do something awesome
post_save.connect(do_something, sender=MyModel)
@fxdgear
fxdgear / pip.conf
Created September 9, 2011 18:36 — forked from jezdez/pip.conf
My ~/.pip/pip.conf. More information here: http://pip.openplans.org/configuration.html
[global]
default-timeout = 60
respect-virtualenv = true
download-cache = ~/.pip/cache
log-file = ~/.pip/pip.log
build = ~/.pip/build
[install]
use-mirrors = true
### In view ###
def my_view(request, *args, **kwargs):
#stuff that happens
my_dict = { 'value1': "hi", 'value2': "world" }
return render_to_response(template, {
'my_dict': my_dict,
}, RequestContext(request))
postgres:
pkg:
-name: postgresql
- installed
service:
- running
- name: postgresql
postgis:
pkg:
version-control:
pkg:
- names:
- git
- git-core
- subversion
- mercurial
- installed
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
[program:program_name1]
environment = PYTHONPATH="<< set up your python path here >>",DJANGO_SETTINGS_MODULE="program.settings"
command=<< path to project >>/manage.py celeryd -v 2 -B -s celery -E -l INFO
user=nobody
numprocs=1
stdout_logfile=/var/log/celery/program_name1.log
stderr_logfile=/var/log/celery/program_name1.err
autostart=true
autorestart=true
A guy walks into a bar and orders a shot of whisky. He gulps it down and peeks into his shirt pocket.
He then orders another shot of whisky, gulps it down and peeks into his short pocket.
He orders a third shot and does the same thing. After the sixth shot, he asks the bartender for the bill, pays and starts to walk out.
Curiosity gets the better of the bartender and he says to the guy:
"Excuse me, but I noticed that every time you drank a shot, you kept looking into your pocket. I was wondering what's in your pocket.
"The guy slurs, "Well, I have a picture of my wife in my pocket. I keep drinking until she starts to look good."