Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Blueprint test pages</title>
<!-- Framework CSS -->
<link href="/stylesheets/screen.css" media="screen, projection" rel="stylesheet" type="text/css">
<link href="/stylesheets/print.css" media="print" rel="stylesheet" type="text/css">
def foo(size, default=0, existing=None):
"""
Yield values to a certain size, using an existing value at the same
index or the default value, in that order.
>>> f = foo(1)
>>> f.next()
0
>>> f.next()
Traceback (most recent call last):
// Automated way to delete unsubscribes in Mailchimp
links = dojo.query('.delete-member'); for (var x=0; x<links.length; x++) { window.open('http://us1.admin.mailchimp.com/lists/members/delete?id='+String(links[x].onclick).match('[0-9]{8,9}')[0], 'pop'+x) }
@tdavis
tdavis / supervisord.conf
Created October 26, 2010 19:48
supervisord upstart file
description "supervisord"
start on runlevel [2345]
stop on runlevel [016]
expect fork
respawn
exec /usr/local/bin/supervisord
@tdavis
tdavis / pg_backup.py
Created March 14, 2011 23:56
A script to backup a PostgreSQL.
#!/usr/bin/env python
import sys
import subprocess
import optparse
import os
from datetime import datetime
@tdavis
tdavis / fabconf.yaml
Created August 7, 2011 11:57
Simply fabfile for gunicorn deployment
app_directory: /workspace/project
static_directory: static
default:
postgres_user: postgres
venv_root: /var/env
gunicorn: my-gunicorn
app-servers:
venv: my_venv
(add-hook 'org-mode-hook
(lambda ()
(org-set-local 'yas/trigger-key [tab])
(define-key yas/keymap [tab] 'yas/next-field-or-maybe-expand)))
(defun yas/org-very-safe-expand ()
(let ((yas/fallback-behavior 'return-nil)) (yas/expand)))
(add-hook 'org-mode-hook
(lambda ()
➜ ~ sudo MAKEFLAGS="-skipinteg" pacman -S qtwebkit
resolving dependencies...
looking for inter-conflicts...
Packages (2): qt4-4.8.4-18 qtwebkit-2.3.1-2
Total Download Size: 20.38 MiB
Total Installed Size: 114.88 MiB
:: Proceed with installation? [Y/n]
➜ ~ sudo MAKEFLAGS="-skipinteg" pacman -S qtwebkit
resolving dependencies...
looking for inter-conflicts...
Packages (2): qt4-4.8.4-18 qtwebkit-2.3.1-2
Total Download Size: 20.38 MiB
Total Installed Size: 114.88 MiB
:: Proceed with installation? [Y/n]