Skip to content

Instantly share code, notes, and snippets.

syntax on
colorscheme elflord
filetype plugin indent on
set nocompatible
set nowrap
set showmatch
set tabstop=2
set incsearch
@russ
russ / gist:11685
Created September 19, 2008 23:16 — forked from cardplayer/gist:11671
# Make your changes
git commit -m "Your commit message"
git co joshp/staging
git merge master
git co joshp/production
git merge master
git push
git co master
# Push files to live servers
syntax on
colorscheme elflord
filetype plugin indent on
set nocompatible
set nowrap
set showmatch
set tabstop=2
set incsearch
[user]
name = "Russ Smith"
email = "russ@bashme.org"
[alias]
ci = commit -a -v
co = checkout
st = status -a
praise = blame
type of coupon "Free Shipping"
applies when { order total is over 100.0 }
type of coupon "10% Off"
applies when { always }
type of coupon "Buy A Shirt Get 2 Free"
applies when { order items contains { 2 shirts }}
<?
$routing = new Routing();
$mapper = new Mapper();
$mapper->connect(':controller/:action/:id', array( 'controller' => "pages", 'action' => "index", 'name' => "default" ));
$mapper->connect('signup', array( ':controller' => 'users', ':action' => 'create' ));
$mapper->connect('activate/:key', array( ':controller' => 'users', ':action' => 'activate' ));
$mapper->connect('set_password/:key', array( ':controller' => 'users', ':action' => 'set_password' ));
require 'rubygems'
require 'sinatra'
require 'RMagick'
ROOT_PATH = File.expand_path(File.dirname(__FILE__))
get '/*' do
resize_image(params[:splat].first)
redirect("/#{params[:splat].first}")
end
God.watch do |w|
w.name = 'starling'
w.interval = 5.seconds
w.start = 'starling'
w.stop = 'killall starling'
w.restart = 'killall starling && starling'
w.pid_file = '/var/run/starling.pid'
# determine when process has finished starting
w.transition(:init, { true => :up, false => :start }) do |on|
#!/usr/bin/env ruby
require 'open-uri'
while true do
r = open('http://google.com')
raise StandardError if r.status != [ '200', 'OK' ]
timestamp = Time.parse(r.read.match(/\<!\s*-- (.*?) (.*?)(--\s*\>)/)[2].strip)
raise StandardError if (Time.now - timestamp) > 600
setenv LC_CTYPE en_US.UTF-8
defutf8 on
autodetach on
crlf off
deflogin off
hardcopy_append on
startup_message off
vbell off