Skip to content

Instantly share code, notes, and snippets.

View emkay's full-sized avatar

Michael Matuzak emkay

View GitHub Profile
@emkay
emkay / index.js
Last active June 2, 2017 21:37
requirebin sketch
const regl = require('regl')()
const mat4 = require('gl-mat4')
const hsv2rgb = require('hsv2rgb')
const NUM_POINTS = 1e4
const VERT_SIZE = 4 * (4 + 4 + 3)
const pointBuffer = regl.buffer(Array(NUM_POINTS).fill().map(function () {
const color = hsv2rgb(Math.random() * 360, 0.6, 1)
return [
@emkay
emkay / index.js
Last active June 28, 2016 00:50
requirebin sketch
// Welcome! require() some modules from npm (like you were using browserify)
// and then hit Run Code to run your code on the right side.
// Modules get downloaded from browserify-cdn and bundled in your browser.
const drummer = require('drummer')()
const kick = drummer.kick
const snare = drummer.snare
const hihat = drummer.hihat
function bar (time) {
if (time >= 20) return
global start
section .text
bits 32
start:
mov word [0xb8000], 0x0248 ; H
mov word [0xb8002], 0x0265 ; e
mov word [0xb8004], 0x026c ; l
mov word [0xb8006], 0x026c ; l
mov word [0xb8008], 0x026f ; o
@emkay
emkay / build-grub-osx.sh
Last active January 25, 2024 04:25
Build Grub on OSX
#!/bin/sh
set -e
# First we are going to make sure that you understand this is sort of experimental and we will be compiling stuff.
# by default CONTINUE will be false
CONTINUE=false
echo ""
echo "You are about to download, compile, and install stuff on your computer."
> const a = require('./a')
undefined
> a
[Function]
> a()
undefined
> a = 'nope'
'nope'
> a
[Function]
> const o = { make: 'that', music: 'with', your: 'mouth', biz: true}
undefined
> o
{ make: 'that', music: 'with', your: 'mouth', biz: true }
> o.make = 'nope'
'nope'
> o
{ make: 'nope', music: 'with', your: 'mouth', biz: true }
>
$ node
> const what = 'space'
undefined
> what
'space'
> what.length
5
> what = 'jfkldsajfldsa'
'jfkldsajfldsa'
> what
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][[]]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+([![]]+[][[
var Song = require('nesly-sound')
var song = Song()
var sq1 = song.square1
var sq2 = song.square2
var tri = song.triangle
var noi = song.noise
var time = 1/4
var drumTime = 1/8
@emkay
emkay / not-bach.js
Created April 23, 2015 20:23
Not Bach
var Song = require('nesly-sound');
var song = Song();
var sq1 = song.square1;
var sq2 = song.square2;
var tri = song.triangle;
var noi = song.noise;
var Aminor4 = ['A4', 'C4', 'E4', 'A5'];
var Cmajor3 = ['C3', 'E3', 'G3', 'C4'];