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 Foo | |
def foo | |
h1 # this is allowed | |
end | |
def self.bar | |
h1 # this is not allowed | |
end | |
private |
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 A | |
a = 1 | |
end | |
how could I get the value of a outside of class A? | |
A.send(:local_variables) | |
=> ["_"] | |
there's no local variables named a in the class A. |
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
$ nanite-agent --token bob | |
[Sat, 31 Oct 2009 20:39:58 +0800] INFO: [setup] setting log level to INFO | |
[Sat, 31 Oct 2009 20:39:58 +0800] INFO: [setup] setting log level to INFO | |
[Sat, 31 Oct 2009 20:39:58 +0800] INFO: [setup] loading /Users/hliu/Sandbox/nanite/examples/simpleagent/actors/simple.rb | |
[Sat, 31 Oct 2009 20:39:58 +0800] INFO: [actor] Simple | |
[Sat, 31 Oct 2009 20:39:58 +0800] INFO: SEND [register] bob, services: /simple/echo, /simple/time, /simple/gems, /simple/yielding, /simple/delayed, tags: | |
[Sat, 31 Oct 2009 20:40:13 +0800] INFO: RECV [advertise] | |
[Sat, 31 Oct 2009 20:40:13 +0800] INFO: SEND [register] bob, services: /simple/echo, /simple/time, /simple/gems, /simple/yielding, /simple/delayed, tags: | |
[Sat, 31 Oct 2009 20:40:27 +0800] INFO: RECV [request] <a73fc2ba6daaf3d3545d081346907e24> /simple/echo from mapper |
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
$ ./cli.rb | |
[Sat, 31 Oct 2009 20:40:11 +0800] INFO: [setup] setting log level to INFO | |
[Sat, 31 Oct 2009 20:40:11 +0800] INFO: [setup] setting log level to INFO | |
[Sat, 31 Oct 2009 20:40:11 +0800] INFO: [setup] starting mapper | |
[Sat, 31 Oct 2009 20:40:13 +0800] INFO: SEND [advertise] to nanite-bob | |
[Sat, 31 Oct 2009 20:40:13 +0800] INFO: RECV [register] bob, services: /simple/echo, /simple/time, /simple/gems, /simple/yielding, /simple/delayed, tags: | |
[Sat, 31 Oct 2009 20:40:27 +0800] INFO: SEND [request] <a73fc2ba6daaf3d3545d081346907e24> /simple/echo from mapper to bob | |
[Sat, 31 Oct 2009 20:40:41 +0800] INFO: Nanite nanite-bob timed out |
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
system '/usr/bin/scp hekin@remote_machine:/home/hekin/test .' |
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
author.posts.find(:last, :conditions => ["tag = ?", 'Ruby'], :order => "updated_at ASC") |
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
function isNumeric(val) { | |
return !isNaN(val.split(",").join("")); | |
} | |
function isCurrency(val, options) { | |
var val = val.replace(/^\$?/, ''); | |
return isNumeric(val); | |
} |
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
An error has occurred, all later migrations canceled: | |
undefined method `set_price' for #<Order:0xc943728> |
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
$ diff debugger console | |
1a2,7 | |
> AASM::Persistence::ActiveRecordPersistence::WriteStateWithoutPersistence | |
> AASM::Persistence::ActiveRecordPersistence::WriteState | |
> AASM::Persistence::ActiveRecordPersistence::ReadState | |
> AASM::Persistence::ActiveRecordPersistence::InstanceMethods | |
> AASM::Persistence::ActiveRecordPersistence | |
> AASM | |
30d35 | |
< Delayed::MessageSending |
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
Say I have a Person model, | |
app/models/person.rb | |
class Person < ActiveRecord::Base | |
validates_uniquess_of :name | |
end | |
db/migrate/2010009912_add_index_to_people.rb |
OlderNewer