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
| module God | |
| class Socket | |
| def self.socket_file(port) | |
| "localhost:#{port}" | |
| end | |
| def self.socket(port) | |
| "drbhttp://#{self.socket_file(port)}" | |
| end | |
| end |
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
| z = {} | |
| z[:b][:c][:d] = 'e' | |
| # NoMethodError: undefined method `[]' for nil:NilClass | |
| hash_new = proc { Hash.new { |hash, key| hash[key] = Hash.new(&hash.default_proc) } } | |
| a = hash_new.call | |
| a[:b][:c][:d] = 'e' | |
| a | |
| # => {:b=>{:c=>{:d=>"e"}}} |
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
| /Users/dekz % irb | |
| irb(main):001:0> IRB.CurrentContext.io | |
| => #<IRB::ReadlineInputMethod:0x007fd723025420 @file_name="(line)", @line_no=1, @line=[nil, "IRB.CurrentContext.io\n"], @eof=false, @stdin=#<IO:fd 0>, @stdout=#<IO:fd 1>, @prompt="irb(main):001:0> "> |
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
| {"job"=>:start, "id"=>"CsgL2Asw8gUjFCs", "run"=>{"proc"=>"proc { |name, word| puts(\"Hi \#{name} you \#{word.read}\") }", "args"=>["jacob", #<File:./utils.rb>]}} | |
| worker::goO3G1bP4HORHhX: Run CsgL2Asw8gUjFCs | |
| Hi jacob you require 'openssl' | |
| class Utils | |
| def self.repeat_every(interval) | |
| Thread.new do | |
| loop do | |
| start_time = Time.now |
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
| # We need sourcify to turn the Proc into a string which can then be evaluated in the binding itself. | |
| require 'sourcify' | |
| b = nil | |
| eval "a='hello there';b=binding" | |
| def eval_with binding, &b | |
| binding.eval "#{b.to_source}.call" | |
| end |
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
| # 1.9 eval executes in its own scope, no way to get local variables which may have been assigned. | |
| # Thankfully eval has access to its parent execution scope, so we can assigned it inside eval! | |
| b = nil | |
| eval "a=:b;b=binding" | |
| p b.eval "a" | |
| # => :b | |
| # puts a # will 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
| . | |
| βββ Java\ 7\ Update\ 06\ Folder | |
| βΒ Β βββ Contents | |
| βΒ Β βββ Frameworks | |
| βΒ Β βΒ Β βββ Sparkle.framework | |
| βΒ Β βΒ Β βββ Headers -> Versions/Current/Headers | |
| βΒ Β βΒ Β βββ Resources -> Versions/Current/Resources | |
| βΒ Β βΒ Β βββ Sparkle -> Versions/Current/Sparkle | |
| βΒ Β βΒ Β βββ Versions | |
| βΒ Β βΒ Β βββ A |
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
| . | |
| βββ JDK\ 7\ Update\ 06\ Folder | |
| βΒ Β βββ Contents | |
| βΒ Β βββ Home | |
| βΒ Β βΒ Β βββ COPYRIGHT | |
| βΒ Β βΒ Β βββ LICENSE | |
| βΒ Β βΒ Β βββ README.html | |
| βΒ Β βΒ Β βββ THIRDPARTYLICENSEREADME-JAVAFX.txt | |
| βΒ Β βΒ Β βββ THIRDPARTYLICENSEREADME.txt | |
| βΒ Β βΒ Β βββ bin |
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
| done | |
| #<NoMethodError: undefined method `__jtrap' for #<Zab:0x153b2cb>> | |
| #<NoMethodError: undefined method `__jtrap' for #<Zab:0x3c63e8c>> | |
| #<NoMethodError: undefined method `__jtrap' for #<Zab:0x2e694f12>> | |
| #<NoMethodError: undefined method `__jtrap' for #<Zab:0x26dfe303>> |
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
| ~/tmp % ruby -v | |
| jruby 1.6.7 (ruby-1.8.7-p357) (2012-02-22 3e82bc8) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_31) [darwin-x86_64-java] | |
| ~/tmp % ruby zz.rb | |
| Decimal.new is a Decimal object?: false | |
| Modulo op class is BigDecimal | |
| Times op class is BigDecimal | |
| Div op class is BigDecimal |