Skip to content

Instantly share code, notes, and snippets.

🔗
Eth wrangling.

justin j. moses justinjmoses

🔗
Eth wrangling.
View GitHub Profile
@hav-noms
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
k06a / Unipool.sol
Last active Nov 6, 2019
ETH-sETH Staking Pool for SNX reward
View Unipool.sol
pragma solidity ^0.5.0;
import "github.com/openzeppelin/openzeppelin-contracts/contracts/math/SafeMath.sol";
import "github.com/openzeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import "github.com/openzeppelin/openzeppelin-contracts/contracts/token/ERC20/ERC20Detailed.sol";
import "github.com/openzeppelin/openzeppelin-contracts/contracts/token/ERC20/SafeERC20.sol";
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
ryansimms / circleci-2.0-eb-deployment.md
Last active Jul 1, 2020
Deploying to Elastic Beanstalk via CircleCi 2.0
View circleci-2.0-eb-deployment.md

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
boneskull / README.md
Last active Apr 17, 2020
example of how to debug mocha v4 if hanging
View README.md

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
nolanlawson / parens-and-perf-counterpost.md
Last active Nov 28, 2017
"Parens and Performance" – counterpost
View parens-and-perf-counterpost.md

"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
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 get-pip.py file from https://bootstrap.pypa.io/get-pip.py
$ cd <download location>
$ sudo -H python ./get-pip.py
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 ./get-pip.py
@btroncone
btroncone / ngrxintro.md
Last active Jul 11, 2020
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series
View ngrxintro.md

Comprehensive Introduction to @ngrx/store

By: @BTroncone

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

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

Table of Contents

@subfuzion
subfuzion / curl.md
Last active Jul 12, 2020
curl POST examples
View curl.md

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.