Skip to content

Instantly share code, notes, and snippets.

View meal's full-sized avatar

Mateusz Kozak meal

View GitHub Profile
@meal
meal / robot.js
Created December 4, 2012 14:14 — forked from pveras/robot.js
ASIMO
//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;
@meal
meal / robot.js
Created December 4, 2012 14:49
notb
//FightCode can only understand your robot
//if its class is called Robot
var friends = {}, id;
var Robot = function(robot) {
id = robot.id;
// friends is the set all friendly robots
friends[id] = id;
clone = robot.clone();
@meal
meal / gist:f4740808372271f8ca712ee9e798f421
Created August 24, 2016 20:36 — forked from kalmbach/gist:4471560
Rake task sugar for Sequel Migrations (version, migrate, rollback, reset)
namespace :db do
require "sequel"
Sequel.extension :migration
DB = Sequel.connect(ENV['DATABASE_URL'])
desc "Prints current schema version"
task :version do
version = if DB.tables.include?(:schema_info)
DB[:schema_info].first[:version]
end || 0