Skip to content

Instantly share code, notes, and snippets.

View wbobeirne's full-sized avatar

Will O'Beirne wbobeirne

View GitHub Profile
{
"timestamp": "2019-01-12T17:20:27.670Z",
"main": {
"customNetworks": [],
"customTokens": [],
"customDeriviationPaths": [],
"gas": {
"speed": "regular"
},
"skipTutorial": true
/*
Check the token balances of a wallet for multiple tokens.
Pass 0x0 as a "token" address to get ETH balance.
Possible error throws:
- extremely large arrays for user and or tokens (gas cost too high)
Returns a one-dimensional that's user.length * tokens.length long. The
array is ordered by all of the 0th users token balances, then the 1th
user, and so on.
Verifying my Blockstack ID is secured with the address 1MuzNQ5ecsjWt3yAz6CrPbKZtkzLhHbHQo https://explorer.blockstack.org/address/1MuzNQ5ecsjWt3yAz6CrPbKZtkzLhHbHQo
Verifying my Blockstack ID is secured with the address 16Zk2WG5cBc7Lrq9yMLLbt8BujCJbjNBFm https://explorer.blockstack.org/address/16Zk2WG5cBc7Lrq9yMLLbt8BujCJbjNBFm
@wbobeirne
wbobeirne / gist:b38ddb50a64626112eec13d82508a43d
Created January 11, 2018 23:10
Kovan Faucet Verification
0xdbbf1a39bf68a269ce4fe6fd24299afb94df86e6

_.map

Pretty much identical IMO.

// Lodash
const listOfAttrs = _.map(listOfObjects, (obj) => obj.attr);

// JS
const listOfAttrs = listOfObjects.map((obj) => obj.attr);

When starting a new project with a Postgres database, you'll want to do the following things to set it up:

1) Create the Database

Depending on which operating system you're on, you'll need to do the following:

OSX

  1. Open your terminal
  2. Run psql --username=postgres, enter the password you made for postgres
const fs = require("fs");
module.exports = (args) => {
return (data) => {
let json = null;
// Include the JSON, throw a log and exit if it wasn't JSON / bad path.
try {
json = require(args.path);
if (!json || json.constructor != Object) {
@wbobeirne
wbobeirne / SassMeister-input.scss
Created April 15, 2015 14:05
Generated by SassMeister.com.
// ----
// Sass (v3.4.12)
// Compass (v1.0.3)
// ----
@function hub-px($px) {
@return #{$px / 12.8}vw;
}
.thing {
### Keybase proof
I hereby claim:
* I am wbobeirne on github.
* I am willo (https://keybase.io/willo) on keybase.
* I have a public key whose fingerprint is 253A 48ED CDA1 3280 B4FF EC0F 8292 7AEC 03A2 CC97
To claim this, I am signing this object: