Skip to content

Instantly share code, notes, and snippets.

View GrayXu's full-sized avatar
💭
$vibe_coding --yolo

Guanglei Xu GrayXu

💭
$vibe_coding --yolo
View GitHub Profile
@GrayXu
GrayXu / script.js
Created January 16, 2026 09:07
油猴脚本 Google Scholar 拦截自动跳转 (Bypass Google Sorry)
// ==UserScript==
// @name Google Scholar 拦截自动跳转 (Bypass Google Sorry)
// @namespace http://tampermonkey.net/
// @version 1.0
// @description 当 Google Scholar 提示流量异常时,如果 URL 中包含最终跳转目标,自动提取并跳转,不再尝试验证 CAPTCHA。
// @author GrayXu
// @match https://www.google.com/sorry/index*
// @match https://ipv4.google.com/sorry/index*
// @match https://google.com/sorry/index*
// @run-at document-start
@GrayXu
GrayXu / HUST Phd Thesis.csl
Created December 31, 2025 12:21
HUST Phd Thesis Zotero csl
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" sort-separator=" " demote-non-dropping-particle="never" initialize-with=". " initialize-with-hyphen="false" page-range-format="expanded" default-locale="zh-CN">
<info>
<title>华中科技大学(理工科)v1.1</title>
<id>https://zotero-chinese.com/styles/华中科技大学(理工科)v1.1</id>
<link href="https://zotero-chinese.com/styles/华中科技大学(理工科)v1.1" rel="self"/>
<link href="https://zotero-chinese.com/styles/GB-T-7714—2015(顺序编码,双语)" rel="template"/>
<link href="http://gs.hust.edu.cn/info/1041/5462.htm" rel="documentation"/>
<author>
<name>韩小土</name>
@GrayXu
GrayXu / run.sh
Created July 13, 2025 12:32
MacOS Chrome 138 以上版本恢复支持 Manifest V2 插件 (运行后重启浏览器)
sudo tee /Library/Managed\ Preferences/com.google.Chrome.plist >/dev/null <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ExtensionManifestV2Availability</key>
<integer>2</integer>
</dict>
</plist>
@GrayXu
GrayXu / price.json
Last active August 8, 2024 07:47
personal price.json for one-hub
[
{
"model": "llama3-70b-instruct",
"type": "tokens",
"channel_type": 17,
"input": 0,
"output": 0
},
{
"model": "meta-llama/Meta-Llama-3-8B-Instruct",
@GrayXu
GrayXu / num2uid.py
Created September 7, 2023 10:53
num2uid.py
import struct
num = 1111111111 # only for test
reverted = struct.pack('>L', num)
asChar = list(reverted)
result = asChar[0] ^ asChar[1] ^ asChar[2] ^ asChar[3]
uidr = hex(num)[2:]
assert(len(uidr)==8)
uid = uidr[6:8]+uidr[4:6]+uidr[2:4]+uidr[0:2]
@GrayXu
GrayXu / OpenAI_GPT_API.md
Last active January 21, 2026 10:01
OpenAI GPT API for Zotero-PDF-Translate

This gist is for zotero-pdf-translate.
Please ask your question at repo issues for faster responses
请在仓库issue进行提问以获得更快的回复


  1. Register an account on the OpenAI website.
  2. After successful registration, go to API keys and create an key, which looks like sk-XXXXXX.
  3. Fill in the url with the complete URL, such as https://api.openai.com/v1/chat/completions.
  4. For the model, enter a model name such as gpt-4o.
@GrayXu
GrayXu / neteasemusic_ipcidr.txt
Created February 16, 2023 10:34
neteasemusic_ipcidr for clash-rules
payload:
- '39.105.63.80/32'
- '45.254.48.1/32'
- '47.100.127.239/32'
- '59.111.21.14/31'
- '59.111.179.214/32'
- '59.111.181.38/32'
- '59.111.181.60/32'
- '59.111.160.195/32'
- '59.111.160.197/32'
@GrayXu
GrayXu / neteasemusic_domain.txt
Created February 16, 2023 10:33
neteasemusic_domain for clash-rules
payload:
- '+.163yun.com'
- '+.music.163.com'
- '+.interface.music.163.com'
- '+.clientlog.music.163.com'
- '+.music.126.net'
- '+.api.iplay.163.com'
- '+.apm.music.163.com'
- '+.apm3.music.163.com'
- '+.interface.music.163.com'
@GrayXu
GrayXu / myjm.csl
Created December 24, 2022 13:11
Zotero reference GB/T style for dblp BibTeX records
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.1mlz1" demote-non-dropping-particle="sort-only" default-locale="zh-CN">
<info>
<title>MYJM</title>
<id>MYJM</id>
<link href="http://juris-m.github.io/jm-styles/jm-chinese-gb7714-2005-numeric" rel="self"/>
<link href="http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/19.pdf" rel="documentation"/>
<author>
<name>heromyth</name>
<email>[email protected]</email>
#!/bin/bash
# author: louwrentius
# source: http://louwrentius.com/zfs-on-linux-monitor-cache-hit-ratio.html
INTERVAL="$1"
if [ -z $INTERVAL ]
then
INTERVAL=5