git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
/** | |
* Encrypts plaintext using AES-GCM with supplied password, for decryption with aesGcmDecrypt(). | |
* (c) Chris Veness MIT Licence | |
* | |
* @param {String} plaintext - Plaintext to be encrypted. | |
* @param {String} password - Password to use to encrypt plaintext. | |
* @returns {String} Encrypted ciphertext. | |
* | |
* @example | |
* const ciphertext = await aesGcmEncrypt('my secret text', 'pw'); |
#!/usr/bin/python2 | |
# Copyright (C) 2016 Sixten Bergman | |
# License WTFPL | |
# | |
# This program is free software. It comes without any warranty, to the extent | |
# permitted by applicable law. | |
# You can redistribute it and/or modify it under the terms of the Do What The | |
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See |
package main | |
import ( | |
"fmt" | |
"github.com/ethereum/go-ethereum/accounts" | |
"github.com/ethereum/go-ethereum/common/hexutil" | |
"github.com/ethereum/go-ethereum/crypto" | |
) |
#!/usr/bin/env python | |
# Haversine formula example in Python | |
# Author: Wayne Dyck | |
import math | |
def distance(origin, destination): | |
lat1, lon1 = origin | |
lat2, lon2 = destination |
/** | |
* The function you pass to `asyncPoll` should return a promise | |
* that resolves with object that satisfies this interface. | |
* | |
* The `done` property indicates to the async poller whether to | |
* continue polling or not. | |
* | |
* When done is `true` that means you've got what you need | |
* and the poller will resolve with `data`. | |
* |
import math | |
class Welford(object): | |
""" Implements Welford's algorithm for computing a running mean | |
and standard deviation as described at: | |
http://www.johndcook.com/standard_deviation.html | |
can take single values or iterables | |
Properties: | |
mean - returns the mean |
/* | |
Author: Jonathan Lurie - http://me.jonathanlurie.fr | |
License: MIT | |
The point of this little gist is to fix the issue of losing | |
typed arrays when calling the default JSON serilization. | |
The default mode has for effect to convert typed arrays into | |
object like that: {0: 0.1, 1: 0.2, 2: 0.3} what used to be | |
Float32Array([0.1, 0.2, 0.3]) and once it takes the shape of an | |
object, there is no way to get it back in an automated way! |
// spec: https://github.com/tc39/proposal-weakrefs | |
// the spec contains an [iterable WeakMap implementation](https://github.com/tc39/proposal-weakrefs#iterable-weakmaps) | |
// NOTE: this WeakSet implementation is incomplete, only does what I needed | |
// In Firefox Nightly, visit about:config and enable javascript.options.experimental.weakrefs | |
class IterableWeakSet extends Set { | |
add(el) { | |
super.add(new WeakRef(el)) | |
} | |
forEach(fn) { |