Skip to content

Instantly share code, notes, and snippets.

View jonatack's full-sized avatar

Jon Atack jonatack

View GitHub Profile
@millisami
millisami / gist:3148874
Created July 20, 2012 05:33 — forked from igrigorik/gist:3148848
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)
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
; https://z0ltan.wordpress.com/2017/02/24/a-piglatin-translator-in-common-lisp-and-contrasting-it-with-the-racket-version/
#|
(defpackage #:piglatin
(:use :cl :cl-user))
; using CL-USER makes no sense, it usually does not export anything.
(in-package #:piglatin)
@carwin
carwin / private.xml
Last active July 27, 2017 15:06
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

Ces informations sont issues du document "Rédaction des offres d’emploi : le cadre juridique, Guide pratique pour la rédaction des offres d’emploi", 2010, Pôle emploi

La mention discriminatoire liée au sexe

La discrimination fondée sur le sexe est prohibée de façon explicite par trois articles :

  • article 225-1 du Code pénal
  • articles L 1132-1 et L 1142-1 du Code du travail
; https://z0ltan.wordpress.com/2018/08/04/simple-expression-evaluator-comparison-between-haskell-rust-and-common-lisp/
; this version: 2018, Rainer Joswig, joswig@lisp.de
; we create a bunch of structures for the expression types
; each structure defines a constructor of the same name
; each expression knows the corresponding Lisp function
(defstruct (val (:constructor val (e))) e)
(defstruct (bop :conc-name) e1 e2 op)
@mflaxman
mflaxman / trezor_recovery.py
Created August 15, 2017 13:50
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)
@PierreRochard
PierreRochard / your_lightning_commitment_transaction_with_htlcs
Created May 9, 2019 21:34
Your version of the commitment transaction that you are holding off-chain (with HTLCs)
# Based on a diagram posted by @pm47 https://github.com/lightningnetwork/lightning-rfc/issues/553#issuecomment-455641943
+------------------------------------------------+
| 2-of-2 multi-sig funding tx confirmed on-chain |
+------------------------------------------------+
|
|
|
|
@niftynei
niftynei / dot.txt
Created September 5, 2019 17:39
notes from outputs investigation
wallet/db.c -> table schemas + migrations
wallet/wallet.c -> SQL statements
table: outputs
question: what are the values for 'status'
output_state_available= 0,
output_state_reserved = 1,
output_state_spent = 2,
/* Output has been included in a signed funding tx that we've shared
* with a peer; not yet mempooled. Eligible for burning */
@jnewbery
jnewbery / git-br.py
Created May 29, 2019 18:57
git tools
#!/usr/bin/env python3
import subprocess
import os
if os.name == 'posix':
RED = "\033[1;31m"
BLUE = "\033[0;34m"
CYAN = "\033[0;36m"
GREEN = "\033[0;32m"
RESET = "\033[0;0m"