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
raggi@mbk: ~ % ruby tiltbinding.rb | |
info: jruby-1.5.1: jruby 1.5.1 (ruby 1.8.7 patchlevel 249) (2010-06-06 f3a3480) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_20) [x86_64-java] | |
[:pass, A::B, :block] | |
info: macruby-0.6: MacRuby version 0.6 (ruby 1.9.0) [universal-darwin10.0, x86_64] | |
[:pass, A::B, :block] |
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
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
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
require 'eventmachine' | |
EM.run do | |
SEKRET_SAUCE = EM.attach( | |
open(RUBY_PLATFORM =~ /mswin|mingw/ ? 'NUL:' : '/dev/null', 'w') | |
) | |
EM.start_server('0.0.0.0', 80, Module.new do | |
def post_init; proxy_incoming_to(SEKRET_SAUCE); end | |
end) | |
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
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
require 'eventmachine' | |
require 'socket' | |
class Client < EM::Connection | |
include EM::P::LineText2 | |
HELP = "Server - Welcome to ghettochat. Use /nick to set your nick.\n" | |
def initialize(global_channel) | |
@global = global_channel |