Skip to content

Instantly share code, notes, and snippets.

View haraldschilly's full-sized avatar

Harald Schilly haraldschilly

View GitHub Profile
@pamelafox
pamelafox / gist:1006753
Created June 3, 2011 17:35
Sendgrid Python Web API example
import urllib2, urllib
import logging
def send_mail_sendgrid(from, to, subject, body):
base_url = 'https://sendgrid.com/api/mail.send.json'
params = {
'api_user': '[email protected]',
'api_key': 'yourpassword',
'from': from,
'to': to,
@fabianp
fabianp / gist:1342033
Created November 5, 2011 21:18
Low rank approximation for the lena image
"""
Low rank approximation for the lena image
"""
import numpy as np
import scipy as sp
from scipy import linalg
import pylab as pl
X = sp.lena().astype(np.float)
pl.gray()
@mckoss
mckoss / moved.md
Created December 30, 2011 00:28
A Bitcoin Primer
@gavinandresen
gavinandresen / btcpayments.rst
Last active May 28, 2024 17:41
Bitcoin Payment Messages

SEE BIP 70

See https://en.bitcoin.it/wiki/BIP_0070 for the latest version of this document; I'll keep this document so the process of discussion/revision isn't lost.

Bitcoin Payment Messages

This document proposes protocol buffer-based formats for a simple payment protocol between a customer's bitcoin client software and a merchant.

@haraldschilly
haraldschilly / countdown.py
Created November 25, 2012 19:49
Bitcoin Blockreward Estimation
#!/usr/bin/env python
# Copyright Harald Schilly <harald.schil.ly>
# License: Apache 2.0
# Hint: run it periodically via: watch -d -n 30 python countdown.py
# (sorry blockexplorer ...)
# which halfing? 1, 2, ...
nb_halfing = 2
quot = 2 ** nb_halfing
reward = 50. / quot
@senko
senko / maybe.py
Last active May 2, 2024 18:35
A Pythonic implementation of the Maybe monad
# maybe.py - a Pythonic implementation of the Maybe monad
# Copyright (C) 2014. Senko Rasic <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#

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.

Abstract

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.