Skip to content

Instantly share code, notes, and snippets.

View heynemann's full-sized avatar

Bernardo Heynemann heynemann

View GitHub Profile
Verifying that "heynemann.id" is my Blockstack ID. https://onename.com/heynemann
@heynemann
heynemann / png_artifacts.py
Created September 30, 2015 00:51
PIL Generates Artifacts in PNG Images
#!/usr/bin/python
# -*- coding: utf-8 -*-
from PIL import Image
def main():
im = Image.open("image.png")
im.thumbnail((259, 96))
im.save("image_thumbnail.png")
@heynemann
heynemann / send_mail.py
Created July 28, 2015 18:01
send mail.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import argparse
import logging
import json
import requests
from flask import (
@heynemann
heynemann / server.py
Created July 17, 2014 00:04
neo4j neomodel example of bug
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
from uuid import uuid4
from random import choice
from ujson import dumps
import tornado.web
import tornado.ioloop
@heynemann
heynemann / robot.js
Created November 29, 2012 15:58
teste123
//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;
robot.ahead(100);
@heynemann
heynemann / robot.js
Created November 28, 2012 17:25
test2
//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;
robot.ahead(100);
@heynemann
heynemann / robot.js
Created November 28, 2012 17:24
My Funky robot
//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;
robot.ahead(100);
@heynemann
heynemann / robot.js
Created November 28, 2012 16:35
Merry Go round
var foundRobotPosition = {x:0, y:0},
foundByParent=false,
foundByClone=false;
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.clone();
this.options = {
direction: 1,
@heynemann
heynemann / robot.js
Created November 28, 2012 15:47
Jackass
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot){
robot.turn(90 - (robot.angle % 90));
robot.rotateCannon(90);
this.offset = 1;
this.rotation = 30;
};
@heynemann
heynemann / robot.js
Created November 27, 2012 21:23
test2
//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;
robot.ahead(100);
robot.rotateCannon(360);