My Recent Pastes (901 and counting)
Pastes by headius (901 and counting)
Below are the 15 most recent pasties by headius.
November 17, 2008
4:05PM EDT
by headius
a = "asdf#{<<FOO}qwer" + <<BAR Yes, this... FOO does what you think it does. BAR
November 16, 2008
3:42PM EDT
by headius
View more (16 lines)
int
rb_cmpint(val, a, b)
VALUE val, a, b;
{
if (NIL_P(val)) {
November 16, 2008
2:04AM EDT
by headius
View more (24 lines)
## Arrays.fill
◆ jruby -rbenchmark -X+C -e "def foo; a = b = c = d = e = f = 1; 1.times {} if false; end; 10.times { puts Benchmark.measure { 1_000_000.times { foo } } }"
0.552000 0.000000 0.552000 ( 0.551269)
0.203000 0.000000 0.203000 ( 0.202914)
0.206000 0.000000 0.206000 ( 0.205337)
November 13, 2008
11:43PM EDT
by headius
View more (14 lines)
require 'jruby/rack' module Rack module Handler class Grizzly def initialize(rack_app)
November 13, 2008
2:56PM EDT
by headius
View more (89 lines)
#!/bin/bash # # Provides a function that allows you to choose a JDK. Just set the environment # variable JDKS_ROOT to the directory containing multiple versions of the JDK # and the function will prompt you to select one. JAVA_HOME and PATH will be cleaned
November 13, 2008
2:16PM EDT
by headius
View more (21 lines)
# Evaluate the block with the given arguments within the context of # this object, so self is set to the method receiver. # # From Mauricio's http://eigenclass.org/hiki/bounded+space+instance_exec def instance_exec(*args, &block)
November 13, 2008
11:13AM EDT
by headius
View more (14 lines)
[java] 1) [java] Array#fill with (filler, index, length) raises an ArgumentError or RangeError for too-large sizes FAILED [java] Expected ArgumentError [java] but got RangeError (integer 9223372036854775807 too big to convert to `int') [java] /Users/headius/projects/jruby/spec/ruby/1.8/core/array/fill_spec.rb:222
November 12, 2008
7:43PM EDT
by headius
View more (18 lines)
◆ jruby spec/mspec/bin/mspec tag spec/ruby/1.8/core/kernel/load_spec.rb jruby 1.1.5 (ruby 1.8.6 patchlevel 114) (2008-11-12 rev 8053) [x86_64-java] .....F................ 1)
November 12, 2008
10:05AM EDT
by headius
View more (15 lines)
[headius @ cnutter:~] ◆ jruby -e "module X; autoload :Y, 'bar/foo'; module Z; def self.yoohoo; Y; end; end; end; Z.yoohoo" :1:in `const_missing': uninitialized constant Z (NameError) from :1 [headius @ cnutter:~]
November 11, 2008
3:22PM EDT
by headius
View more (9 lines)
$ ruby1.9 -e "def foo(a, (b, *c), d = 2, *e, (f, g), h); p a,b,c,d,e,f,g,h; end; foo(1, [2,3,4,5], 6, 7, 8, [9, 10, 11], 12)" 1 2 [3, 4, 5] 6
November 11, 2008
3:15PM EDT
by headius
View more (7 lines)
$ ruby1.9 -e "def foo(a, (x, *b, c), *d, e); p a, x, b, c, d, e; end; foo(1, [2,3,4,5], 6, 7, 8)" 1 2 [3, 4] 5
November 10, 2008
2:18PM EDT
by headius
View more (18 lines)
# use PathPrefix Middleware if :path_prefix is set in Merb::Config if prefix = ::Merb::Config[:path_prefix] use Merb::Rack::PathPrefix, prefix end
November 10, 2008
2:11PM EDT
by headius
View more (21 lines)
◆ merb -a thin Loading init file from /Users/headius/RubyConf2008/merbapp2/config/init.rb Loading /Users/headius/RubyConf2008/merbapp2/config/environments/development.rb Logging to file at /Users/headius/RubyConf2008/merbapp2/log/production.log /Library/Ruby/Gems/1.8/gems/merb-core-1.0/lib/merb-core/rack/middleware.rb:14:in `deferred?': undefined method `deferred?' for #<Proc:0x191a3b0> (NoMethodError)
November 10, 2008
1:44PM EDT
by headius
View more (42 lines)
class Grizzlet def service(req) setup_logger info = req.getRequestProcessor() request_uri = req.requestURI.to_s
November 08, 2008
2:20PM EDT
by headius
View more (78 lines)
*** LOCAL GEMS *** abstract (1.0.0) actionmailer (2.2.0, 2.1.2)
