Skip to content

Instantly share code, notes, and snippets.

View fmobus's full-sized avatar

Felipe Mobus fmobus

  • Porto Alegre, RS
View GitHub Profile
@fmobus
fmobus / robot.js
Created December 6, 2012 01:18 — forked from cgardner/robot.js
derp
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 {
@fmobus
fmobus / robot.js
Created December 5, 2012 16:38 — 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();
};
>>> class foo(object):
... def bla(self):
... print 1
...
>>> a = foo()
>>> a.bla
<bound method foo.bla of <__main__.foo object at 0xb750dfac>>
>>> del foo.bla
>>> a.bla
Traceback (most recent call last):
@fmobus
fmobus / gist:1141019
Created August 11, 2011 22:58
class para comunicação com impressoras térmicas protocolo PPLA
DEVICE = "/dev/lp0";
STX = chr(2);
CR = chr(13);
LF = chr(10);
DEFAULTS = {
'ori': 4,
'font': 2,
'mh': 2,
'mv': 2,
@fmobus
fmobus / gist:1141017
Created August 11, 2011 22:57
remoção de acentos (depende de django)
# disclaimer
# essa implementação é um tanto presa a funções da biblioteca do django
# basicamente por pura preguiça/conveniência minha
#
from django.utils.encoding import smart_str, force_unicode
import unicodedata
def remove_accents(value):