Skip to content

Instantly share code, notes, and snippets.

View pyk's full-sized avatar
🌐

pyk pyk

🌐
View GitHub Profile
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.11;
pragma experimental ABIEncoderV2;
import "lib/ds-test/src/test.sol";
import { IERC20 } from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import { FuseLeveragedToken } from "../FuseLeveragedToken.sol";
import { HEVM } from "./HEVM.sol";
import { gohm, fgohm, usdc, fusdc, sushiRouter } from "./Arbitrum.sol";
@pyk
pyk / SushiFlashSwap.sol
Created March 23, 2022 13:04
Sushi FlashSwap test
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.11;
pragma experimental ABIEncoderV2;
import "lib/ds-test/src/test.sol";
import { IUniswapV2Factory } from "../interfaces/IUniswapV2Factory.sol";
import { IUniswapV2Router02 } from "../interfaces/IUniswapV2Router02.sol";
import { IUniswapV2Pair } from "../interfaces/IUniswapV2Pair.sol";
import { IERC20 } from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
@pyk
pyk / Windows 10 Fix docker-credential-desktop not installed or not available in PATH.md
Created April 24, 2020 13:28
Windows 10 Fix docker-credential-desktop not installed or not available in PATH

When try to run AWS Lambda locally on windows:

sam local invoke

I got the following error:

Invoking app.lambda_handler (python3.8)
@pyk
pyk / starship.toml
Created December 24, 2021 18:00
pyk's starship config
[character]
success_symbol = "[✦](bold green)"
[directory]
style = "bold green"
[git_branch]
symbol = "🌱 "
style = "bold green"
(function() {
var width = 320;
var height = 0;
var streaming = false;
var video = null;
var canvas = null;
var photo = null;
var startbutton = null;
@pyk
pyk / .ethrc.sh
Created September 18, 2021 18:08 — forked from mds1/.ethrc.sh
# Ethereum helper methods
# source this in your .bashrc or .zshrc file with `. ~/.ethrc`
# --- Token addresses ---
aave=0x7Fc66500c84A76Ad7e9c93437bFc5Ac33E2DDaE9
comp=0xc00e94Cb662C3520282E6f5717214004A7f26888
crv=0xD533a949740bb3306d119CC777fa900bA034cd52
dai=0x6B175474E89094C44Da98b954EedeAC495271d0F
gtc=0xDe30da39c46104798bB5aA3fe8B9e0e1F348163F
mkr=0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2
@pyk
pyk / active-record-migration-expert.md
Last active August 2, 2021 09:20
become active record migration expert (Rails 4.0.2)

become active record migration expert (Rails 4.0.2)

workflow:

create model

$ rails g model NameOfModel
    invoke  active_record
    create    db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
@pyk
pyk / goprompt.sh
Created May 23, 2014 15:05
How to: display Go lang version on Bash prompt
# add this function on your .bashrc file to echoed Go version
function go_version {
version=$(go version)
regex="(go[0-9].[0-9].[0-9])"
if [[ $version =~ $regex ]]; then
echo ${BASH_REMATCH[1]}
fi
}
# and add to your PS1, for example
@pyk
pyk / installing postgresql 9.3.2 on ubuntu 12.04.md
Created January 3, 2014 18:05
installing postgresql 9.3.2 on ubuntu 12.04 . with error fix: ummet dependencies

installing postgresql 9.3.2 on ubuntu 12.04

$ echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
$ wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install postgresql-9.3 postgresql-contrib-9.3

you should succesfully installing postgresql 9.3.2 on your machine.

@pyk
pyk / EDVR_test_video_without_gt.py
Created September 13, 2020 13:13
Apply pre-trained EDVR model without the ground truth
class VideoTestDatasetWithoutGT(data.Dataset):
"""Video test dataset.
More generally, it supports testing dataset with following structures:
dataroot
├── subfolder1
├── frame000
├── frame001
├── ...
├── subfolder1
├── frame000