Skip to content

Instantly share code, notes, and snippets.

Drew Petersen kirbysayshi

Block or report user

Report or block kirbysayshi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kirbysayshi
kirbysayshi / convert.sh
Last active May 17, 2019
Convert JavaScript React components to TypeScript
View convert.sh
#!/bin/bash
# usage: ./convert.sh src/components
PATH_TO_JS=$1
git clone git@github.com:lyft/react-javascript-to-typescript-transform.git
pushd react-javascript-to-typescript-transform
yarn install
popd
@kirbysayshi
kirbysayshi / usb-install-howto.md
Created Aug 23, 2018
How to install Snow Leopard on a Dell Latitude D630. lol "easiest install ever"! From 2009-05-20, for posterity.
View usb-install-howto.md

Welcome to the easiest install on a D630 EVER.

This method is contingent on two things: you must have access to a Leopard installation, and you must have an 8gb or larger USB key.

EQUIPMENT Chameleon RC1 Binaries: http://chameleon.osx86.hu/file_download/23/Chameleon-2.0RC1-r431-bin.tar.gz Chameleon RC1 Package: http://chameleon.osx86.hu/file_download/22/Chameleon-2.0-r431.pkg.zip Retail DVD/Image 8GB USB Key (or larger) Necessary Kexts: AppleACPIPS2Nub.kext, ApplePS2Controller.kext, Disabler.kext, dsmos.kext

@kirbysayshi
kirbysayshi / perlin-noise.js
Last active Mar 5, 2018
Code adapted and cleaned up from the C# implementation here http://flafla2.github.io/2014/08/09/perlinnoise.html. Specific changes: conversion to JS, removal of classes and stateful classes.
View perlin-noise.js
// Hash lookup table as defined by Ken Perlin. This is a randomly
// arranged array of all numbers from 0-255 inclusive.
const permutation = [ 151,160,137,91,90,15,
131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,
190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,
88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,
77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,
102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,
135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,
5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,
@kirbysayshi
kirbysayshi / .gitignore
Last active Jan 9, 2018
testcast demonstrating rollup getting confused by the presence of "default" as a normal property.
View .gitignore
node_modules
dist
package-lock.json
@kirbysayshi
kirbysayshi / lbp-serialization.js
Created Jan 2, 2018
Not the best JS (whoa global scope!) but I think this proves out the core ideas. Probably some bugs still.
View lbp-serialization.js
// JS Implementation of https://yave.handmade.network/blogs/p/2723-how_media_molecule_does_serialization
// We have to make several changes due to JS's dynamic nature, and lack of type
// information, outlined below.
// The rules:
// 1) Every class/valuetype needs a `serialize_TYPENAME(version, serializer, datum)`
// function. This gets around JS not having function overloading as well as the
// implicit type annotation that function overloading (in the original C example)
@kirbysayshi
kirbysayshi / index.js
Created Sep 23, 2016
requirebin sketch
View index.js
function swiper (root,
onUp, onRight, onDown, onLeft,
onTap, onHoldStart, onHoldEnd,
tapEpsilon
) {
tapEpsilon = tapEpsilon || 5;
let holdRef = null;
let hasFiredHold = false;
@kirbysayshi
kirbysayshi / index.js
Last active Nov 8, 2017
requirebin sketch
View index.js
function swiper (root, onUp, onRight, onDown, onLeft) {
const touches = [];
root.addEventListener('touchstart', stash, false);
root.addEventListener('touchmove', stash, false);
root.addEventListener('touchcancel', function () { touches.length = 0; }, false);
root.addEventListener('touchend', compute, false);
// same order at dots below
const cbs = [onUp, onRight, onDown, onLeft];
@kirbysayshi
kirbysayshi / index.js
Created Sep 8, 2016
requirebin sketch
View index.js
var assert = require('assert');
function update(root, path, value) {
//let id = 0;
// shallow clone the root because changing a child necessarily
// forces a new root copy?
let parent = Array.isArray(root)
? Array.from(root)
: Object.assign({}, root);
@kirbysayshi
kirbysayshi / index.js
Created Aug 10, 2016
requirebin sketch
View index.js
const { createStore, } = require('redux');
const INITIAL_STATE = {
player: {
pos: { x: 0, y: 0 }
}
}
function reduce(state = INITIAL_STATE, action) {
switch (action.type) {
View access_error.log
rhizome 0.7.0
(!) no osc server
(*) HTTP server running at http://<serverIP>:80/
serving content from /Users/drewp/Dropbox/js/synae-server/public
(*) websockets server running on port 80
::ffff:192.168.4.17 - - [24/Sep/2015:13:04:49 +0000] "GET /rhizome-identify?id=voqjxtytvP6av0W1 HTTP/1.1" 404 49 "http://192.168.4.17/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:42.0) Gecko/20100101 Firefox/42.0"
::ffff:192.168.4.17 - - [24/Sep/2015:13:04:56 +0000] "GET /rhizome-identify?id=voqjxtytvP6av0W1 HTTP/1.1" 404 49 "http://192.168.4.17/?conductor" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:42.0) Gecko/20100101 Firefox/42.0"
rhizome 0.7.0
(!) no osc server
(*) HTTP server running at http://<serverIP>:80/
You can’t perform that action at this time.