Skip to content

Instantly share code, notes, and snippets.

View mattetti's full-sized avatar

Matt Aimonetti mattetti

View GitHub Profile
@mattetti
mattetti / gist:248
Created July 21, 2008 21:13 — forked from schacon/gist:1
my test fork!
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.
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",
Merb::Router.prepare do
identify User => [:account, :login] do
resources :users do
resources :pledges do
resources :donations
end
end
end
end
#================== 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
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
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)
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}
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}
CIS 282
Files Assignment
To turn in:
 Attach a file files_lastname.rb as an attachment to the assignment in Blackboard
 Subject line: CIS 282, Name, Files
To do:
Take your program from the Hash Assignment and modify it to use files for storing the data instead of initializing the data at run-time.
=== Epic Snow Leopard Upgrayyyyd Guide ===
Son, you’re now living in the land of 64-bit systems.
That means that some of your 32-bit shit is now broken.
Not all is lost.
== Fixing MySQL weirdness