Best cheatsheet is: cucumber --help
Notification formats, in increasing order of verbosity:
| ====================================================== | |
| 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 |
| 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 |
| 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 |
| #!/usr/bin/env node | |
| var http = require('http') | |
| , webapp = require('webapp'); | |
| http.createServer(webapp.bind([])).listen(8000); | |
| // ^^^^^^^^^^^^^^^ | |
| // | (x) | |
| // ROFLSCALE DEQUE ---/ |
These are some of my (Ryan Bates) favorite gems to use for various tasks:
| 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 |
| # 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 |
| 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 |