Skip to content

Instantly share code, notes, and snippets.

View franckverrot's full-sized avatar
📚
🥋

Franck Verrot franckverrot

📚
🥋
View GitHub Profile
[2011-08-04 00:57:42] make
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c array.c
WARNING: While resolving call to function 'inspect_ary' arguments were dropped!
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c bignum.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c class.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c compar.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c dir.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c dln.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c enum.c
gcc -g -O2 -pipe -fno-common -DRUBY_EXPORT -I. -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -c enumerator.c
@franckverrot
franckverrot / gist:1111572
Created July 28, 2011 13:41
build.find query plan
travis_development=# explain select * from builds where id = 42;
QUERY PLAN
-----------------------------------------------------------------------------
Index Scan using builds_pkey on builds (cost=0.00..8.27 rows=1 width=5344)
Index Cond: (id = 42)
(2 rows)
@franckverrot
franckverrot / gist:1105103
Created July 25, 2011 20:27
Travis-CI CFP

"Travis CI - Distributed, Continous Integration for the Ruby community

""The future is already here — it's just not very evenly distributed."" (William Gibson)

The Ruby community is where a lot of this future already happens. We not only set the bar higher and higher every day, we've also built most of the infrastructure use day to day. Twitter, Github, Gemcutter, Pusher to just name a few projects that changed the world, the way we live and work.

With Travis CI, an open source continous integration service for the Ruby community, we are

@franckverrot
franckverrot / database.yml.erb
Created July 1, 2011 21:35 — forked from thbar/database.yml.erb
Heroku database.yml
<%
require 'cgi'
require 'uri'
begin
uri = URI.parse(ENV["DATABASE_URL"])
rescue URI::InvalidURIError
raise "Invalid DATABASE_URL"
end
@franckverrot
franckverrot / database.yml.erb
Created July 1, 2011 21:35 — forked from thbar/database.yml.erb
Heroku database.yml
<%
require 'cgi'
require 'uri'
begin
uri = URI.parse(ENV["DATABASE_URL"])
rescue URI::InvalidURIError
raise "Invalid DATABASE_URL"
end
Gem::Specification.new do |s|
# totally generic
version_file = Dir['lib/*/{*/,}version.rb'].first
s.name = version_file.split('/')[1..-2].join('-')
s.files = `git ls-files`.split("\n")
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.authors = `git shortlog -sn`.scan(/[^\d\s].*/)
s.email = `git shortlog -sne`.scan(/[^<]+@[^>]+/)
s.require_paths = ["lib"]
@franckverrot
franckverrot / bom
Created May 11, 2011 06:35
Sproutcore's bom
./bin/sc-build
./bin/sc-build-number
./bin/sc-docs
./bin/sc-gen
./bin/sc-init
./bin/sc-manifest
./bin/sc-server
./bin/sproutcore
./local/sproutcore/VERSION.yml
class Foo
def bar
def baz
:baz
end
:bar
end
end
begin
@franckverrot
franckverrot / RUNME-demo_of_async_fibers.log
Created April 27, 2011 20:40 — forked from mrflip/RUNME-demo_of_async_fibers.log
A fully-commented demo showing execution flow in the fibers+eventmachine => linear asynchronous code pattern
>> load './RUNME-demo_of_async_fibers.rb'
/Users/flip/ics/backend/son_of_a_batch/RUNME-demo_of_async_fibers.rb:4: warning: already initialized constant FIBER_IDXS
814e5e90 0 f_0 beg main top level
814e5e90 1 f_0 beg em setup this block sets up the eventmachine execution, but no execution-order shenanigans yet
814e5e90 2 f_0 beg fiber stp the end-the-reactor block won't be called for 1.5s, so we get here immediately.
814e5e90 3 f_0 end fiber stp nothing from inside the Fiber.new{} block has run yet.
814e5e90 4 f_0 end fiber stp kick off the fiber...
80d829a0 5 f_1 beg fiber when my_fiber.resume is called, this runs. Now in a new fiber
80d829a0 6 f_1 beg get_result get_result is called from within fiber_1
80d829a0 7 f_1 setup callback set up some code to run 1.5s from now
@franckverrot
franckverrot / rails3-routing.rb
Created February 20, 2011 21:41
Some Rails 3 router virtual host constraints powered by Ruby 1.9 goodness
MyApp::Application.routes.draw do
virtual_hosts = %w(www.example.com www.foo.bar)
constraints ->(request) { virtual_hosts.include? request.domain(3) } do
# some resources
end
end