Skip to content

Instantly share code, notes, and snippets.

View mingderwang's full-sized avatar

Ming-der Wang mingderwang

View GitHub Profile
<script>
(function(){
var data = {
"@context": "http://schema.org",
"@type": "BlogPosting",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": {{Page URL}}
},
"headline": {{SCHEMA - Article Headline}},
let ethers = require('ethers')
let provider = new ethers.providers.JsonRpcProvider(process.env.KOVAN_RPC_URL)
let oracleAddress = '0x4E9b9E70d72c919E0c7C1F47a7d6CD84B1A0C4E0'
let oracleAbi = [
{
"constant": false,
"inputs": [
{
"name": "_sender",
@mingderwang
mingderwang / Oracle.sol
Last active September 24, 2020 17:02 — forked from thodges-gh/Oracle.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=true&gist=
pragma solidity 0.6.6;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/Oracle.sol";
pragma solidity ^0.6.0;
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/ChainlinkClient.sol";
import "https://github.com/smartcontractkit/chainlink/evm-contracts/src/v0.6/vendor/Ownable.sol";
contract ATestnetConsumer is ChainlinkClient, Ownable {
uint256 constant private ORACLE_PAYMENT = 1 * LINK;
uint256 public currentPrice;
int256 public changeDay;
@mingderwang
mingderwang / AAPL.sol
Created September 18, 2020 07:43 — forked from cereum/AAPL.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=
/** This example code is designed to quickly deploy an example contract using Remix.
* If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough
* You will need testnet ETH and LINK.
* - Ropsten ETH faucet: https://faucet.ropsten.be/
* - Ropsten LINK faucet: https://ropsten.chain.link/
*/
pragma solidity ^0.6.0;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/ChainlinkClient.sol";
@mingderwang
mingderwang / APIConsumer.sol
Last active September 27, 2020 07:19 — forked from alexroan/APIConsumer.sol
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.6+commit.6c089d02.js&optimize=false&gist=7d5d8af26b083cafe1474fe7d6bc412b
/** This example code is designed to quickly deploy an example contract using Remix.
* If you have never used Remix, try our example walkthrough: https://docs.chain.link/docs/example-walkthrough
* You will need testnet ETH and LINK.
* - Kovan ETH faucet: https://faucet.kovan.network/
* - Kovan LINK faucet: https://kovan.chain.link/
*/
pragma solidity ^0.6.6;
import "https://raw.githubusercontent.com/smartcontractkit/chainlink/develop/evm-contracts/src/v0.6/ChainlinkClient.sol";
@mingderwang
mingderwang / max_info.ipynb
Last active August 19, 2020 06:47 — forked from TomAugspurger/max_info.ipynb
max_info
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
DOCKER
======
./create_partycrasher_zip.sh
docker build -t partycrasher .
-- docker run gunicorn with local ES
docker run -e ELASTICSEARCH_ALLOW_DELETE_ALL=true -e ELASTICSEARCH_CREATE_INDEXES=true -e ELASTICSEARCH_HOSTS=host.docker.internal -e ELASTICSEARCH_PORT=9200 -e ELASTICSEARCH_REST_HTTP_SCHEME=http -e ELASTICSEARCH_REST_SIGN_REQUESTS_ENABLED=false -e PARTYCRASHER_LOGGER_LEVEL=DEBUG -it --rm -p 8080:8080 --name partycrasher partycrasher
@mingderwang
mingderwang / .block
Last active February 10, 2020 04:15 — forked from mbostock/.block
Epicyclic Gearing
license: gpl-3.0
redirect: https://observablehq.com/@mingderwang2/untitled/2
@mingderwang
mingderwang / .block
Created February 3, 2020 04:00 — forked from mbostock/.block
New York Census Tracts
license: gpl-3.0