Skip to content

Instantly share code, notes, and snippets.

View inotifydo
#!/usr/bin/env bash
# inotifydo <path> <command>
# Run a command when a file in the path changes.
# Examples:
# Run my python tests when I change a file in the current path
# inotifydo . "python test"

Why We Should Build Software Like We Build Houses

About Leslie Lamport

Leslie Lamport is a computer scientist and an expert on distributed systems, temporal logic, and concurrent algorithms. He is a member of the National Academy of Engineering and the National Academy of Sciences. Dr. Lamport earned his Ph.D. and M.A. in mathematics from Brandeis University and B.S. from MIT. He works at Microsoft Research.


Most programmers regard anything that doesn't generate code to be a waste of time. Thinking doesn't generate code, and writing code without thinking is a recipe for bad code. Before we start to write any piece of code, we should understand what that code is supposed to do. Understanding requires thinking, and thinking is hard. In the words of the cartoonist Dick Guindon:


Service Dist0rtion Protocol

SDP offers different services to its members.

SDPFS private network

SDPFS is Social Dist0rtion Protocol File System. SDFPS is a private network of IPFS nodes. The network is private because we might share information about the future that would modify the course of events, causing a fork of our current branch of reality.

Prerequisite: install IPFS and the pre-shared key

View hash256.code
import "hashes/sha256/256bitPadded.code" as sha256
import "utils/pack/unpack128.code" as unpack128
import "utils/pack/pack128.code" as pack128
def main(private field a, private field b) -> (field[2]):
field[128] a128 = unpack128(a)
field[128] b128 = unpack128(b)
h = sha256([...a128, ...b128])
return [pack128(h[0..128]), pack128(h[128..256])]
View hash-and-nullify.code
import "hashes/sha256/512bitPacked.code" as sha256packed
def main(private field a, private field b, private field c, private field d, private field n) -> (field[2], field):
h = sha256packed([a, b, c, d])
return h, n
import sys
import base64
import json
import time
from bigchaindb.lib import BigchainDB
from bigchaindb.models import Transaction
from bigchaindb.common.crypto import generate_key_pair
import json
from pprint import pprint
import base58
import sha3
from cryptoconditions import Ed25519Sha256
from bigchaindb_driver.crypto import generate_keypair
from random import shuffle
# format of the file
# name email\nname email\nname email...
people = open('people.txt').read().split('\n')[:-1]
TMPL = """Dear {},
I'm inviting you to a fun game of Secret Santa. Secret Santa is a fun game in which everyone buys gifts for one other person, who doesn't know who bought their gift.
The person you have to buy a gift for is {}. The budget for this year is 15€.

Keybase proof

I hereby claim:

  • I am vrde on github.
  • I am vrde ( on keybase.
  • I have a public key ASD86aqAXEv41oIfKRR7SVTGgULTBLVPgee3woMiiAyU7Qo

To claim this, I am signing this object: