Skip to content

Instantly share code, notes, and snippets.

View ografael's full-sized avatar

ografael

View GitHub Profile
@ografael
ografael / robot.js
Created December 6, 2012 00:00
Zolmeister
var Robot = function(robot){
robot.turnLeft(robot.angle % 90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
if (robot.parentId) {
robot.ahead(1);
robot.turnGunRight(1);
}
else {
@ografael
ografael / robot.js
Created December 5, 2012 23:59 — forked from Shipow/robot.js
Shipow#001
var Robot = function(robot) {
robot.rotateCannon(-90);
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead();
//i'll add a clone but i need to refactor collision
//robot.clone();
};
@ografael
ografael / fix_combo_ie.js
Created July 4, 2012 00:18
fix_combo_ie.js
$(function() {
var el;
$("select")
.each(function() {
el = $(this);
el.data("origWidth", el.outerWidth()) // IE 8 will take padding on selects
})
.mouseenter(function(){
{ markers: [{ latitude: 47.660937, longitude: 9.569803 }, { latitude: 10.660937, longitude: 10.569803 }] }
@ografael
ografael / gist:2853942
Created June 1, 2012 17:45 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@ografael
ografael / command to restart mongo
Created March 25, 2012 18:21
command to restart mongo
sudo rm /var/lib/mongodb/mongod.lock && sudo -u mongodb mongod -f /etc/mongodb.conf --repair && sudo start mongodb && sudo status mongodb
@ografael
ografael / rails_admin.pt-BR.yml
Created March 23, 2012 14:21 — forked from krsmurata/rails_admin.pt-BR.yml
Portuguese (pt-BR) translation for RailsAdmin 3.2
pt-BR:
home:
name: Home
views:
pagination:
previous: "« Anterior"
next: "Próximo »"
truncate: "…"
admin:
misc:
@ografael
ografael / rails31init.md
Created March 22, 2012 22:46 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@ografael
ografael / Gemfile
Created March 22, 2012 02:15 — forked from mergulhao/Gemfile
source 'http://rubygems.org'
gem 'rails', '3.1.3'
gem 'jquery-rails', '1.0.16'
gem 'pg', '0.11.0'
gem 'silent-postgres', '0.0.8'
gem 'thin', '1.2.11'
gem 'haml', '3.1.3'
gem 'delayed_job', '2.1.4'
gem 'state_machine', '1.1.0'
@ografael
ografael / deploy.rake
Created March 21, 2012 23:13 — forked from rafaelp/deploy.rake
Rake task to deploy Rails project to Heroku
# -*- encoding : utf-8 -*-
namespace :heroku do
namespace :deploy do
PRODUCTION_APP = 'nomedoprojeto-production'
STAGING_APP = 'nomedoprojeto-staging'
def run(*cmd)
system(*cmd)
raise "Command #{cmd.inspect} failed!" unless $?.success?
end