Skip to content

Instantly share code, notes, and snippets.

View VeryCB's full-sized avatar

VeryCB VeryCB

View GitHub Profile
View TNL_minter_CoolCat_holder.js
import ethers from 'ethers'
import _ from 'underscore'
import dotenv from 'dotenv'
dotenv.config()
const delay = (time) => {
return new Promise((resolve) => setTimeout(resolve, time))
}
View PermissionControl.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol";
/**
* @dev ASM Genome Mining - PermissionControl contract
*/
@VeryCB
VeryCB / pev_new.py
Created October 4, 2020 15:06
Monitor PEV prices in different pools on sSwap
View pev_new.py
import requests
PEARL_PEV_CONTRACT_ADDRESS = 'TYCmYzi5c2X5FKhUBgD1FtgRCho8aiKd3j'
TAI_PEV_CONTRACT_ADDRESS = 'TNEgrJkG5S1t8p1xqFfqat3LsZaBbKJyVD'
SAN_PEV_CONTRACT_ADDRESS = 'TL5WhUrxfdi8G5WTuDDEB6Ai4GthiZ1jLK'
USDT_PEV_CONTRACT_ADDRESS = 'TSitoyPGTMb6pR3WrWM2jEtCis6b6QJcF1'
USDT_CONTRACT_ADDRESS = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t'
PEV_CONTRACT_ADDRESS = 'TQQhxCErnhCQ4XG2fAqP2jG6ZwH5MBFv7X'
PEARL_CONTRACT_ADDRESS = 'TGbu32VEGpS4kDmjrmn5ZZJgUyHQiaweoq'
View cola.py
import requests
COLA_TRX_CONTRACT_ADDRESS = 'TKH4HPMPjxR2Q93XBVfQrpGiBpyjBwBG6P'
USDT_TRX_CONTRACT_ADDRESS = 'TQn9Y2khEsLJW1ChVWFMSMeRDow5KcbLSE'
COLA_CONTRACT_ADDRESS = 'TSNWgunSeGUQqBKK4bM31iLw3bn9SBWWTG'
USDT_CONTRACT_ADDRESS = 'TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t'
def fetch_token_balances(token_addresses, pair_address):
@VeryCB
VeryCB / pev.py
Last active December 23, 2020 13:53
Monitor PEV prices in different pools
View pev.py
import requests
PEV_CONTRACT_ADDRESS = 'TUJrRXdbkHbKEVT8sRs9xdfsaEWe1XHEMC'
PEARL_CONTRACT_ADDRESS = 'TJydMBnDJUYccpBPbLqn6oBxaiaCAhxcFd'
TAI_CONTRACT_ADDRESS = 'TSdDVvLdt3Vu9TqyEH5m273pJxbpJoqAwR'
SAN_CONTRACT_ADDRESS = 'TUU9vEMbEndY4VBm6C6T35EHByvkaMQypc'
TOKEN_SYMBOLS = ['USDT', 'PEARL', 'TAI', 'SAN']
View press.one
{"sig":"67c14a986845f909cc3d62f720522ec28599acb04019c1474e9041616568bc1245b6d8ee5ec2e197c7a902c9b774d83dc0f758307e4cc737c59e248e93bb85a21","msghash":"0348391951533f74f4bcd46cad09a5b30e91e241e6e40eb7a0930039df4a1af4"}
View switch-hosts
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import shutil
from optparse import OptionParser
config_path = '/etc/switch-host/'
default_backup_file = 'default-hosts'
View youku_open_app.js
var openApp = function() {
var a = xparamsString.sharefrom;
if (a) {
var b = "",
c = videoIdEn,
d = "";
if ("pkios" == a || "pkandroid" == a) null != window.navigator.userAgent.match(/android/i) && (b = "paike://vid/" + c), null != window.navigator.userAgent.match(/iphone|ipad/i) && (b = "paike://type=vid&value=" + c), d = "banner=pk";
if ("android" == a || "ipad" == a || "iphone" == a) {
var e = getCookie("__ysuid") || "";
null != window.navigator.userAgent.match(/iphone/i) && (b = "youku://play?vid=" + c + "&source=mplaypage&cookieid=" + e);
@VeryCB
VeryCB / qq.py
Created May 30, 2014 02:33
insert spaces between Chinese characters and copy to clipboard
View qq.py
import os
while True:
join_by = ' ' * 3
content = raw_input('say something: ')
content_list = [content[i:i+3] for i in range(0, len(content), 3)]
output = join_by.join(content_list)
os.system("echo '%s' | pbcopy" % output)
print 'copied "%s" to clipboard, now you can paste!' % output
@VeryCB
VeryCB / clean-git-branch
Last active October 3, 2020 07:59
This script helps removing Git branches. Run it from a git repo dir. It will open the Git branches list in your favorite editor. Delete some branches from the list. Save and close the file. The script applies the changes to the repo.
View clean-git-branch
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# This script helps removing Git branches.
# Run it from a git repo dir. It will open the Git branches list
# in your favorite editor. Delete some branches from the list.
# Save and close the file. The script applies the changes to the repo.
from subprocess import call, Popen, PIPE
from os import getenv