Skip to content

Instantly share code, notes, and snippets.

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
#!/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"
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
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
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 + '" />'
require 'rubygems'
require 'rack'
require 'lsapi'
require 'datamapper'
DataMapper.setup( :default,
:adapter => 'mysql',
:host => 'localhost',
:username => 'root',
:password => '',
module Deck
( make
, shuffle
) where
import System.Random
data Suit = Club | Diamond | Heart | Spade
deriving (Eq, Show, Read, Enum)
module Deck
( make
, shuffle
) where
import System.Random
data Suit = Club | Diamond | Heart | Spade
deriving (Eq, Show, Read, Enum)
Feature: Locked articles
In order to view articles
A user that is a basic member
Should only see partial article content
And a user that is at a higher level
Should see full article content
Scenario: Not logged in as a user
Given there is a magazine article "WSOP"
When I go to the magazine article page "WSOP"
#!/usr/bin/ruby
Dir.chdir(ENV['RAILS_ROOT'])
require 'config/boot'
require 'active_support'
require 'action_controller'
require 'fileutils'
options = {