My Recent Pastes (173 and counting)
Pastes by Defiler (173 and counting)
Below are the 15 most recent pasties by Defiler.
June 01, 2007
1:07PM EDT
by Defiler
View all 228 lines
## Ruby code
class Object
def should_equal(other)
puts "testing equality of #{self} and #{other}"
self
June 01, 2007
12:44PM EDT
by Defiler
View all 52 lines
### ruby code
class Object
def should_equal(other)
puts "testing equality of #{self} and #{other}"
self
June 01, 2007
11:50AM EDT
by Defiler
View all 11 lines
alias fail! fail def fail(err = nil, *rest) begin E2MM.Fail(self, err, *rest) rescue E2MM::ErrNotRegisteredException
May 31, 2007
10:06PM EDT
by Defiler
View all 89 lines
#hydra>cat adhoc/case_with_splat.rb x = case 'z' when *['a', 'b', 'c', 'd'] "foo" when *['x', 'y', 'z']
May 31, 2007
7:51PM EDT
by Defiler
sirb(eval):001> "case\nwhen true\np 'hi'\nwhen false\np 'bye'\nelse\np 'wtf'\nend".to_sexp => [:newline, 8, "(eval)", [:when, [:array, [:true]], [:newline, 3, "(eval)", [:fcall, :p, [:array, [:str, "hi"]]]]]]
May 31, 2007
7:48PM EDT
by Defiler
View all 31 lines
#hydra>cat adhoc/case_without_arg.rb case when true p 'hi' when false
May 31, 2007
7:39PM EDT
by Defiler
View all 77 lines
Index: shotgun/lib/grammar.y =================================================================== --- shotgun/lib/grammar.y (revision 1228) +++ shotgun/lib/grammar.y (working copy) @@ -329,7 +329,6 @@
May 31, 2007
2:10PM EDT
by Defiler
View all 17 lines
{ # X! and x!
my $t = 'C[3] x!8 C[2]';
my @a = (0x73..0x77);
my $p = pack($t, @a);
is($p, "\x73\x74\x75\0\0\0\0\0\x76\x77");
May 31, 2007
12:32PM EDT
by Defiler
View all 15 lines
>> class Foo >> def initialize >> p 5 >> end >> end
May 30, 2007
8:40PM EDT
by Defiler
View all 13 lines
def open_metaclass
<<-CODE
stack_push(object_metaclass(state, stack_pop()));
CODE
end
May 30, 2007
8:11PM EDT
by Defiler
View all 17 lines
def unleash_the_hounds puts "home again home again" @evil = false yield end
May 30, 2007
4:16PM EDT
by Defiler
View all 12 lines
(0..10).each do |block_param| block_var = block_param * 2 puts "block_var = #{block_var}, block_param = #{block_param}" for i in 1..5 puts "i = #{i}, block_var = #{block_var}, block_param = #{block_param}"
May 30, 2007
2:02PM EDT
by Defiler
View all 17 lines
#hydra>cat nested.rb (0..10).each do |block_param| block_var = block_param * 2 puts "block_var = #{block_var}, block_param = #{block_param}" for i in 1..5
May 29, 2007
9:30PM EDT
by Defiler
View all 199 lines
hydra>cat nested.rb
(0..10).each do |block_param|
block_var = block_param * 2
puts "block_var = #{block_var}, block_param = #{block_param}"
for i in 1..5
