Skip to content

Instantly share code, notes, and snippets.

View tynes's full-sized avatar
👽
take me to your leader

Mark Tyneway tynes

👽
take me to your leader
View GitHub Profile
Verifying that "_tynes.id" is my Blockstack ID. https://onename.com/_tynes
@tynes
tynes / init.lua
Created December 29, 2016 22:29
Hammerspoon config file v0.1
--------------------------------------------------------------------------------
-- CONSTANTS
--------------------------------------------------------------------------------
local cmd_alt_shift = {"cmd", "alt", "shift"}
local cmd_alt_ctrl = {"cmd", "alt", "ctrl"}
local cmd_alt_ctrl_shift = {"cmd", "alt", "ctrl", "shift"}
--------------------------------------------------------------------------------
-- CONFIGURATIONS
--------------------------------------------------------------------------------
@tynes
tynes / bash-entropy-music
Created December 8, 2016 19:08
generate music from entropy on the command line
#!/bin/bash
cat /dev/urandom | hexdump -v -e '/1 "%u\n"' | awk '{ split("0,2,4,5,7,9,11,12",a,","); for (i = 0; i < 1; i+= 0.0001) printf("%08X\n", 100*sin(1382*exp((a[$1 % 8]/12)*log(2))*i)) }' | xxd -r -p | aplay -c 2 -f S32_LE -r 16000
@tynes
tynes / commonAncestor.js
Created October 26, 2016 01:56
binary tree traversal to find common ancestor
const BinaryTree = class {
constructor(value) {
this.value = value;
this.left = null;
this.right = null;
}
addLeftChild(value) {
if (this.left) {
console.log('Left child being overwritten');
}