Skip to content

Instantly share code, notes, and snippets.

View vrde's full-sized avatar
🗿

vrde vrde

🗿
View GitHub Profile
@vrde
vrde / pymodoro.py
Created May 9, 2012 14:40
simple pomodoro implementation with pynotify
import pynotify
from time import sleep
def mins_to_secs(ms):
return map(lambda x: x * 60, ms)
class Pymodoro(object):
POMODORO_TIME = 25 * 60
POMODORO_CHECKPOINTS = mins_to_secs([25, 15, 10, 5, 3, 1]) + range(10)
#!/bin/sh
# Setup some variables needed for bootstrapping the environment
ROOT=/home/vrde/projectz/myproject
REPOS=${ROOT}/repos
export PYTHONPATH=${REPOS}
@vrde
vrde / keybase.md
Last active September 11, 2017 14:19

Keybase proof

I hereby claim:

  • I am vrde on github.
  • I am vrde (https://keybase.io/vrde) on keybase.
  • I have a public key ASD86aqAXEv41oIfKRR7SVTGgULTBLVPgee3woMiiAyU7Qo

To claim this, I am signing this object:

from random import shuffle
# format of the file
# name email\nname email\nname email...
people = open('people.txt').read().split('\n')[:-1]
shuffle(people)
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€.
import json
from pprint import pprint
import base58
import sha3
from cryptoconditions import Ed25519Sha256
from bigchaindb_driver.crypto import generate_keypair
@vrde
vrde / prof.py
Last active August 16, 2018 13:24
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
try:
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 "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])]

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