Skip to content

Instantly share code, notes, and snippets.

View kirbysayshi's full-sized avatar

Drew Petersen kirbysayshi

View GitHub Profile
kirbysayshi /
Created May 12, 2022 19:43
process profiling with graphs (bash, gnuplot)
for log in *-anary.log; do awk '$0<200' <$log | gnuplot -e "set term png; set yrange [0:200]; unset autoscale y; set output \"$(basename $log .log).trimmed.png\";plot '-' with boxes"; done
"name": "SofleKeyboard",
"author": "Josef Adamcik (+Drew Petersen)",
"switchMount": "cherry"
"x": 6.25,
kirbysayshi /
Last active October 28, 2020 21:51
use hdl_dump to inject local ISO/bin+cue files into a locally-connected Playstation 2 hard drive

Mac Instructions:

# clone the hdl-dump repo
USE_THREADED_IIN=no RELEASE=yes make # otherwise will semaphore deadlock

diskutil list # find the /dev/diskX identifier of the PS2 HDD

sudo -s # must be root to query drive and inject
IMG_ROOT=/path/to/ISOs HDD_IDENT=/dev/diskX CLI_PATH=./hdl_dump node ./mass_inject.js
kirbysayshi / bash-to-zsh-history.js
Created August 12, 2020 23:09
port bash_history to zsh, while preserving existing zsh history too!
const fs = require('fs');
* This script transfers bash history to zsh history
* Change bash and zsh history files, if you don't use defaults
* Usage: node bash_to_zsh_history.js
* Author: Matteo Gaggiano, Modified by Drew Petersen
kirbysayshi / Delete Local Only Git
Last active March 18, 2020 20:12
all the other ones on the internet either don't work, or only delete local tracking branches. If you have squash+merge enabled for a repo, those techniques won't work!


kirbysayshi /
Last active May 17, 2019 16:35
Convert JavaScript React components to TypeScript
# usage: ./ src/components
git clone
pushd react-javascript-to-typescript-transform
yarn install
kirbysayshi /
Created August 23, 2018 02:54
How to install Snow Leopard on a Dell Latitude D630. lol "easiest install ever"! From 2009-05-20, for posterity.

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: Chameleon RC1 Package: Retail DVD/Image 8GB USB Key (or larger) Necessary Kexts: AppleACPIPS2Nub.kext, ApplePS2Controller.kext, Disabler.kext, dsmos.kext

kirbysayshi / perlin-noise.js
Last active March 5, 2018 03:31
Code adapted and cleaned up from the C# implementation here Specific changes: conversion to JS, removal of classes and stateful classes.
// 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,
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,
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,
kirbysayshi / .gitignore
Last active January 9, 2018 22:55
testcast demonstrating rollup getting confused by the presence of "default" as a normal property.
kirbysayshi / lbp-serialization.js
Created January 2, 2018 23:54
Not the best JS (whoa global scope!) but I think this proves out the core ideas. Probably some bugs still.
// JS Implementation of
// 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)