Skip to content

Instantly share code, notes, and snippets.

View zhangheli's full-sized avatar
🌴
On vacation

zhangheli1997 zhangheli

🌴
On vacation
View GitHub Profile
@zhangheli
zhangheli / tampermonkey_youdao_add_wordbook.js
Last active March 4, 2024 07:46
添加单词到有道词典- 生词本
// ==UserScript==
// @name Youdao Dictionary Add Word to Wordbook
// @namespace http://tampermonkey.net/
// @version 0.2
// @description Add selected word to Youdao Dictionary wordbook
// @author You
// @match https://dict.youdao.com/*
// @grant none
// ==/UserScript==
@zhangheli
zhangheli / tampermonkey-clear-session.js
Last active February 22, 2024 08:28
tampermonkey - 豆包 - 清理上下文
// ==UserScript==
// @name Doubao Custom Shortcut Script
// @namespace http://www.doubao.com
// @version 0.1
// @description Listen for custom keyboard shortcuts on doubao.com
// @author Your Name
// @match https://www.doubao.com/*
// @updateUrl https://gist.githubusercontent.com/zhangheli/61cdce57a1bb586b3ed7315e6128f6e1/raw/cebc96453061e3588e8a558dba32268b4f3e4acb/tampermonkey-clear-session.js
// @grant none
// ==/UserScript==
@zhangheli
zhangheli / check_size.py
Created January 13, 2024 04:37
check disk directory size
#!/usr/bin/env python3
import os
import sys
def get_dir_size(path):
total_size = 0
for dirpath, dirnames, filenames in os.walk(path):
for f in filenames:
fp = os.path.join(dirpath, f)
if os.path.exists(fp):
@zhangheli
zhangheli / pplx.js
Last active January 13, 2024 03:15
pplx_activate.js
// ==UserScript==
// @name Perplexity Timer
// @namespace http://tampermonkey.net/
// @version 0.0.1
// @description Perplexity timer and request sender
// @author You
// @match https://*.perplexity.ai/
// @grant none
// @updateURL https://gist.githubusercontent.com/zhangheli/7e4e9f276404b12d2ce6cab0e149f47f/raw/pplx.js
// @downloadURL https://gist.githubusercontent.com/zhangheli/7e4e9f276404b12d2ce6cab0e149f47f/raw/pplx.js

Stratum挖矿协议: 该协议是由SlushPool制定的,请参阅其官方文档:https://slushpool.com/help/manual/stratum-protocol

以下所有报文均使用\n做为行结束符。


矿机订阅:

{"id": 1, "method": "mining.subscribe", "params": []}
@zhangheli
zhangheli / dydns.sh
Created February 8, 2017 13:09
dnspod
_IP=(ip a | grep -A 2 eth0 | perl -ne '/inet (\S+)\// && print $1')
_TOKEN=""
curl -X POST -H "Content-Type: application/x-www-form-urlencoded" -H "Cache-Control: no-cache" -d 'domain=psched.pw&sub_domain=intranet&value='$_IP'&format=json&record_id=274750567&record_line=默认&login_token='$_TOKEN "https://dnsapi.cn/Record.Ddns"
@zhangheli
zhangheli / bsort.py
Last active November 1, 2015 16:44
帮助了解快速排序
import random
@zhangheli
zhangheli / upload.py
Last active August 29, 2015 14:20
iqiyi_openapi
# encoding: utf-8
import os
import sys
import logging
import requests
from StringIO import StringIO
s = requests.Session()
access_token = os.environ["access_token"]
cookie = os.environ["cookie"]
{{google_ip}} www.google.com
{{google_ip}} www.google.com.hk
{{google_ip}} google.com
{{google_ip}} chrome.google.com
{{google_ip}} scholar.google.com
{{google_ip}} groups.google.com
{{google_ip}} plus.google.com
{{google_ip}} accounts.google.com
{{google_ip}} oauth.google.com
{{google_ip}} mail.google.com
i(){
apt-get install -y $*
}
r(){
# if memory is not enough , can run as `bash -c`
screen -dm $*
}
i python-pip screen