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 print_out(string) | |
STDOUT << string | |
end | |
def products | |
@products ||= { 827 => {'name' => "ARM", 'price' => 349.99}, | |
199 => {'name' => "LEG", 'price' => 224.75}, | |
776 => {'name' => "FIRSTBORN", 'price' => 1499.95}, | |
222 => {'name' => "LIFESAVINGS", 'price' => 49.99}, | |
811 => {'name' => "RETIREMENT", 'price' => 49.99} |
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 'net/http' | |
require 'uri' | |
url = URI.parse 'http://localhost:5984/test/test' | |
req = Net::HTTP::Get.new(url.path) | |
start = Time.now | |
100.times do | |
http = Net::HTTP.start(url.host, 5984) | |
http.request(req) |
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 'rake/gempackagetask' | |
require 'merb-core' | |
require 'merb-core/tasks/merb' | |
dependency 'dm-core' | |
dependency 'merb_datamapper' | |
# Load the basic runtime dependencies; this will include |
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
#================== config/dependencies.rb | |
dependency "merb-action-args", "0.9.9" # Provides support for querystring arguments to be passed in to controller actions | |
dependency "merb-assets", "0.9.9" # Provides link_to, asset_path, auto_link, image_tag methods (and lots more) | |
dependency "merb-cache", "0.9.9" # Provides your application with caching functions | |
dependency "merb-helpers", "0.9.9" # Provides the form, date/time, and other helpers | |
dependency "merb-mailer", "0.9.9" # Integrates mail support via Merb Mailer | |
dependency "merb-slices", "0.9.9" # Provides a mechanism for letting plugins provide controllers, views, etc. to your app | |
dependency "merb-auth", "0.9.9" # An authentication slice (Merb's equivalent to Rails' restful authentication) | |
dependency "dm-core", "0.9.6" # The datamapper ORM |
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
Merb::Router.prepare do | |
identify User => [:account, :login] do | |
resources :users do | |
resources :pledges do | |
resources :donations | |
end | |
end | |
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
CmdUtils.CreateCommand( | |
{ | |
name: "ruby", | |
takes: {"function": noun_arb_text}, | |
icon: "http://ruby-doc.org/favicon.ico", | |
homepage: "http://jackndempsey.blogspot.com", | |
author: {name: "Jack Dempsey", email: "jack.dempsey@gmail.com"}, | |
license: "MPL,GPL", | |
description: "Search ruby functions documentation", | |
help: "Select a ruby function", |
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
This is gist. | |
There are many like it, but this one is mine. | |
It is my life. | |
I must master it as I must master my life. | |
Without me gist is useless. | |
Without gist, I am useless. |
NewerOlder