Skip to content

Instantly share code, notes, and snippets.

@murilopolese
murilopolese / fabulous-machine.ino
Last active June 22, 2017 23:18
Fabulous machine arduino firmware
#include <Servo.h>
Servo servo;
typedef struct motor
{
int pin1;
int pin2;
int pin3;
int pin4;
};
@murilopolese
murilopolese / sprite.pde
Last active May 17, 2017 21:35
Sprite Generator
import java.util.Arrays;
ArrayList<PImage> images = new ArrayList();
int columns = 12;
int rows = 12;
void setup(){
selectFolder("Select a folder to process:", "folderSelected");
}
var pointsArray = [];
var points = [];
var maxPoints = 500;
function setup() {
createCanvas(windowWidth, windowHeight)
background(0)
stroke(255)
for(var i = 0; i < maxPoints; i++){
pointsArray.push([windowWidth/2, windowHeight/2])
// Imprecise method, which does not guarantee v = v1 when t = 1, due to floating-point arithmetic error.
// This form may be used when the hardware has a native fused multiply-add instruction.
float lerp(float v0, float v1, float t) {
return v0 + t * (v1 - v0);
}
// Precise method, which guarantees v = v1 when t = 1.
float lerp(float v0, float v1, float t) {
return (1 - t) * v0 + t * v1;
}
@murilopolese
murilopolese / cleide.ino
Last active February 20, 2017 11:41
Cleide
// include the Quirkbot library to your program:
#include "Quirkbot.h"
// create your Quirkbot nodes here:
CircuitTouch leftSensor;
CircuitTouch rightSensor;
ServoMotor servoMotor1;
VoltageOutput backward;
VoltageOutput forward;
@murilopolese
murilopolese / wind_video.pde
Last active February 6, 2017 14:44
SeriousBusiness RFF
import controlP5.*;
ControlP5 cp5;
// Control visuals
int controlHeight = 20;
int controlWidth = 200;
int controlPadding = 10;
int sMaxParticles = 10000;
@murilopolese
murilopolese / game.p8
Last active July 10, 2016 09:00
PICO-8 Boilerplate
pico-8 cartridge // http://www.pico-8.com
version 8
__lua__
-- game boilerplate
-- by murilo
-- Game states
game_mode = "splash"
-- Event manager
@murilopolese
murilopolese / JibberJabberGenerator.html
Last active November 9, 2016 16:57
The Fabulous Jibber Jabber Generator
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>The Fabulous Jibber Jabber Generator</title>
<script type="text/javascript">
validchars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz()_/!$";
tab0 = new Array(
"Dear friends, ",
@murilopolese
murilopolese / Instagram
Last active November 12, 2015 10:00
Processing Instagram Fetcher
import http.requests.*;
class Instagram {
private String accessToken = "508806944.c6cb753.2088e0733e0d432689efc5fcd15bb3b0";
private String tag = "nofilter";
private JSONArray posts;
private ArrayList<PImage> images;
private String imageFormat = "jpg";
private int imageListSize = 100;
@murilopolese
murilopolese / .zshrc
Created August 15, 2015 17:58
Docker zsh env magic
if docker-machine status boot2docker | grep Running > /dev/null; then
eval "$(docker-machine env boot2docker)"
fi