Skip to content

Instantly share code, notes, and snippets.


Alexander Leishman leishman

View GitHub Profile
achow101 /
Last active Jun 24, 2020
How to Use Bitcoin Core with Hardware Wallets

Using Bitcoin Core with Hardware Wallets

This approach is fairly manual, requires the command line, and requires a patched version of Bitcoin Core.

Note: For this guide, code lines prefixed with $ means that the command is typed in the terminal. Lines without $ are output of the commands.


I am not liable for any coins that may be lost through this method. The software mentioned may have bugs. Use at your own risk.

fernandonm /
Last active May 29, 2019
Trust-minimized derivatives

Trust-minimized derivatives

Options contracts can be implemented as trust-minimized smart contracts using Bitcoin script. These contracts don't require oracles feeding the price into the blockchain or any other trusted third party. Recipients will only trust miners to mine (and not reverse) transactions paying a reasonable feerate, securing their payouts.

The underlier of these derivatives can be any digital asset available on a blockchain that can do HLTCs.

Call options

The buyer of an American-style call binary option pays a premium (eg: 0.1 BTC) for <seller secret> wich gives the right to buy Q units (quantity) of the underlying asset (100 LTC) at a specified strike price (0.016 BTC per LTC) at any time until the expiration date.

maxivak /
Last active Sep 26, 2020
Sending emails with ActionMailer and Sidekiq

Sending emails with ActionMailer and Sidekiq

Send email asynchroniously using Sidekiq.


Create your mailer us usual:

spoike / webapi_example.js
Last active May 12, 2017
Simple WebAPI example
View webapi_example.js
var PostsApi = require('webapi/posts'),
// assuming the api object from the jsbin snippet
Reflux = require('reflux');
var PostActions = createActions(["load", "loadError"]);
// load action is invoked either from:
// * top most component's componentDidMount
// function in your application, or
// * window.onLoad
// I prefer the first strategy because that'll

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."


A pseudonymous trust system for a decentralized anonymous marketplace

Dionysis Zindros, National Technical University of Athens


pseudonymous anonymous web-of-trust identity trust bitcoin namecoin proof-of-burn timelock decentralized anonymous marketplace openbazaar


rthbound / animated_moon.rb
Last active Aug 29, 2015
Make a gif of the Moon as seen from Earth for one lunar year, starting now -
View animated_moon.rb
require "usno/imagery"
require "open-uri"
require "RMagick"
include Magick
def animate(n,f)
time =
julionc /
Last active Oct 14, 2020
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
hmans / application.html.slim
Last active Apr 14, 2020
Application layout for Rails (4 and 5), Slim style.
View application.html.slim
doctype html
title My App
meta name="viewport" content="width=device-width, initial-scale=1.0"
= stylesheet_link_tag "application", media: 'all', 'data-turbolinks-track' => true
= javascript_include_tag "application", 'data-turbolinks-track' => true
= csrf_meta_tags
plentz / nginx.conf
Last active Oct 19, 2020
Best nginx configuration for improved security(and performance). Complete blog post here
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
You can’t perform that action at this time.