Skip to content

Instantly share code, notes, and snippets.

@burke
burke / Yehudalize.rb
Created April 21, 2011 19:15 — forked from stefanpenner/Yehudalize.rb
An extension that stef should always include
module Yehudalize
def method_missing(method_sym, *arguments, &block)
if method_sym.to_s =~ /^(omg_)?(.*)_to_me$/
send($2.to_sym, *arguments, &block)
else
super
end
end
end
############# THIS IS WITHIN THE LIBRARY #############
class Foo
def initialize(a, b, c, opts={})
#do some stuff
end
end
######################################################
@burke
burke / 0-readme.md
Created January 18, 2012 15:58 — forked from titanous/0-readme.md
Ruby 1.9.3-p0 with ruby-debug19

Ruby 1.9.3-p0 with ruby-debug19

Ruby 1.9.3-p0 requires a minor patch to make ruby-debug19 work. If you have ruby-build and rbenv installed, these scripts will install ruby-1.9.3-p0.

curl https://raw.github.com/gist/1633720/install-ruby-1.9.3-p0.sh | sh
@burke
burke / gist:4365977
Last active December 10, 2015 02:09 — forked from snoble/gist:4365689
def foo(x); 99; end
a = foo (44) / 11
foo = 99999999
b = foo (44) / 11
puts "a: #{a} b: #{b}" #output of "a: 99 b: 9"
# s(:defn, :foo, s(:args, :x), s(:lit, 99)),
# s(:lasgn, :a, s(:call, nil, :foo, s(:call, s(:lit, 44), :/, s(:lit, 11)))),
# s(:lasgn, :foo, s(:lit, 99999999)),
# s(:lasgn, :b, s(:call, s(:call, nil, :foo, s(:lit, 44)), :/, s(:lit, 11))))
@burke
burke / 1.9.3-p385-perf
Last active December 16, 2015 20:08 — forked from stan/1.9.3-p385-falcon
build_package_combined_patch() {
local package_name="$1"
{
curl https://github.com/funny-falcon/ruby/compare/p385...p385_ary_queue.diff | patch -p1
curl https://github.com/funny-falcon/ruby/compare/p385...p385_st_opt.diff | patch -p1
curl https://github.com/funny-falcon/ruby/compare/p385...p385_backport_speedup_require.diff | patch -p1
curl https://github.com/funny-falcon/ruby/compare/p385...p385_backport_gc.diff | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
@burke
burke / 0-readme.md
Created January 27, 2012 13:44 — forked from funny-falcon/cumulative_performance.patch
ruby-1.9.3-p327 cumulative performance patch for rbenv

ruby-1.9.3-p327 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p327 with various performance improvements and a backported COW-friendly GC, all courtesy of funny-falcon.

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.