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
var myObj = { | |
number: 10, | |
createElementsPType: function() { | |
new_element.click(this.showNumber.bind(this)); | |
} | |
createElementsjQuery: function() { | |
new_element.click(this.showNumber); | |
}, |
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
result = {"Location" => "http://dev.mypunchbowl.com"} | |
# ... | |
# somewhere down the line: | |
result["Location"] # => "http://c.dev.mypunchbowl.com" ... "c"?!? | |
class OhHaiObj |
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 RawRenderer < WillPaginate::LinkRenderer | |
def prepare col, opt, template | |
@collection = col | |
@options = opt | |
@options[:container] = nil | |
@template = template | |
@total_pages = @collection.total_pages | |
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
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 |
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
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 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 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 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 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 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 |