Skip to content

Instantly share code, notes, and snippets.

View emkay's full-sized avatar

Michael Matuzak emkay

View GitHub Profile
@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."
@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 / nesly-split-example.js
Created November 3, 2013 04:14
nesly split example
var neslySplit = require('nesly-split');
var fs = require('fs');
var s = fs.createWriteStream('mario.chr');
neslySplit('smb.nes', function (err, data) {
if (!err) {
s.write(data.chr);
}
});
@emkay
emkay / seaport-proxy-hutch.md
Created January 17, 2013 00:41
DevOps Day Lightening talk proposal

Setting up an HTTP proxy with node and hutch

hutch is a small program that takes a config.json file and spins up a proxy server that takes care of all your sites. It uses seaport to manage your ports automatically, and http-proxy to proxy all your requests to various servers. Because seaport uses semvers, you can place different versions and roles of the same server in your config.json without having to worry about port numbers.

The real magic is seaport and http-proxy. hutch just allows you to use them together.

> 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
[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]][([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]](([][[]]+[])[!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+([![]]+[][[]])[+!+[]+[+[]]]+(![]+[])[!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]])[+!+[]+[+[]]]+([][(![]+[])[+[]]+([![]]+[][[