Skip to content

Instantly share code, notes, and snippets.

View foca's full-sized avatar
👋
Looking for work!

Nicolás Sanguinetti foca

👋
Looking for work!
View GitHub Profile
foca ~/projects/self/integrity-rewrite (git: master*)
▸ shotgun config.ru -p 8910
== Shotgun starting Rack::Handler::Mongrel on localhost:8910
::1 - - [18/May/2009 03:28:46] "GET /integrity HTTP/1.1" 200 2160 0.6075
::1 - - [18/May/2009 03:28:46] "GET /integrity HTTP/1.1" 200 2160 0.6528
::1 - - [18/May/2009 03:28:49] "GET /integrity.css HTTP/1.1" 304 - 1.0706
::1 - - [18/May/2009 03:28:49] "GET /integrity.css HTTP/1.1" 304 - 1.2158
::1 - - [18/May/2009 03:28:49] "GET /buttons.css HTTP/1.1" 304 - 1.1708
::1 - - [18/May/2009 03:28:49] "GET /buttons.css HTTP/1.1" 304 - 1.2253
::1 - - [18/May/2009 03:28:49] "GET /reset.css HTTP/1.1" 304 - 1.1637
Compiling Passenger support files...
# /opt/ruby-enterprise/bin/ruby -S /opt/ruby-enterprise/bin/rake clean nginx
(in /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.2.2)
rm -rf ext/apache2/Configuration.o ext/apache2/Bucket.o ext/apache2/Hooks.o ext/apache2/mod_passenger.o ext/apache2/mod_passenger.so
rm -rf ext/nginx/HelperServer
rm -r pkg
rm -f ext/phusion_passenger/Makefile
rm -rf ext/apache2/libboost_oxt.a ext/apache2/libboost_oxt
rm -rf ext/apache2/libpassenger_common.a ext/apache2/ApplicationPoolServerExecutable ext/apache2/libpassenger_common
rm -rf ext/nginx/libboost_oxt.a ext/nginx/libboost_oxt
@foca
foca / cascade.rb
Created May 26, 2009 06:08
try requiring files until one of them is successfully required
def cascade_require(*libs)
require libs.shift.to_s
rescue LoadError
libs.empty? ? raise : retry
end
  • Last Night on Earth (The Zombie Game)
  • Tigris & Euphrates
  • Bang!
  • Order of the Stick
  • Khet
  • Si, Oscuro Signore
  • Settlers of Catan
  • Illuminati
  • Twilight Struggle
  • Starcraft: The Board Game
|
[a] *
|
[b] *
|\
[c] * \
| \
[d] * * [f]
| |
[e] * * [g]
with_options :env => "test" do |test|
test.gem "contest"
test.gem "stories"
test.gem "webrat"
test.gem "faker"
test.gem "notahat-machinist", :source => "http://gems.github.com", :lib => "machinist"
test.gem "redgreen"
end
with_options :source => "http://gems.github.com" do |github|
story <<-STORY do
As a developer,
I want to use the simplest tool for the job,
So that I don't waste time learning useless grammars
STORY
scenario "sweet and simple" do
# given
User.make(:name => "john")
{
:a => 2,
# NOTE for partials, you need to include the format
# otherwise, it'll fail to find byows/_byow.erb even if byows/_byow.html.erb exists
:b => render(:partial => 'example.html')
}.to_json
@foca
foca / file.rb
Created September 17, 2009 18:19
class Array
def includes_a?(other_array)
self | other_array == self
end
def includes_b?(other_array)
(other_array - self).empty?
end
@foca
foca / parent.rb
Created September 21, 2009 21:40
class ParentModel
def self.update_type_attributes(id, attributes)
find!(id).update_attribute(:type, attributes.delete(:type))
find(id).update_attributes(attributes)
end
end