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
@tynes
tynes / write.js
Last active March 22, 2019 01:38
#!/usr/bin/env node
/*
* write.js
*
* usage: writes a string to a file
*
* $ ./write.js <path to file> <contents of file>
*/
# set an env var to the path to a config
export REGTEST_CONFIG=$HOME/.config/hsd/regtest.conf
# this assumes you have git cloned and npm installed handshake
# be sure to start your handshake node with the same config
# ./bin/hsd --config=$REGTEST_CONFIG
# the cli tools live in node_modules/.bin
# also depends on jq
@tynes
tynes / dexec.sh
Created May 17, 2018 22:15
docker exec bash alias
# usage:
# dexec <cmd>
# uses fzf to select running container then runs
# $ docker run [selected] <cmd>
# with /bin/bash as the default cmd
# TODO: add some pretty printing
function dexec() {
local selected_image
@tynes
tynes / keybase.md
Created February 11, 2018 20:17
Keybase Proof

Keybase proof

I hereby claim:

  • I am tynes on github.
  • I am tynes (https://keybase.io/tynes) on keybase.
  • I have a public key ASAVvc3HHzL9Bo-ONgHr5kPLb36EBcQWsmsgLL1y0jMPaAo

To claim this, I am signing this object:

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');
}