Skip to content

Instantly share code, notes, and snippets.

Eth wrangling.

justin j. moses justinjmoses

Eth wrangling.
View GitHub Profile
hav-noms / SNXClaimerZap.sol
Created May 17, 2020
Burn, Claim & Mint on behalf in 1 tx
View SNXClaimerZap.sol
pragma solidity >=0.4.22 <0.7.0;
interface ISynthetix {
function burnSynthsToTargetOnBehalf(address burnForAddress) external;
function issueMaxSynthsOnBehalf(address issueForAddress) external;
function remainingIssuableSynths(address issuer) external returns (uint256);
interface IFeePool {
function claimOnBehalf(address claimingForAddress) external;
k06a / Unipool.sol
Last active Nov 6, 2019
ETH-sETH Staking Pool for SNX reward
View Unipool.sol
pragma solidity ^0.5.0;
import "";
import "";
import "";
import "";
contract Unipool is ERC20, ERC20Detailed("Unipool", "SNX-UNP", 18) {
View reason.js
// This is universal, works with Infura -- set provider accordingly
const ethers = require('ethers')
//const provider = ethers.getDefaultProvider('rinkeby')
const provider = new ethers.providers.JsonRpcProvider(process.env.WEB3_URL)
function hex_to_ascii(str1) {
var hex = str1.toString();
var str = '';
for (var n = 0; n < hex.length; n += 2) {
View Synthetix.Ethereum.Contracts.txt
## Currency Keys (Ascii to hex)
ETH 0x455448
SNX 0x534e58
XDR 0x584452
sUSD 0x73555344
sAUD 0x73415544
sEUR 0x73455552
sJPY 0x734a5059
sXAU 0x73584155
ryansimms /
Last active Jul 1, 2020
Deploying to Elastic Beanstalk via CircleCi 2.0

Deploying to Elastic Beanstalk via CircleCi 2.0

I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.

For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.

Setup a user on AWS IAM to use for deployments

boneskull /
Last active Apr 17, 2020
example of how to debug mocha v4 if hanging

Here's an example of how to debug Mocha v4 if it hangs.

Ensure you're using a Node.js 8 or newer (or any version with async_hooks support).

If you run your test, you'll notice it hangs:

$ mocha test.js
nolanlawson /
Last active Nov 28, 2017
"Parens and Performance" – counterpost

"Parens and Performance" – counterpost

Kyle Simpson (@getify) wrote a very thoughtful post decrying optimize-js, which is a tool I wrote that exploits known optimizations in JavaScript engines to make JS bundles parse faster (especially minified bundles, due to what could be reasonably described as a bug in Uglify).

Kyle lays out a good case, but I tend to disagree with nearly all his points. So here's my rebuttal.

IamAdiSri / Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
Last active Jun 29, 2020 — forked from evansneath/Python3 Virtualenv Setup
Setting up and using Python3, Pip3, Virtualenv (for Python3) and Virtualenvwrapper (for Python3)
View Python3, Pip3, Virtualenv and Virtualenvwrapper Setup
First install pip for Python2. Download the file from
$ cd <download location>
$ sudo -H python ./
Installing pip also installs Python3
To run Python3
$ python3
Install pip3 by just executing the same file as in the step above, but this time using Python3
$ sudo -H python3 ./
btroncone /
Last active Jul 11, 2020
A Comprehensive Introduction to @ngrx/store - Companion to Series

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

subfuzion /
Last active Jul 12, 2020
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

You can’t perform that action at this time.