Skip to content

Instantly share code, notes, and snippets.

View VanijaDev's full-sized avatar

Ivan Solo VanijaDev

View GitHub Profile
@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;
@sanjay1909
sanjay1909 / npm without sudo
Created August 1, 2015 10:54
How to get ownership of the .npm directory
// Don’t ever use npm with sudo (eg: sudo npm install) except if you want to install a package.
// Problem is permissions issue in your our Home directory.
// reclaim ownership of the .npm directory.
sudo chown -R $(whoami) ~/.npm
// the write permission in node_modules directory:
sudo chown -R $(whoami) /usr/local/lib/node_modules