This file contains 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 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 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 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 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
Apple Cider | |
INGREDIENTS (Nutrition) | |
6 cups apple cider | |
1/4 cup real maple syrup | |
2 cinnamon sticks | |
6 whole cloves | |
6 whole allspice berries | |
1 orange peel, cut into strips | |
1 lemon peel, cut into strips |
This file contains 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
class Admin::SearchesController < AdminController | |
def index | |
end | |
def show | |
@customers = case params[:query] | |
when 'customer': Search.find_customers(params[:value]) | |
when 'product': Search.find_customers_from_sku(params[:value]) | |
end | |
end |
This file contains 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 'rack' | |
require 'lsapi' | |
require 'datamapper' | |
DataMapper.setup( :default, | |
:adapter => 'mysql', | |
:host => 'localhost', | |
:username => 'root', | |
:password => '', |
This file contains 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
def render_esi(path) | |
if Rails.env == 'development' | |
div_id = Digest::MD5.hexdigest(path + rand.to_s) | |
out = content_tag(:div, :id => div_id) do '' end | |
out += content_tag(:script, :type => 'text/javascript') do | |
'$.ajax({ type:"GET", url:"' + path + '", dataType:"html", success:function(html) { $("#' + div_id + '").html(html) | |
} });' | |
end | |
else | |
'<esi:include src="' + path + '" />' |
This file contains 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
module Deck | |
( make | |
, shuffle | |
) where | |
import System.Random | |
data Suit = Club | Diamond | Heart | Spade | |
deriving (Eq, Show, Read, Enum) | |
This file contains 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
module Deck | |
( make | |
, shuffle | |
) where | |
import System.Random | |
data Suit = Club | Diamond | Heart | Spade | |
deriving (Eq, Show, Read, Enum) | |