Skip to content

Instantly share code, notes, and snippets.

View ografael's full-sized avatar

ografael

View GitHub Profile
@ografael
ografael / combo_dinamico.html
Created March 14, 2012 15:12
Carregar combo com JQuery - Cidades e Estados
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.getJSON('estados_cidades.json', function (data) {
@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
@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 / 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 / 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 / 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 / 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: "&laquo; Anterior"
next: "Próximo &raquo;"
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