Skip to content

Instantly share code, notes, and snippets.

# urls.py (not complete by any means)
url(r'^$', 'display_lead_list', name='lead_list'),
url(r'^(?P<id>\d+)/edit/$', 'lead_edit', name='lead_edit'),
# views.py
@login_required
def display_lead_list(request, template_name='lead/lead_list.html'):
LeadFormSet = modelformset_factory(Lead)
try:
import settings_dev
except ImportError:
pass
case = case_form.save(commit=False)
case.created_by = request.user
case.last_modified_by = request.user
case.assigned_by = request.user
case.venue = venue
case.save()
@joonas
joonas / params.pp
Created August 28, 2011 16:59
puppet case reference
# from http://pastie.org/2444032
case $operatingsystem {
"Ubuntu": {
case $lsbdistrelease {
"10.04": { $service_name = "postgresql-${version}", }
"10.10": { $service_name = "postgresql", }
}
}
}
@joonas
joonas / gist:1176903
Created August 28, 2011 16:55
params
class postgres::params {
$service_name = $operatingsystem ? {
"Ubuntu" => $lsbdistrelease {
"10.04" => "postgresql-${version}",
"10.10", "11.04" => "postgresql",
},
default => "postgresql",
}
}
server {
listen 80;
server_name example.com;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
# Don't proxy static files like robots.txt and favicon.ico.
location ~ ^/(favicon.ico|robots.txt|sitemap.xml)$ {
alias /home/deploy/sites/.../public/$1;
}
import os
PROJECT_PATH = os.path.dirname(__file__)
TEMPLATE_DIRS = (
os.path.join(PROJECT_PATH, 'templates'),
)
$ sudo rabbitmqctl add_user myusername mypassword
$ sudo rabbitmqctl add_vhost myvhost
$ sudo rabbitmqctl set_permissions -p myvhost myusername "" ".*" ".*"
FB.Event.subscribe('edge.create', function(response) {
window.location.reload();
});
# deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
# deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates main restricted
# deb http://security.ubuntu.com/ubuntu lucid-security main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
deb-src http://us.archive.ubuntu.com/ubuntu/ lucid main restricted
## Major bug fix updates produced after the final release of the