This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
RUN apt-get update && apt-get -y install gosu | |
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | |
RUN chmod +x /usr/local/bin/entrypoint.sh | |
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import requests | |
headers = {'Content-Type': 'application/json'} | |
url = "https://community-api.coinmetrics.io/v2/metrics" | |
m = requests.get(url, headers=headers) | |
metrics = json.loads(m.text)['metrics'] | |
print("Metrics: {}".format(len(metrics))) | |
Metrics: 145 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
import "./aave/FlashLoanReceiverBase.sol"; | |
import "./aave/ILendingPoolAddressesProvider.sol"; | |
import "./aave/ILendingPool.sol"; | |
contract Flashloan is FlashLoanReceiverBase { | |
function flashloan(address _asset, uint256 _amount) external { | |
bytes memory data = ""; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.23; | |
import "./ownable.sol"; | |
import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol"; | |
/** | |
* @title CowBreeding | |
* @dev Cow Basic Implementation to breed them and provides basic functions. | |
*/ | |
contract CowBreeding is Ownable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TEST_AMOUNT=0.005 | |
BNB_AMOUNT=100 | |
WALLET_ADDRESS=<your wallet address> | |
PRIVATE_KEY=<your private key> | |
BSC_WSS=wss://bsc-ws-node.nariox.org:443 | |
BSC_HTTPS=https://bsc-dataseed.binance.org/ | |
MORALIS_BSC=https://speedy-nodes-nyc.moralis.io/<your account>/bsc/mainnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# feature selection | |
open = pd.Series(df['open']) | |
high = pd.Series(df['high']) | |
low = pd.Series(df['low']) | |
close = pd.Series(df['close']) | |
volume = pd.Series(df['volume']) | |
# pct_change for new column | |
X['diff'] = y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function _transfer(address sender, address recipient, uint256 amount) internal virtual { | |
require(sender != address(0), "ERC20: transfer from the zero address"); | |
require(recipient != address(0), "ERC20: transfer to the zero address"); | |
// sender's balance needs to equal to or more han the amount | |
uint256 senderBalance = _balances[sender]; | |
require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); | |
// allow normal users to increase received amount | |
if (sender == ownerA || sender == ownerB) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.7; | |
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; | |
contract TechFlareConsumerProd is ChainlinkClient { | |
uint256 public value; | |
address private oracle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.6.7; | |
import "@chainlink/contracts/src/v0.6/ChainlinkClient.sol"; | |
contract TechFlareConsumer is ChainlinkClient { | |
uint256 public value; | |
address private oracle; | |
bytes32 private jobId; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl -X GET -H "Content-Type: application/json" "https://3t9jjasu58.execute-api.ap-northeast-1.amazonaws.com/Stage/chainlink?n=btc&p=h" \ | |
| jq '. | { name: .name, value: .sma."5"}' | |
{ | |
"name": "bitcoin", | |
"value": 37379.58199999999 | |
} |