Skip to content

Instantly share code, notes, and snippets.

View tarcieri's full-sized avatar

Tony Arcieri tarcieri

View GitHub Profile
m=255
r=(0..256)
j=0
Sk=r.to_a.map{|i|j=(j+S[i]+K[i%16])&m}
St=[]
i=j=0
r.each{|i|
i&=m
j=(j+S[i])&m
S[i],S[j]=S[j],S[i]
require 'bundler/setup'
require 'celluloid'
class Something
include Celluloid
include Celluloid::Logger
def perform
# some complex operation
sleep 10
@tarcieri
tarcieri / gist:2492307
Created April 25, 2012 19:00 — forked from thommahoney/gist:2491946
RailsConf 2012 Lightning Talks
1 min:
~Painless Javascript
koting hatduklgg
with wind tunnel
~tenderlove.dup jremsikjr
~iwanttolearnruby.com
(collecting resources for learning ruby)
@tarcieri
tarcieri / fib.js
Created March 12, 2012 23:27 — forked from ry/fib.js
a proper fibonacci server in node. it will light up all your cores.
var http = require('http')
var fork = require('child_process').fork;
function fib(n) {
if (n < 2) {
return 1;
} else {
return fib(n - 2) + fib(n - 1);
}
}
@tarcieri
tarcieri / results
Created January 11, 2012 19:39 — forked from mattetti/results
Compare Nokogiri on JRuby (Apache Xerces) with 1.9.3 (libxml2)
╭─tony@wintermute ~/1595740 ‹ruby-1.9.3› ‹master*›
╰─$ ruby xmlbench.rb
11.250000 1.260000 12.510000 ( 12.515502)
11.610000 1.310000 12.920000 ( 12.922546)
11.660000 1.450000 13.110000 ( 13.107651)
11.500000 1.400000 12.900000 ( 12.901641)
11.440000 1.280000 12.720000 ( 12.712830)
╭─tony@wintermute ~/1595740 ‹jruby-1.6.5.1› ‹master*›
╰─$ ruby xmlbench.rb
@tarcieri
tarcieri / test.rb
Created May 2, 2011 01:24 — forked from Nemo157/test.rb
Rubinius error
→ ruby -d -W2 --vv test.rb
rubinius 1.2.4dev (1.8.7 77994afa yyyy-mm-dd) [x86_64-apple-darwin10.7.0]
Options:
Interpreter type: static
JIT disabled
An exception occurred running test.rb
Tried to use object of type PackedObject (45) as type LookupTable (35) (TypeError)
Backtrace: