Skip to content

Instantly share code, notes, and snippets.

View sullof's full-sized avatar

Francesco Sullo sullof

View GitHub Profile
/*
Ref : https://medium.com/metamask/eip712-is-coming-what-to-expect-and-how-to-use-it-bb92fd1a7a26
Signature was created using the API eth_signTypedData_v3
Address recovered via eth-sig-utils
*/
const sigUtil = require('eth-sig-util')
@xavierlepretre
xavierlepretre / getTransactionReceiptMined.js
Last active February 5, 2023 03:26
Get the Promise of an Ethereum transaction receipt when it is finally mined
const Promise = require("bluebird");
const sequentialPromise = require("./sequentialPromise.js");
/**
* @param {!string | !Array.<!string>} txHash, a transaction hash or an array of transaction hashes.
* @param {Number} interval, in seconds.
* @returns {!Promise.<!object> | !Promise.<!Array.<!object>>} the receipt or an array of receipts.
*/
module.exports = function getTransactionReceiptMined(txHash, interval) {
const self = this;
@rvl
rvl / git-pushing-multiple.rst
Created February 9, 2016 11:41
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@jlongster
jlongster / testgen.js
Created June 7, 2013 04:25
basic generator async lib
// based off of https://gist.github.com/creationix/5544019
// these could probably be condensed more, but I'm just doing this
// quickly
function call(func) {
var args = Array.prototype.slice.call(arguments, 1);
return function(callback) {
args.push(callback);