Moved to: rubygems/install
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
# Example of the implementation | |
class Template | |
module CompileSite; end | |
def compile(klass, name, source) | |
klass.class_eval <<-RUBY | |
lambda {}.binding.__send__ :eval, <<-RB | |
def \#{name}(locals) | |
\#{source} |
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
# Someone was using a test helper of mine that relies on a simple assert | |
# method. As this doesn't exist in rspec, I had to make one, but I wanted the | |
# messages to work, so, it blew up a little. | |
module Assert | |
class Matcher | |
def initialize(object, message = nil) | |
@object, @message = object, message | |
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
p(%|#{<<-''}|[?\0...-0x0_2]<<% == <<%< ><<%&#{?../ 0.0_0 }&) | |
A Big Number Divided By Zero | |
ruby &= { :spirit => :creative } | |
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
A = [8, -21, 8, 2].zip(self.inspect.scan(/./)).map { |a,b| (b[0] - a).chr }.join | |
B = <<-B | |
011010000111010001110100011100000011101000101111001011110110011101101001011101 | |
000110100001110101011000100010111001100011011011110110110100101111011000100111 | |
001001111001011000010110111001110111011011110110111101100100011100110010111101 | |
101011011010010111010001110100011110010010111101110010011000010111011100101111 | |
011011010110000101110011011101000110010101110010001011110110001001101001011011 | |
10001011110110101101101001011101000111010001111001 | |
B | |
require %w[6f70656e2d757269].pack('H*') |
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
require 'eventmachine' | |
require 'kconv' | |
class BBSTerm < EM::Connection | |
def post_init | |
@read_buffer = "" | |
@initialization = true | |
end | |
def receive_data(data) |
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 Proc; alias ending call; end | |
story = never'ending' | |
story =-> { never.ending } | |
never =-> { story.ending } | |
story === never.ending |
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
08:58 Defi_: can anyone tell me if there are any obvious disadvantages to patching a blocking library to use fibers at the socket level? | |
08:58 Defi_: its far too much effort to have to rewrite large chunks of every library just to make it async and fiber-aware | |
08:59 raggi: if it uses non-stack stored state you could end up with concurrency issues (read: race conditions) | |
08:59 raggi: fibers as implemented in MRI have limited size stacks (4kb) | |
09:00 Defi_: hmm alright :/ | |
09:01 raggi: if the library is trying to be thread safe, it can make a real mess too | |
09:01 raggi: Defi_: just use threads. | |
09:02 Defi_: raggi: not gonna happen... | |
09:02 Defi_: even if this was a personal project, i wouldnt use threads | |
09:03 Defi_: guess ill just have to continue rewriting parts of a bunch of libs as i go |
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
gemmirror/code/a/autobundle-1.0.0.pre1/lib/rubygems_plugin.rb | |
gemmirror/code/a/autobundle-1.0.0.pre2/lib/rubygems_plugin.rb | |
gemmirror/code/a/authoxy-1.2.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/specific_install-0.2.2/lib/rubygems_plugin.rb | |
gemmirror/code/s/specific_install-0.2.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/specific_install-0.2.3/lib/rubygems_plugin.rb | |
gemmirror/code/s/show_gem-0.0.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/show_gem-0.0.2/lib/rubygems_plugin.rb | |
gemmirror/code/s/shway-3.0.1/lib/rubygems_plugin.rb | |
gemmirror/code/s/shway-3.0/lib/rubygems_plugin.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
gc_mark_children() | |
{ | |
cthulhu: | |
fthagn() | |
fthagn!() | |
goto cthulhu; | |
} |