I hereby claim:
- I am coopermaruyama on github.
- I am cooperm (https://keybase.io/cooperm) on keybase.
- I have a public key ASBCWPJ3o0p1okDCyXJ6TKfl_G0H-OKxFDUlM1dspiuRBwo
To claim this, I am signing this object:
curl \ | |
-X POST \ | |
-H "Content-Type: application/json" \ | |
--data '{ "query": "{ icos { id, name, symbol, roi_since_ico } }" }' \ | |
https://icostats.com/graphql |
const moment = require('moment'); | |
function findPrice(prices, targetMoment) { | |
const match = prices.find((data) => { | |
const [ts] = data; | |
const momentPrice = moment(ts); | |
return momentPrice.isSame(targetMoment, 'day'); | |
}); | |
const res = match && match[1]; |
const candidates = [ | |
'A', | |
'B', | |
'C', | |
'D' | |
] | |
const votes = [ | |
['B', 'C', 'A', 'D'], | |
['B', 'C', 'A', 'D'], |
I hereby claim:
To claim this, I am signing this object:
const ownOrder: AssetSwapper.SignedOrder = {...} | |
const customBook = AssetSwapper.Orderbook.getOrderbookForProvidedOrders([ | |
ownOrder | |
]); | |
const quoter = new AssetSwapper.SwapQuoter( | |
provider, | |
customBook | |
); | |
const order = await quoter.getMarketBuySwapQuoteAsync( | |
contractAddress, |
// | |
// Generate a signed ZRX order | |
// | |
// Requires ts-node and tsconfig-paths to be installed | |
// | |
// USAGE EXAMPLE (Sell 5 orchid for 1 ETH): | |
// | |
// ERC20_ADDRESS=0x4575f41308EC1483f3d399aa9a2826d74Da13Deb \ | |
// SELL_AMOUNT=5 \ | |
// SELL_FOR_ETH_AMOUNT=1 \ |
// Sick of another person always changing the temperature? | |
// This will set your desired temperature every few seconds :) | |
// 1. Go to https://home.nest.com | |
// 2. Login | |
// 3. Pull up thermostat page | |
// 4. Open console (cmd + alt + J) | |
// 5. Paste this in, set wantTemp to whatever you want | |
function setTemp(want) { |
Uses NGINX's njs module to query geth's eth_syncing
RPC endpoint.
Considered as "healthy" only when the syncing
attribute is false.
This is useful if you are managing a cluster of geth nodes behind a load balancer and need a compatible healthcheck.
const map = 'abcdefghijklmnopqrstuvwxyz' | |
.split('') | |
.reduce((obj, curr, i) => ({ | |
...obj, | |
[String(i+1)]: curr.toUpperCase() | |
}), {}) | |
/** | |
* @param {string} s | |
* @return {number} |