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 / 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');
}
@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 / 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
--------------------------------------------------------------------------------
Verifying that "_tynes.id" is my Blockstack ID. https://onename.com/_tynes
@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:

@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>
*/
#!/bin/bash
# pull gmax's lattest banlist, replace ./bitcoin-cli
# with bcoin-cli and write it to disk as a bash script
# WARNING: please inspect the file before executing it
# works correctly as of 4/10/19
curl -s https://people.xiph.org/~greg/banlist.cli.txt \
| sed 's/\.\/bitcoin-cli/bcoin-cli\ rpc/g' \
| sed '1s/^/#!\/bin\/bash\n\n/' > banlist.sh

hsd Watch Only Wallet Simplification

Overview

The hsd wallet has an edge case regarding watch only wallet usage that results in the incorrect path being returned to the client. This will result in invalid signature creation because the wrong key will be derived and used to sign the transaction. Using an extra API call, it is possible to work around this problem right now, but it is not ideal and is fixable.

@tynes
tynes / hsd-ens.md
Created February 25, 2020 19:26
hsd ENS Support

Handshake can be used to resolve names with a sliding scale of trust assumptions. In general, the more trust that the user places in the system, the better user experience. The easiest way to resolve Handshake names involves configuring DNS settings and not worrying at all about blockchain state. This means that the user is trusting the DNS service provider to properly validate all state transitions and relying on traditional means of DNS security. Running a light client as a DNS server removes the trust assumption that the name state is coming from the heaviest chain. The light client will sync the headers (technically a subset of the header, designed specifically to be lightweight), verify the proof of work is correct and ask for urkel proofs over the p2p network to validate against the tree root contained in the block header. The p2p connections are optionally encrypted with brontide (BOLT #8)

@tynes
tynes / dev-call-4-2-2020.md
Created April 2, 2020 17:59
Handshake Developer's Call - 4/2/2020