Skip to content

Instantly share code, notes, and snippets.

View itherunder's full-sized avatar
🏠
Working from home

itherunder

🏠
Working from home
View GitHub Profile
@itherunder
itherunder / read_info_from_file.py
Created December 20, 2021 02:47
Python读取docx, pdf, xlsx
from logging import info
import os, pdfplumber, docx, xlrd
import sys
from win32com import client as wc
def doc2docx(file):
word = wc.Dispatch("Word.Application")
doc = word.Documents.Open(doc_path+'/'+file)
doc.SaveAs(doc_path+'/'+'{}x'.format(file), 12)
doc.Close()
@itherunder
itherunder / get_paper_title_bib_download_url.py
Created December 20, 2021 03:47
通过search_word 在谷歌学术上搜索论文并获取论文标题、bib引用、下载链接以及摘要,目前只搞了论文标题和下载链接
from genericpath import getctime
from urllib import parse
from selenium import webdriver
from webdriver_manager.chrome import ChromeDriverManager
from webdriver_manager.utils import download_file
search_word = 'ethereum smart contract'
query = '+'.join(search_word.split(' '))
url = 'https://scholar.google.com/scholar?hl=en&start=%d&q=%s'
@itherunder
itherunder / call_contract_mint.py
Created December 29, 2021 10:58
使用web3py 自动化调用智能合约脚本,在Polygon上面玩的
from eth_typing.evm import Address
from web3 import Web3
import time
NODE_URL = "YOUR NODE URL(https://admin.moralis.io/speedyNodes获取)"
w3 = Web3(Web3.HTTPProvider(NODE_URL))
vis = {}
with open('vis.txt', 'r') as r:
for l in r:
@itherunder
itherunder / listen_eth_bsc.py
Created December 30, 2021 04:16
监听以太坊和bsc 上面的Transfer 或者Swap 事件的,还能监听特定地址
__author__ = 'itherunder'
'''
https://etherscan.io/tokens?ps=100&p=1,从这里拿的
coins = document.getElementsByClassName('text-primary')
res = []
for (let i = 0; i < 100; i++) {
var name = coins[i].text
var href = coins[i].href
console.log(name, href)
res.push([name, href])
@itherunder
itherunder / newton_sqrt.go
Created December 30, 2021 08:24
牛顿法求sqrt,就是拿表达式去逼近0,然后每次更替的时候就需要除以表达式的导数
package main
import (
"fmt"
"math"
)
func Sqrt(x float64) float64 {
var z float64 = 1
for math.Abs(z*z-x) > 0.0001 {
@itherunder
itherunder / fibonacci.go
Created December 30, 2021 09:36
just learn,golang 使用闭包实现一个fibonacci 函数
package main
import "fmt"
// 返回一个“返回int的函数”
func fibonacci() func() int {
a, b := 1, 0
return func() int {
a, b = a+b, a
return b
@itherunder
itherunder / sig.txt
Created February 22, 2022 04:32
tezos profile signature
I am attesting that this GitHub handle itherunder is linked to the Tezos account tz1cBabDyuEqavNuRwoFoen5fH5Lmy8vufak for tzprofiles
sig:edsigteN16Zy81qXFw3ECVeDjw3HXKUzm8vJk5MUCdNrFhVR8ogLTtDiyvAn4hKwdMJ5ydSqm8TnUPaTw15jP9BjGqNfu96PTHg
@itherunder
itherunder / config.json
Last active March 6, 2022 08:35
get all holders of a token `fromBlock` to `toBlock`, see more details in readme.md
{
"provider": "https://mainnet.infura.io/v3/your_token",
"tokenAddress": "0x7A58c0Be72BE218B41C608b7Fe7C5bB630736C71",
"fromBlock": "0",
"toBlock": "latest",
"abi": []
}
@itherunder
itherunder / getContracts.py
Last active April 12, 2022 07:29
获取以太坊上开源的代码
import time, requests, json, os
from threading import Thread, Lock
__author__ = "Zhou.Liao"
if not os.path.exists('./gettedAddress'):
fp = open('./gettedAddress', 'w')
fp.close()
if not os.path.exists('bytecodes/'):
os.system('mkdir bytecodes/')
@itherunder
itherunder / readme.md
Last active April 12, 2022 04:22
change .obj color by program!

readme

  1. 将脚本文件放到obj,png同目录下即可,python3 script.py,命令行中的输出为obj中平面的数量,与1.中的decimal设置有关

结果图(lenOfRGBs == 50):

image image

  1. 可调参数,懒得写在命令行了,直接在py文件改

a. decimal(Line 32),越小,平面数量越少