This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# default debian install does not have sudo, | |
# run as root | |
apt-get -q -y install lsb-release | |
echo "deb http://apt.opscode.com/ `lsb_release -cs`-0.10 main" | tee /etc/apt/sources.list.d/opscode.list | |
wget -qO - http://apt.opscode.com/[email protected] | apt-key add - | |
apt-get update | |
apt-get -q -y install chef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** glibc detected *** thin server (127.0.0.1:3000): double free or corruption (out): 0x00002aaab42ad350 *** | |
======= Backtrace: ========= | |
/lib/libc.so.6[0x2ba1f4ce69a8] | |
/lib/libc.so.6(cfree+0x76)[0x2ba1f4ce8ab6] | |
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(onig_free_body+0x16)[0x2ba1f3e53586] | |
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(onig_free+0xe)[0x2ba1f3e536de] | |
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9(rb_reg_search+0x469)[0x2ba1f3e50f59] | |
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9[0x2ba1f3e90673] | |
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9[0x2ba1f3edf3c7] | |
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/libruby.so.1.9[0x2ba1f3ed3419] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
$:<< '../lib' << 'lib' | |
require 'goliath' | |
# Our custom Goliath API | |
class HelloWorld < Goliath::API | |
def response(env) | |
[200, {}, "hello world!"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# encoding: utf-8 | |
$:<< '../lib' << 'lib' | |
require 'goliath' | |
# Our custom Goliath API | |
class HelloWorld < Goliath::API | |
def response(env) | |
[200, {}, "hello world!"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ab -n 10000 -c 100 http://localhost:8000 | |
eventmachine: | |
Requests per second: 2495.36 [#/sec] (mean) | |
Time per request: 40.074 [ms] (mean) | |
node.js: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# gem install eventmachine eventmachine_httpserver | |
require 'eventmachine' | |
require 'evma_httpserver' | |
module HttpServer | |
include EM::HttpServer | |
def process_http_request | |
response = EM::DelegatedHttpResponse.new(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'eventmachine' | |
require 'logger' | |
class LoggedConnection < EM::Connection | |
attr_accessor :logger | |
def initialize(*args) | |
self.logger = args.pop[:logger] | |
super | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ABC | |
extend self | |
def abc | |
"abc" | |
end | |
end | |
puts ABC.abc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/init.d/xvfb start | |
DISPLAY=:99.0 rake spec | |
/etc/init.d/xvfb stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'socket' | |
require 'dm-core' | |
require 'fastercsv' | |
WRITE_SHUTDOWN = 1 | |
module DataMapper | |
module Adapters | |
class LqlAdapter < AbstractAdapter |