Skip to content

Instantly share code, notes, and snippets.

View joshbuddy's full-sized avatar
🤡
meow

Joshua Hull joshbuddy

🤡
meow
View GitHub Profile
crapbook-pro:http_router joshua$ ruby benchmarks/rec2.rb
Results |
-------------------------------------
2 levels, static 1.845 |
4 levels, static 2.066 |
8 levels, static 2.223 |
4 levels, 1 dynamic 2.206 |
8 levels, 3 dynamic 2.714 |
4 levels, 1 greedy 2.915 |
17044
var HTTPParser = process.binding('http_parser').HTTPParser;
var net = require('net');
var path = require('path');
var sys = require('sys');
var Worker = require('webworker/webworker').Worker;
var VHOSTS = ['foo.bar.com', 'baz.bizzle.com'];
var WORKERS = {};
VHOSTS.forEach(function(vh) {
p gems.map{|g|g[/_on_(.*)/,1]}.compact.inject({}){|h,g|(h[g]||=0);h[g]+=1;h}
p gems.map{|g|g[/_for_(.*)/,1]}.compact.inject({}){|h,g|(h[g]||=0);h[g]+=1;h}
p gems.map{|g|g[/_with_(.*)/,1]}.compact.inject({}){|h,g|(h[g]||=0);h[g]+=1;h}
p gems.map{|g|g[/_in_(.*)/,1]}.compact.inject({}){|h,g|(h[g]||=0);h[g]+=1;h}
p gems.map{|g|g[/_as_(.*)/,1]}.compact.inject({}){|h,g|(h[g]||=0);h[g]+=1;h}
Wakupdude.controllers :dudes do
set :haml, {:format => :html5 }
# get :index do
# render "dudes/index"
# end
get :all, "/" do
@dudes = Dude.all()
render "dudes/list"
module Foo
def foo
p :before
super
p :after
end
end
class Bar
def foo
p :foo
import java.net.InetSocketAddress
import java.util.concurrent.Executors
import org.jboss.netty.bootstrap.ServerBootstrap
import org.jboss.netty.channel.ChannelPipelineFactory
import org.jboss.netty.channel.Channels
import org.jboss.netty.channel.SimpleChannelUpstreamHandler
import org.jboss.netty.channel.socket.nio.NioServerSocketChannelFactory
import org.jboss.netty.channel.MessageEvent
class EchoServer
Whenever you're called on to make up your mind.
And you're hampered by not having any.
The simplest way to solve the dilemma you'll find,
Is simply by flipping a penny.
No, not so that chance shall decide the affair;
As you're passively standing there moping.
But as soon as the penny is up in the air,
You'll suddenly know what you're hoping.
development:
adapter: sqlite3
database: db/development.sqlite3
timeout: 5000
[joshbuddy@jj ~/Development/todo]$ bundle exec padrino g model List
/Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/thor-0.14.6/lib/thor/rake_compat.rb:33: undefined method `task' for class `Object' (NameError)
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/padrino-core-0.9.28/lib/padrino-core/cli/base.rb:8
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/padrino-core-0.9.28/bin/padrino:7:in `require'
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/gems/padrino-core-0.9.28/bin/padrino:7
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/bin/padrino:19:in `load'
from /Users/joshbuddy/.rvm/gems/ree-1.8.7-2011.03/bin/padrino:19
ruby-1.9.2-p180 :001 > body =<<-EMAIL.gsub(/ {6}/, '')
ruby-1.9.2-p180 :002"> asdasdasd
ruby-1.9.2-p180 :003"> EMAIL
=> "asdasdasd\n"