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
// Future versions of Hyper may add additional config options, | |
// which will not automatically be merged into this file. | |
// See https://hyper.is#cfg for all currently supported options. | |
module.exports = { | |
config: { | |
// choose either `'stable'` for receiving highly polished, | |
// or `'canary'` for less polished but more frequent updates | |
updateChannel: 'stable', |
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
# All units in usecs (µsec) comparing Python 2.7 | 3.7. | |
# Last updated: 2019-02-11 | |
# MacBook Pro (15-inch, 2016) | |
# macOS 10.14.3 | |
# 2.7 GHz Intel Core i7 | |
# 16 GB 2133 MHz LPDDR3 | |
python -m timeit "200 <= 250 < 300" # 0.0354 | 0.059 | |
python2.7 -m timeit "250 in xrange(200, 300)" # 1.25 |
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
This post links my 3Box profile to my Github account! Web3 social profiles by 3Box. | |
✅ did:muport:QmYPZqxdZaNF3Xw6Z5RJAhXvYG8b21jZLuSWGJdMwau3R8 ✅ | |
Create your profile today to start building social connection and trust online at https://3Box.io/ |
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.6.1; | |
contract FrontRunner { | |
address payable private manager; | |
address payable private EOA = 0x; | |
event Received(address sender, uint amount); | |
event UniswapEthBoughtActual(uint256 amount); | |
event UniswapTokenBoughtActual(uint256 amount); |
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
receive() external payable { | |
emit Received(msg.sender, msg.value); | |
} | |
modifier restricted() { | |
require(msg.sender == manager, "manager allowed only"); | |
_; | |
} | |
constructor() public { |
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 ethToToken(uint256 minTokens, uint256 deadline, address payable _uni) external restricted { | |
Uniswap uni = Uniswap(_uni); | |
uint256 ethBalance = address(this).balance; | |
uint256 tokensBoughtActual = uni.ethToTokenSwapInput.value(ethBalance)({ min_tokens: minTokens, deadline: deadline }); | |
emit UniswapTokenBoughtActual(tokensBoughtActual); | |
} | |
function tokenToEth(uint256 tokensToSell, uint256 minEth, uint256 deadline, address payable _uni) external restricted { | |
Uniswap uni = Uniswap(_uni); | |
uint256 actualEthBought = uni.tokenToEthSwapInput({ tokens_sold: tokensToSell, min_eth: minEth, deadline: deadline }); |
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 kill() external restricted { | |
selfdestruct(EOA); | |
} | |
function approve(ERC20 _token, address payable _uni) external restricted { | |
ERC20 token = ERC20(_token); | |
token.approve(_uni, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF); | |
} | |
function drainToken(ERC20 _token) external restricted { |
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
abstract contract ERC20 { | |
function balanceOf(address account) external virtual view returns (uint256); | |
function transfer(address recipient, uint256 amount) external virtual returns (bool); | |
function approve(address spender, uint tokens) public virtual returns (bool success); | |
} | |
abstract contract Uniswap { | |
function ethToTokenSwapInput(uint256 min_tokens, uint256 deadline) external virtual payable returns (uint256 tokens_bought); | |
function tokenToEthSwapInput(uint256 tokens_sold, uint256 min_eth, uint256 deadline) external virtual returns (uint256 eth_bought); | |
} |
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 React from "react"; | |
import { Client as Styletron } from "styletron-engine-atomic"; | |
import { Provider as StyletronProvider } from "styletron-react"; | |
import { LightTheme, BaseProvider, styled } from "baseui"; | |
const engine = new Styletron(); | |
const Centered = styled("div", { | |
display: "flex", | |
justifyContent: "center", | |
alignItems: "center", |
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 React from "react"; | |
import { BrowserRouter as Router, Route, Switch } from "react-router-dom"; | |
import { Client as Styletron } from "styletron-engine-atomic"; | |
import { Provider as StyletronProvider } from "styletron-react"; | |
import { LightTheme, BaseProvider, styled } from "baseui"; | |
const engine = new Styletron(); | |
const Centered = styled("div", { | |
display: "flex", | |
justifyContent: "center", |
OlderNewer