Skip to content

Instantly share code, notes, and snippets.

View jonatack's full-sized avatar

Jon Atack jonatack

View GitHub Profile
@jonatack
jonatack / private.xml
Created December 26, 2015 21:24 — forked from carwin/private.xml
Programmer's Shift Keys: Remapping parens, brackets and braces for to because nerd.
<?xml version="1.0"?>
<root>
<item>
<name>Programmer's Shift Keys</name>
<!--
Author: Carwin Young (@carwin)
Last Updated: 2014.07.18
v.1.1
Programmer's Shift Keys
@jonatack
jonatack / gist:17a4523ca3c25ea75453
Created February 21, 2016 18:43 — forked from millisami/gist:3148874
Convert any YouTube video into an audio file you can listen to on the go...
# Convert any YouTube video into an audio file you can listen to on the go, using:
# http://rg3.github.com/youtube-dl/
{ ~ } > brew install ffmpeg
{ ~ } > brew install ffprobe
{ ~ } > wget https://raw.github.com/rg3/youtube-dl/2012.02.27/youtube-dl
{ ~ } > chmod u+x youtube-dl
# Pick which video format you want to download.. (use any YT video link)
@jonatack
jonatack / dual.lisp
Last active June 2, 2016 13:44 — forked from lispm/dual.lisp
Conjugate Partitions
; http://kaygun.tumblr.com/post/145269023094/conjugate-partitions
; version 1
(defun dual (xs &aux k n r)
(loop while xs do
(setf k (reduce #'min xs)
n (length xs)
xs (sort (loop for x in xs
for x1 = (- x k)
require 'json'
require 'uri'
require 'net/http'
require 'net/https'
##
# Poloniex Ruby API interface
#
# Documentation text is pretty much 1:1 from the official API documentation
# https://www.poloniex.com/support/api
@jonatack
jonatack / trezor_recovery.py
Created August 16, 2017 17:41 — forked from mflaxman/trezor_recovery.py
Proof you can recover your Trezor funds without a Trezor (if it breaks and/or the company goes out of business)
from bitmerchant.wallet import Wallet
from mnemonic import Mnemonic
# put in whatever Trezor generates for you here (or backup from this empty/insecure one as a test)
mnemonic = 'clean health food open blood network differ female lion eagle rough upon update zone antique defense venture uncover mobile charge actress film vocal enough'
passphrase = '' # empty string or whatever you actually choose
path = "m/44'/0'/0'/0/0" # whatever shows up on the UI for that account (everything will start with m/44'/0' since it's bip44)
child = Wallet.from_master_secret(Mnemonic('english').to_seed(mnemonic, passphrase)).get_child_for_path(path)
child.to_address() # '18K9axbPpwqZgngB58nuwsYevL2z6ey4YG' (confirm this matches what Trezor is showing you)
@jonatack
jonatack / bitcoin_debugging.md
Created September 15, 2019 09:50 — forked from fjahr/bitcoin_debugging.md
Debugging Bitcoin Core

This document is currently optimized for MacOS. If you would like to help me add Linux equivalent commands, please let me know.

Debugging Bitcoin Core

This guide is designed to give beginners of C++ development and/or people new to the bitcoin core code base an overview of the tools available for debugging issues as well as giving hints where issues may trip you up.

Table of contents

--- a/src/script/interpreter.cpp
+++ b/src/script/interpreter.cpp
@@ -504,6 +504,14 @@ bool EvalScript(std::vector<std::vector<unsigned char> >& stack, const CScript&
return set_error(serror, SCRIPT_ERR_MINIMALDATA);
}
stack.push_back(vchPushValue);
+ if ((flags & SCRIPT_VERIFY_DISCOURAGE_UPGRADABLE_NOPS) && opcode == OP_FALSE) {
+ auto pc_tmp = pc;
+ opcodetype next_opcode;
+ valtype dummy_data;