Skip to content

Instantly share code, notes, and snippets.

@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 / 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
{ markers: [{ latitude: 47.660937, longitude: 9.569803 }, { latitude: 10.660937, longitude: 10.569803 }] }
@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(){
@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 {