Skip to content

Instantly share code, notes, and snippets.

View martindale's full-sized avatar
🚀
relentless maker.

Eric Martindale martindale

🚀
relentless maker.
View GitHub Profile
@paladini
paladini / The HEX and RGB code for the Bitcoin orange color
Last active January 25, 2021 23:22
The HEX / RGB code for the orange color from Bitcoin logo
Do you want know what's the orange color from Bitcoin logo? Here's the colours:
Hexadecimal:
#FF9900
RGB
(255,153,0)
Any suggestions are welcome!
Fonts: http://www.color-hex.com/color/ff9900 and https://bitcointalk.org/index.php?topic=224522.0
@gavinandresen
gavinandresen / BlockPropagation.md
Last active March 14, 2023 09:45
O(1) block propagation

O(1) Block Propagation

The problem

Bitcoin miners want their newly-found blocks to propagate across the network as quickly as possible, because every millisecond of delay increases the chances that another block, found at about the same time, wins the "block race."

@ldong
ldong / rst_to_md.sh
Last active December 8, 2020 17:40
Convert rst to md files
# This script was created to convert a directory full
# of rst files into md equivalents. It uses
# pandoc to do the conversion.
#
# 1. Install pandoc from http://johnmacfarlane.net/pandoc/
# 2. Copy this script into the directory containing the .rst files
# 3. Ensure that the script has execute permissions
# 4. Run the script
#
# By default this will keep the original .rst file
@ryanxcharles
ryanxcharles / gist:c29fc94d31de7c8c89dc
Last active February 26, 2019 17:21
Security Protocols for Wallet Creation and Communication in Copay

There are two communication phases for a Copay wallet: The wallet creation phase, which is when the copayers do not yet know the public keys of the other copayers. Then the wallet usage phase, where the copayers do know the public keys of the other copayers.

Each copayer independently generates a master extended public/private key pair before wallet creation which can be used to derive further public/private keys deterministically.

Wallet Creation

The author of the wallet derives a new public/private key pair for the communication purposes. This is the communication public/private key pair of the author.

The hash of the communication public key is used as the PeerJS id.

@kyledrake
kyledrake / ferengi-plan.txt
Last active April 6, 2024 00:30
How to throttle the FCC to dial up modem speeds on your website using Nginx
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {

Extensible Scalable Coopetitive High Availability Trade Optimization Network: ESCHATON

I am the Eschaton; I am not your God.

I am descended from you, and exist in your future.

Thou shalt not violate causality within my historic light cone. Or else.

Singularity Sky by Charles Stross

@bardiharborow
bardiharborow / multicast.py
Last active November 8, 2017 09:48
A test of Bitcoin Local Peer Discovery using IP Multicast.
"""
PyBitcoinMultiCast - A Bitcoin Local Node Discovery Test.
Loosely based on Aaron Cohen's code <https://gist.github.com/aaroncohen/4630685>
BTC: 1Bardi4eoUvJomBEtVoxPcP8VK26E3Ayxn
LTC: LcSVL3Mj5VLSDzkwyBjufKemEVMbaC7vfp
DOGE: DKvVt6sapm6NwuWGMrcV3wVhxnrn853NFS
Licenced under The MIT License <http://opensource.org/licenses/MIT>.
@martindale
martindale / bitcoin-micropayment-protocol.md
Created February 27, 2014 18:34
General flow for micropayment channels in Bitcoin.
  1. Create a public key (K1). Request a public key from the server (K2).
  2. Create and sign but do not broadcast a transaction (T1) that sets up a payment of (for example) 10 BTC to an output requiring both the server's public key and one of your own to be used. A good way to do this is use OP_CHECKMULTISIG. The value to be used is chosen as an efficiency tradeoff.
  3. Create a refund transaction (T2) that is connected to the output of T1 which sends all the money back to yourself. It has a time lock set for some time in the future, for instance a few hours. Don't sign it, and provide the unsigned transaction to the server. By convention, the output script is "2 K1 K2 2 CHECKMULTISIG"
  4. The server signs T2 using its public key K2 and returns the signature to the client. Note that it has not seen T1 at this point, just the hash (which is in the unsigned T2).
  5. The client verifies the servers signature is correct and aborts if not.
  6. The client signs T1 and passes the signature to the server, which now broadca
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active June 2, 2024 11:23
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@samuelclay
samuelclay / LED Dress.ino
Last active February 15, 2024 16:07
For New Year's Eve 2014, my girlfriend and I went to a dance party where wearable electronics were not only encouraged but also on display from a variety of hobbyists. I decided to use this as an opportunity to combine two of my favorite hobbies: sewing and electronics. We attached six addressable LED strands from Sparkfun ($20 each) to the lini…
#include <Adafruit_NeoPixel.h>
#include "WS2812_Definitions.h"
#define PIN_A 9
#define PIN_B 3
#define PIN_C 2
#define PIN_D 12
#define PIN_E 10
#define PIN_F 6
#define LED_COUNT 43