Skip to content

Instantly share code, notes, and snippets.

@murilopolese
murilopolese / Readme.md
Last active May 5, 2023 19:02
School For Poetic Computation - Cellular Automata: Code Beyond Words

Cellular Automata is a way of thinking about computing, natural structures, and the wider world as a group of many entities each following simple rules. In this class we will use paper, board games, computers, and more to code and play with our own cellular automata systems. This class will give us an opportunity to challenge the traditional cultures and definitions of what programming is and who it is for, and offer some critical and playful ways to imagine what else it can be.

https://sfpc.study/sessions/spring-23/cellular-automata

This gist contains source code submitted by the students.

@murilopolese
murilopolese / life.js
Created June 26, 2020 08:54
Tweetable game of life
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)
@murilopolese
murilopolese / framework.js
Last active October 19, 2020 20:22
Framework
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 11:55
Simple Keyframe/Timeline implementation
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
@murilopolese
murilopolese / converter.html
Created February 25, 2020 20:44
SVG to GCODE
<!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;
}
@murilopolese
murilopolese / pixel-thing.js
Created September 19, 2018 23:32
Pixel Thing
const {
Action,
Property,
SingleThing,
Thing,
Value,
WebThingServer,
} = require('webthing');
const {
DeviceManager,
@murilopolese
murilopolese / PixelKit_hardware.py
Last active August 25, 2018 21:45
Pixel Kit Games!
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 October 9, 2017 11:28
Motion Sensor Arpeggiator

Virtual MIDI devices

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

@murilopolese
murilopolese / README.md
Last active January 20, 2018 22:54
BeeMu

BeeMu

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

@murilopolese
murilopolese / README.md
Last active September 7, 2019 11:40
Fabulous Car!

Fabulous Car

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