Skip to content

Instantly share code, notes, and snippets.

View jeronimo's full-sized avatar

Julius Pabrinkis jeronimo

View GitHub Profile
@jeronimo
jeronimo / deploy.rb
Created November 22, 2010 21:27
Capistrano recipe to sync rails MongoDB and files
set :sync_directories, ["public/system/images"]
set :sync_backups, 3
set :db_file, "mongoid.yml"
set :db_drop, '--drop' # drop database (rewrites everything)
@jeronimo
jeronimo / monkey.rb
Created October 5, 2011 16:03
Battleships - engine (and example how NOT to write code)
class Monkey
def initialize
@moves = []
@queue = []
@target = []
@last_hit_move = []
@l_last_hit_move = []
@direction = 'h' #horizontal
@ships_remaining = [5,4,3,3,2]