Skip to content

Instantly share code, notes, and snippets.

View RickWong's full-sized avatar

Rick Wong RickWong

  • Amsterdam
  • 05:46 (UTC +02:00)
  • X @ryguw
View GitHub Profile
@RickWong
RickWong / µredux.es6
Last active August 25, 2016 10:15 — forked from rstacruz/µredux.js
Redux in <1kb
const INIT = '@redux/INIT';
export const createStore = (reducer, state, enhancer) => {
if (enhancer) {
return enhancer(createStore)(reducer, state);
}
const subscribers = [];
dispatch({ type: INIT });
@RickWong
RickWong / blockchain.py
Created May 19, 2016 21:09 — forked from dela3499/blockchain.py
Implementation of simple blockchain
import numpy as np
import hashlib
def create_block(parent_block, value, hashfunc):
""" ------------------------------------------------
String -> Block -> (Block -> String) -> Block
------------------------------------------------
Produce a new block from a string value and a hash
of its parent block. In this case, a block is also a string.
"""