This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'simple-daemon' | |
| class Daemon < SimpleDaemon::Base | |
| SimpleDaemon::WorkingDirectory = File.join(File.dirname(__FILE__), '..', 'log') | |
| def self.start | |
| puts "Starting" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Server Software: Mongrel | |
| Server Hostname: 127.0.0.1 | |
| Server Port: 3000 | |
| Document Path: / | |
| Document Length: 1335 bytes | |
| Concurrency Level: 20 | |
| Time taken for tests: 382.962628 seconds | |
| Complete requests: 4000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| setenv LC_CTYPE en_US.UTF-8 | |
| defutf8 on | |
| autodetach on | |
| crlf off | |
| deflogin off | |
| hardcopy_append on | |
| startup_message off | |
| vbell off |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <? | |
| $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' )); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [user] | |
| name = "Russ Smith" | |
| email = "russ@bashme.org" | |
| [alias] | |
| ci = commit -a -v | |
| co = checkout | |
| st = status -a | |
| praise = blame | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax on | |
| colorscheme elflord | |
| filetype plugin indent on | |
| set nocompatible | |
| set nowrap | |
| set showmatch | |
| set tabstop=2 | |
| set incsearch |