Skip to content

Instantly share code, notes, and snippets.

View jtoomim's full-sized avatar

Jonathan Toomim jtoomim

View GitHub Profile
# -*- coding: utf-8 -*-
all_colors = ['#aec7e8',
'#ff7f0e',
'#1f77b4',
'#ffbb78',
'#2ca02c',
'#98df8a',
'#d62728',
'#ff9896',
'#9467bd',
import random
def get_reward(shares):
return shares[0] / float(1+sum(shares[1:]))
def run_sim(low, high, N):
# preload the share chain
shares = [random.randint(low, high) for i in range(N)]
@jtoomim
jtoomim / stresstest_block_prop_early_draft.tsv
Created September 8, 2018 18:34
BCH stresstest block propagation draft results
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 14. in line 1.
['14.161.3.136', '198.48.143.147', '208.84.223.121', '24.149.8.238', '37.221.198.57', '50.57.119.10', '63.13.62.197', '84.209.133.114', '88.198.39.205']
14.161. 198.48. 208.84. 24.149. 37.221. 50.57.1 63.13.6 84.209. 88.198. first_seen timestamp size (kb) kB/s
000000000000000000b63de5a36f29fb69119a3b55bcbdb961a9744bcacf86f4 1 0 1 1 2018-08-29 03:11:59 1535512299 107 0.000030
00000000000000000109990e189bee722307dda0b21406306f903083467cafe3 1 0 1 1 2018-08-29 03:28:04 1535513258 136 0.000038
00000000000000000102bff1bdb95fd3cdd5a91912cc714677bbc30cbd743b1c 1 0 1 1 2018-08-29 03:39:13 1535513918 96 0.000027
0000000000000000000aedb3aff750d3f8dd42fd73cd7d21776298051468b7d9 0 0 0 0 2018-08-29 03:41:08 1535514045 5 0.000001
0000000000000000014fe6a0c57324a8ad999907c98e14dc2dabef1adec40bb3 1 0 1 1 2018-08-29 03:53:51 1535514819 58 0.000016
000000000000000001ecfa089ddc0e4dce2324ab563366f1fa00
15.2879120879 bits/tx for a 910 tx block or about 13.55 excluding coinbase/header 99.42%
20.7946127946 bits/tx for a 297 tx block or about 14.33 excluding coinbase/header 99.41%
24.7195767196 bits/tx for a 189 tx block or about 14.14 excluding coinbase/header 99.51%
368.0 bits/tx for a 7 tx block or about 41.14 excluding coinbase/header 87.15%
22.7659574468 bits/tx for a 188 tx block or about 14.04 excluding coinbase/header 99.22%
18.6136363636 bits/tx for a 352 tx block or about 14.11 excluding coinbase/header 99.37%
19.9882697947 bits/tx for a 341 tx block or about 14.36 excluding coinbase/header 99.29%
20.3800904977 bits/tx for a 442 tx block or about 15.19 excluding coinbase/header 99.11%
18.7796610169 bits/tx for a 354 tx block or about 14.31 excluding coinbase/header 99.44%
37.2602739726 bits/tx for a 73 tx block or about 14.79 excluding coinbase/header 98.93%
@jtoomim
jtoomim / subreddit.py
Created April 28, 2019 12:59
Quick script for checking how many comments occurred in a month on a subreddit using pushshift.io
import urllib.request, json
# https://api.pushshift.io/reddit/comment/search/?subreddit=btc&aggs=subreddit&size=0&after=2015-09-01&before=2016-01-01&author=!automoderator
doc_counts = {}
sub = 'btc'
for y in range(2011, 2020):
for m in range(1, 13):
if m == 12:
nm = 1 # next month

Keybase proof

I hereby claim:

  • I am jtoomim on github.
  • I am jtoomim (https://keybase.io/jtoomim) on keybase.
  • I have a public key ASDod9SqHSH1rw-M-c2s0lGUKkEwdOt82rJK793twLQjVAo

To claim this, I am signing this object: