Skip to content

Instantly share code, notes, and snippets.


Daniel Himmelstein dhimmel

View GitHub Profile
dashed / github-pandoc.css
Created Sep 26, 2013
GitHub-like CSS for pandoc standalone HTML files (perfect for HTML5 output). Based on's GitHub CSS. Added normalize.css (v2.1.3) in the prior to GitHub css.
View github-pandoc.css
/*! normalize.css v2.1.3 | MIT License | */
/* ==========================================================================
HTML5 display definitions
========================================================================== */
* Correct `block` display not defined in IE 8/9.
mitchwongho / Docker
Last active Jun 15, 2021
Docker 'run' command to start an interactive BaSH session
View Docker
# Assuming an Ubuntu Docker image
$ docker run -it <image> /bin/bash
discdiver /
Last active Jun 3, 2021
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as


A description of known problems in Satoshi Nakamoto's paper, "Bitcoin: A Peer-to-Peer Electronic Cash System", as well as notes on terminology changes and how Bitcoin's implementation differs from that described in the paper.


The longest chain not only serves as proof of the sequence of events witnessed, but proof that it came from the largest pool of CPU power.

metalicjames /
Last active May 13, 2021
Bitcoin Gold (BTG) was 51% attacked

Bitcoin Gold (BTG) was 51% attacked


Bitcoin Gold is a Bitcoin hard-fork that aims to be GPU-mineable by using the Equihash algorithm with parameters (144, 5) also known as "Zhash". The Bitcoin Gold website claims Zhash "uses more memory than an ASIC can muster, but runs fine on many graphics cards". Bitcoin Gold was previously 51% attacked in May 2018 when it was estimated that up to $18 million worth of BTG was double-spent.

The Attacks

Between Thursday and Friday we detected two deep reorgs on BTG, both of which contained double-spends. Their details are listed below. All times are GMT.

View btg_attack_output.txt
Reorg 0 at 2020-01-23T18:01:32 db ID: 85779
Depth 14
Length 13
Est attacker chain duration 2:13:28
Est attacker hashrate 2.53 MH/s
Nicehash hashrate 3.41 MH/s
Nicehash price 0.86 BTC/MH/s/Day
Est Nicehash cost 0.2013653 BTC
Reorg Blocks
sorce /
Last active Nov 5, 2019
Create, sign and send a counterparty transaction from an address controlled by a trezor
#!/usr/bin/env python
if you find this script helpful and would like to give some crypto to
the cause, we would be very happy to receive it :)
donate bitcoin / counterparty: 3L19gTtMMJHpkAjYVduUZETdduwAfM7NGR
import sys
import json
import requests
from requests.auth import HTTPBasicAuth
viking / install-package-version.R
Created Dec 20, 2011
Install a specific version of an R package (hack)
View install-package-version.R
# Looks in the CRAN archive for the specified package and version. If
# the specified version is NULL or the same as the most recent version
# of the package, this function simply calls install.packages(). Otherwise,
# it looks at the list of archived source tarballs and tries to install
# an older version instead.
install.package.version <- function(
version = NULL,
repos = getOption('repos'),