Skip to content

Instantly share code, notes, and snippets.

View nikkolasg's full-sized avatar

Nicolas Gailly nikkolasg

View GitHub Profile
#!/usr/bin/env python3
from datetime import timedelta
period = 30
catchup = 10
downtime_h = 3
downtime_rounds = 2 * 60 * downtime_h
downtime = period * downtime_rounds
@nikkolasg
nikkolasg / wdrand.py
Last active June 3, 2020 13:24
weidghted drand numbers constraint solver
#!/usr/bin/env python3
# requires installation of https://pypi.org/project/python-constraint/
# `pip3 python-constraint` should do it
from constraint import *
import math
import json
# Let X the number of tier 1 nodes.
# Let Y the number of tier 2 nodes.
# Let R be the weight / replication factor of each tier 1 node
Verifying my Blockstack ID is secured with the address 1PErskqD6PhcP1SFeWbzDTFu23iU4EBc1U https://explorer.blockstack.org/address/1PErskqD6PhcP1SFeWbzDTFu23iU4EBc1U
@nikkolasg
nikkolasg / keybase.md
Created August 16, 2016 11:50
my keybase proof

Keybase proof

I hereby claim:

  • I am nikkolasg on github.
  • I am nikkolasg (https://keybase.io/nikkolasg) on keybase.
  • I have a public key whose fingerprint is 9AD7 EF74 6E80 E200 EEAF FB7D CBC7 B06D 574A 4C6A

To claim this, I am signing this object:

@nikkolasg
nikkolasg / udp.go
Created January 20, 2016 21:11
UDP size buffer
package main
import (
"encoding/binary"
"fmt"
"net"
"os"
"time"
)