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
source 'http://rubygems.org' | |
gem 'rails', '3.0.7' | |
gem 'jquery-rails', '0.2.7' | |
gem 'uuid' | |
gem 'bson_ext' | |
gem 'mongo_ext' | |
gem 'mongo_mapper', '0.9.1' | |
gem 'devise' | |
gem 'mm-devise' |
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
# Note: not tested at all | |
module Dada | |
attr_accessor :config_reload_timestamp | |
def dalli | |
@dalli ||= Dalli::Client.new(client_args) | |
end | |
def check_config_timestamp |
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
class Conversation | |
#... | |
after_create :expire_dash_cache | |
def add_new_comments(comments) | |
# Do stuff w/ the new comments... | |
save | |
expire_dash_cache |
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
class Vid < AR::Base | |
after_save :encode | |
private | |
def encode | |
VidEncoder.go(self) | |
end | |
end | |
class VidEncoder |
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
Connection Times (ms) | |
min mean[+/-sd] median max | |
Connect: 51 57 4.5 55 72 | |
Processing: 60 71 7.9 70 158 | |
Waiting: 53 62 7.3 61 150 | |
Total: 111 127 8.3 126 210 | |
Percentage of the requests served within a certain time (ms) | |
50% 126 | |
66% 128 |
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
Mulligan.initialize | |
puts "BEGIN" | |
#succeeding | |
mulligan(:times => 4) do | |
puts "mulligan!" | |
end.on_failure do | |
puts "fail" |
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
ruby-1.9.2-p180 :013 > false.to_json | |
=> "false" | |
ruby-1.9.2-p180 :014 > JSON.parse(false.to_json) | |
JSON::ParserError: 737: unexpected token at 'false' | |
from /Users/ryan/.rvm/gems/ruby-1.9.2-p180@4seg/gems/json-1.5.1/lib/json/common.rb:148:in `parse' | |
... | |
from script/rails:6:in `<main>' | |
ruby-1.9.2-p180 :015 > |
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
ra:~ ryan$ rvm list | |
rvm rubies | |
=> ree-1.8.6-20090610 [ x86_64 ] | |
ree-1.8.7-2010.01 [ i386 ] | |
ree-1.8.7-2010.02 [ x86_64 ] | |
ruby-1.8.7-p249 [ i386 ] | |
ruby-1.8.7-p302 [ x86_64 ] | |
ruby-1.9.1-p243 [ ] |
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
ra:mongomapper ryan$ rvm use 1.8.7@mongo_mapper && rake test | |
info: Using ruby 1.8.7 p302 with gemset mongo_mapper | |
(in /Users/ryan/code/mongomapper) | |
--- Active Support Version: 3.0.0 --- | |
Loaded suite /Users/ryan/.rvm/gems/ruby-1.8.7-p302@mongo_mapper/gems/rake-0.8.7/lib/rake/rake_test_loader | |
Started | |
.................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................. |
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
ra:code$ rails new r3 | |
create | |
create README | |
create Rakefile | |
create config.ru | |
create .gitignore | |
create Gemfile | |
create app | |
create app/controllers/application_controller.rb | |
create app/helpers/application_helper.rb |