Skip to content

Instantly share code, notes, and snippets.

======================================================
Setting up Django using Apache/mod_wsgi on Ubuntu 8.10
======================================================
This article will cover setting up Django using Apache/mod_wsgi on Ubuntu
8.10. The article is targeted at a production environment, but keep in mind
this is a more generalized environment. You may have different requirements,
but this article should at least provide the stepping stones.
The article will use distribution packages where nesscary. As of 8.10 the
@textarcana
textarcana / cucumber_cheatsheet.markdown
Created December 22, 2009 01:47
Cucumber cheatsheet

Cucumber cheatsheet

Best cheatsheet is: cucumber --help

Output formats

Reporting

Notification formats, in increasing order of verbosity:

@tomcritchlow
tomcritchlow / 7books.py
Created November 9, 2010 23:23
The main code for 7books (www.7bks.com)
import cgi
import os
from google.appengine.ext.webapp import template
from google.appengine.api import users
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext import db
from google.appengine.api import memcache
from google.appengine.api import urlfetch
@igrigorik
igrigorik / webapp.rb
Created November 13, 2010 21:28
Inspired by @JEG2's talk at Rubyconf... Any ruby object, as a webapp! 'Cause we can. :-)
require 'rubygems'
require 'rack'
class Object
def webapp
class << self
define_method :call do |env|
func, *attrs = env['PATH_INFO'].split('/').reject(&:empty?)
[200, {}, send(func, *attrs)]
end
@visnup
visnup / README.js
Created November 15, 2010 21:36 — forked from igrigorik/webapp.rb
node.js version inspired by igrigorik's any ruby object, as a webapp! 'cause we can too.
#!/usr/bin/env node
var http = require('http')
, webapp = require('webapp');
http.createServer(webapp.bind([])).listen(8000);
// ^^^^^^^^^^^^^^^
// | (x)
// ROFLSCALE DEQUE ---/
@ryanb
ryanb / favorite_gems.md
Created March 4, 2011 17:31
A list of my favorite gems for various tasks.
@lfborjas
lfborjas / continuation.rb
Created March 28, 2011 11:18
Examples of continuations
class Array
def one_at_a_time
control_state = lambda do |ret|
each do |elem|
callcc do |resume|
control_state = lambda do |r|
resume.call r
end
ret.call elem
end
@tekacs
tekacs / show
Created April 20, 2011 17:55
This does something essentially equivalent to showoff.io if you have a publicly facing server...
# Usage: show <local-port> <subdomain>
function show() {
DOMAIN=".tekacs.com"
REMOTE="$2$DOMAIN"
ssh -tR 1080:127.0.0.1:$1 vps "sudo ssh -Nl \$USER -L $REMOTE:80:127.0.0.1:1080 localhost"
}
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best
@lfborjas
lfborjas / .vimrc
Created July 26, 2011 22:24 — forked from jeresig/.vimrc
VIM Config
au BufRead,BufNewFile jquery.*.js set ft=javascript syntax=jquery
set nocompatible
set autoindent
set tabstop=2
set showmatch
set vb t_vb=
set ruler
set nohls
set incsearch
syntax on