Skip to content

Instantly share code, notes, and snippets.


Érico Vieira Porto ericoporto

View GitHub Profile
View rain.html
<!DOCTYPE html>
<meta charset=utf-8 />
<title>HTML5 Rain</title>
<script type="text/javascript">
// this is an example for a rain function, to draw rain
// in a jRPG Top-Down type of game.
var canvas = null;
ericoporto /
Created Jul 28, 2015
Yahoo Weather API Condition Codes in Brazilian Portuguese (Códigos do Yahoo Weather em Português - Brasil)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Erico Vieira Porto
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
ericoporto / twocam_distance.pde
Created Aug 2, 2015
This script uses 2 webcams, calculate difference per frame in each, get the position of the biggest difference and then calculate distance from the camera. Made with Processing IDE.
View twocam_distance.pde
// First example on image processing
// Finds the square with bigger difference from the latter
// Do it for both cams
// Guess that it's in the same object
// Tell the distance from the object
// Prototype to be further rewritten in OpenCV
// This code uses snippets form this great german website:
// Aktivität in Bildbereichen feststellen in Processing
ericoporto /
Last active Nov 1, 2019 — forked from bradmontgomery/
A minimal http server and client pair. It's intended to show how to communicate between a server and a client in Python.
#!/usr/bin/env python
Very simple HTTP server and client pair in python.
Server based on:
./ start [<port>]
Send a message (on a second terminal) ::
./ notify "hello world!"
ericoporto /
Last active Aug 29, 2015
This is a unfinished text game I helped a random dude make in stackoverflow. It has nice ideas for text game implementation.
# one nice dude in the internet asked me for help to make this code work
# I leave this code here as a reminder of that nice dude. The content here
# belongs to nice dude, and not me.
import sys, traceback
import json
userQuited = False
def _quit(dummy):
ericoporto / openweather.ino
Last active Jul 9, 2018
An Arduino + Ethernet shield example on how to get data from Open WeatherMap
View openweather.ino
Web Client to consume Open WeatherMap web service
This sketch connects to a website (
using an Arduino Ethernet shield and get data from site.
* Arduino MEGA 2560 R3 Board
* Ethernet shield attached to pins 10, 11, 12, 13
ericoporto / pseudogame.pde
Last active Aug 29, 2015
This is my first pseudo game for Processing.
View pseudogame.pde
// A simple 'game' for Processing (tested with Processing 2.2.1)
// use ARROW KEYS to move
// this will be the pointers I'm going to use to sweep my map,
// and it's limit.
int xi, yi;
int i = 0;
int sceneHeight = 10;
int sceneWidth = 20;
// This is the "hero" coordinate
ericoporto / buttonmakerifttt.ino
Last active Aug 28, 2015 — forked from outofmbufs/iftttmaker.ino
A button to the Internet! Code to a button in an Arduino trigger an IFTTT/Maker event. Moved to here:
View buttonmakerifttt.ino
// This code makes a button connect on pin 2 of the Ethernet Shield
// connected to an Arduino trigger a event named button_pressed on
// the IFTTT Maker Channel. Based on the Neil Webber analog read code.
// The MIT License
// Copyright (c) 2015 Erico Porto
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
ericoporto / randmytext.js
Last active Sep 17, 2015
simple way to generate a random phrase from easy to type sentence
View randmytext.js
// An easy way to generate random text from easy to type text
// Use "word word [possibility1|possibilities stuff|another stuff thing] stuff"
//to make a string with possibilities.
// Example:
//> var t = "A [greekish|futuristic|antique] world with a [dinossaur|ninja] flying"
//> console.log(randtext(t))
//A antique world with a dinossaur flying
ericoporto /
Last active Oct 31, 2015
Script to configure Transmission on Raspberry Pi to only run when I'm not home - afternoon - or when I'm sleeping.
# Run this script WITHOUT Sudo.
# This script assumes you have installed transmission-daemon
# on your Raspberry Pi (or whatever where you are running it...)
# Running it will use cron to pause and unpause all your torrents
# at specific times.
# Right now you, no torrents will be downloaded from 5 am to 9 am and
# also no torrents will be downloaded from 5 pm to 11 pm.
You can’t perform that action at this time.