Skip to content

Instantly share code, notes, and snippets.

Murilo Polese murilopolese

View GitHub Profile
@murilopolese
murilopolese / life.js
Created Jun 26, 2020
Tweetable game of life
View life.js
m=[];l=999;for(i=0;i<99;i+=1){m[i]=1}setInterval(()=>{n=[];i=l;while(i--){s=!!m[i-1]+!!m[i+1]+!!m[i+49]+!!m[i+50]+!!m[i+51]+!!m[i-49]+!!m[i-50]+!!m[i-51];n[i]=(s==3)||!!(m[i]&&s==2)}t='';i=l;while(i--){t+=7-n[i]*7+(i%50?'':'\n')}d=document;if(d){d.body.innerText=t}m=n},99)
View framework.js
function isPlainObject(value) {
if (Object.prototype.toString.call(value) !== '[object Object]') {
return false;
}
const prototype = Object.getPrototypeOf(value);
return prototype === null || prototype === Object.prototype;
}
function h (tag, attrs, ...children) {
const el = document.createElement(tag)
if (isPlainObject(attrs)) {
@murilopolese
murilopolese / timeline.js
Created May 31, 2020
Simple Keyframe/Timeline implementation
View timeline.js
function KeyFrame({value, handles=[]}) {
this.value = value
this.handles = []
this.handles[0] = handles[0] || createVector(0, 0) // future
this.handles[1] = handles[1] || createVector(0, 0) // past
}
function Timeline(size) {
this.frames = []
this.size = size
View converter.html
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>SVG to GCODE converter, the dream</title>
<style media="screen">
body {
background: lightgrey;
margin: 0 auto;
}
View pixel-thing.js
const {
Action,
Property,
SingleThing,
Thing,
Value,
WebThingServer,
} = require('webthing');
const {
DeviceManager,
View PixelKit_hardware.py
from machine import Pin, ADC
from neopixel import NeoPixel
# Hardware information:
# Pin numbers for each hardware connected to the PixelKit ESP32
NEOPIXEL_PIN = 4
SIZE = 128 # Amount of leds
WIDTH = 16 # Number of columns
HEIGHT = 8 # Number of lines
DIAL_PIN = 36
@murilopolese
murilopolese / README.md
Last active Oct 9, 2017
Motion Sensor Arpeggiator
View README.md

Virtual MIDI devices

This is a bunch of scripts that spawn virtual midi devices to interact with your favourite DAW.

View README.md

BeeMu

Little BMO wannabe robot featuring 4 buttons and a unicorn hat from Pimodoro (RGB fancy neopixel stuff) on an esp8266 running micropython.

View README.md

Fabulous Car

This is an attempt to make it easy to control motors with a remote control over wifi using the ESP8266 board.

@murilopolese
murilopolese / fabulous-machine.ino
Last active Jun 22, 2017
Fabulous machine arduino firmware
View fabulous-machine.ino
#include <Servo.h>
Servo servo;
typedef struct motor
{
int pin1;
int pin2;
int pin3;
int pin4;
};
You can’t perform that action at this time.