Skip to content

Instantly share code, notes, and snippets.

Raine Revere raineorshine

Block or report user

Report or block raineorshine

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
npm rebuild leveldown scrypt;
echo "Starting Testrpc..."
./node_modules/ethereumjs-testrpc/bin/testrpc --port 8545 --account "0xb21e287e6dcb34cf16abb6ce71f7209906c13f763c6415c6b2320eea7688212f, 10000000000000000000000000" --account "0x3ba8150286625233d3154d795527e3cbbc07a135d14392e9485f08d2d555fb3d, 10000000000000000000000000" &
sleep 5;
karma start config.karma.js
echo "Shutting down TestRpc..."
kill -9 $testrpc_pid
> npm-check-updates@2.14.2 test /Users/raine/projects/npm-check-updates
> npm run lint ; mocha && mocha test/individual
> npm-check-updates@2.14.2 lint /Users/raine/projects/npm-check-updates
> eslint bin lib test
raineorshine / accumulate.js
Created Nov 9, 2017
accumulate(): Executes an array of promises or promise-returning functions serially and reduces the results with the given accumulator
View accumulate.js
const waterfall = require('promise.waterfall')
const Bluebird = require('bluebird')
const _ = require('lodash')
// an array of 10ms functions with different return values
const functions = [
() => Bluebird.delay(10, 'a'),
() => Bluebird.delay(10, 'b'),
() => Bluebird.delay(10, 'c')
raineorshine /
Created Oct 12, 2017
Set git commit author for a single repository
git config "ShapeShift-Public"
git config ""

Keybase proof

I hereby claim:

  • I am raineorshine on github.
  • I am raineorshine ( on keybase.
  • I have a public key ASDmUNgDNwUm5tB0gK8u8hFbHKsUKuFSXHhQjg889aByeQo

To claim this, I am signing this object:

raineorshine / sendRawTransaction.js
Last active May 14, 2019
Sends a raw transaction with web3 v1.0 and Infura
View sendRawTransaction.js
const Web3 = require('web3')
const Tx = require('ethereumjs-tx')
// connect to Infura node
const web3 = new Web3(new Web3.providers.HttpProvider(''))
// the address that will send the test transaction
const addressFrom = '0x1889EF49cDBaad420EB4D6f04066CA4093088Bbd'
const privKey = 'PRIVATE_KEY'
View rinkeby-faucet
View pack-storage.sol
contract MyContract {
User user;
mapping (address => User) public users;
uint40 time; // cast to 5 bytes - packed with user
address addr1; // 20 bytes - packed with time
address addr2; // 20 bytes - unpacked, one slot
struct User {
raineorshine / get-contract-array-values.js
Created Apr 9, 2017
A generic means of getting all values from a public contract array.
View get-contract-array-values.js
// Streams all values from a public contract array. Callback is a function that takes a single
// argument, one item from the array. Returns a promise that rejects if there is any error or
// resolves if all items have been retrieved.
function getAll(contract, sizeGetter, array, cb) {
// get the size of the array
return contract[sizeGetter]().then(n => {
// generate an array of contract calls
return Promise.all(Array(n.toNumber()).fill().map(i => {
// invoke the callback with the item
return contract[array](i).then(cb)
You can’t perform that action at this time.