This file contains hidden or 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
def hello(*args) | |
puts args.count | |
end | |
hello(*(1..100_000)) | |
hello(*(1..130_000)) | |
hello(*(1..131_000)) | |
# all call raise a stack level too deep | |
hello(*(1..131_100)) |
This file contains hidden or 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
var robotSpotted = false; | |
var lastKnownX = -1; | |
var lastKnownY = -1; | |
var Robot = function(robot) { | |
//robot.clone(); | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; |
This file contains hidden or 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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) {}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.rotateCannon(360); | |
robot.ahead(50); | |
robot.turn(30); |
This file contains hidden or 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
//FightCode can only understand your robot | |
//if its class is called Robot | |
var Robot = function(robot) { | |
}; | |
Robot.prototype.onIdle = function(ev) { | |
var robot = ev.robot; | |
robot.ahead(50); |
This file contains hidden or 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
$ ruby ice_nine_delegator.rb [11:18:34] | |
/Users/cyrilmougel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ice_nine-0.5.0/lib/ice_nine.rb:42:in `block in deep_freeze': undefined method `deep_freeze' for #<Array:0x007f9dd907a660> (NoMethodError) | |
from /Users/cyrilmougel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ice_nine-0.5.0/lib/ice_nine/support/recursion_guard.rb:25:in `guard' | |
from /Users/cyrilmougel/.rbenv/versions/1.9.3-p327-perf/lib/ruby/gems/1.9.1/gems/ice_nine-0.5.0/lib/ice_nine.rb:41:in `deep_freeze' | |
from ice_nine_delegator.rb:10:in `<main>' |
This file contains hidden or 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
$ rspec -b -I. search_spec.rb [16:15:14] | |
An error occurred in an around(:each) hook | |
RuntimeError: can't modify frozen Class | |
occurred at /Users/cyrilmougel/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-mocks-2.12.0/lib/rspec/mocks/method_double.rb:152:in `remove_method' | |
F | |
Failures: |
This file contains hidden or 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
## Model | |
class User | |
include DataMapper::Resource | |
property :id, Serial | |
property :first_name, String | |
property :last_name, String | |
end |
This file contains hidden or 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
Hi, | |
I am Cyril Mougel and I am the CTO of bemyboat.com and supermarmite.com. | |
I love programming and resolving issue. When you code you see what you | |
built and you can be proud of you work. When you have some issue, you | |
are very happy to solve it. When you do your code clean, your are like a | |
writer doing a good book. | |
To me the opensource is a great |
This file contains hidden or 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/env ruby | |
system 'bundle install' | |
system "rake db:drop" | |
system 'cp config/example.application.yml config/application.yml' | |
system 'cp config/example.database.yml config/database.yml' | |
system 'rake db:create:all' | |
system 'cd db/functions/ && make libpgosm.so' | |
system "psql -c 'CREATE FUNCTION maptile_for_point(int8, int8, int4) RETURNS int4 AS \'#{File.join(File.dirname(__FILE__), '../db/functions/libpgosm.so')}\', \'maptile_for_point\' LANGUAGE C STRICT;' openstreetmap" | |
system 'psql -d openstreetmap -c "CREATE EXTENSION btree_gist;"' | |
system 'psql -d osm -c "CREATE EXTENSION btree_gist;"' |
This file contains hidden or 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
location = /robots.txt { | |
if ($host ~ 'fr.bemyboat.com') { | |
rewrite ^.* http://fr.bemyboat.com/robots.txt break; | |
} | |
if ($host ~ 'en.bemyboat.com') { | |
rewrite ^.* http://en.bemyboat.com/robots.txt break; | |
} | |
} |