Skip to content

Instantly share code, notes, and snippets.

@TTTPOB
TTTPOB / sub2api-quota.user.js
Created October 30, 2026 12:40
Sub2API 账号管理页限额条:为带 codex_* 额度字段的 OpenAI Key 账号补上 5h/7d 进度条(只读,不改账号)
// ==UserScript==
// @name Sub2API 限额条(OpenAI Key 账号)
// @namespace tpob.sub2api.usage
// @version 1.0.0
// @description 在账号管理页为带 codex_* 额度字段的 OpenAI Key 账号补上 5h / 7d 额度条(外观对齐原生)
// @author TTTPOB
// @match https://klaude.tpob.io/*
// @run-at document-idle
// @grant none
// ==/UserScript==
@TTTPOB
TTTPOB / README.md
Created September 28, 2026 09:32
DSH WebUI 0.1.7-rc.2: remote settings persistence userscript (configure example domains before use)

DSH WebUI 远程设置持久化(Tampermonkey)

针对 DSH 0.1.7-rc.2 的个人使用补丁:将前端 connection.isLoopback 设为 true,让设置使用 host 而不是 memory 持久化模式。

安装

  1. 在 Tampermonkey 新建脚本,粘贴本 Gist 的用户脚本。
  2. **把两行 @match 中的 dsh-one.example.com 和 dsh-two.example.com 换成自己的 DSH 域名。**只有一个站点就删除另一行,不要改成匹配所有网站。
  3. 保留 @run-at document-start 和 @grant none,保存并刷新目标页面。
@TTTPOB
TTTPOB / patch-subagent.sh
Last active September 16, 2026 13:30
patch dsh subagent tool messages
#!/usr/bin/env bash
set -euo pipefail
PKG_LINK="${DSH_HOME:-$HOME/.dsh}/profiles/node_modules/@deepseek-ai/dsh-subagent"
OLD1='Before you finish, send your result to that agent with '
OLD2=' }). The parent shares '
OLD3='your workspace but does not automatically receive your transcript, tool output, or reasoning. Send '
OLD4='earlier messages as well when a finding changes what the parent should do next; sending a message '
OLD5='does not end your turn.'
@TTTPOB
TTTPOB / codex-install.sh
Last active January 19, 2026 02:55
old style codex management script. ai genereated but verified. official npm install way bundled all platform binaries, i don't like it.
#!/usr/bin/env bash
set -euo pipefail
# --- Constants & Globals ---
REPO="openai/codex"
API_URL="https://api.github.com/repos/${REPO}/releases/latest"
BIN_NAME="codex"
STATE_DIR="${XDG_STATE_HOME:-$HOME/.local/state}/codex-install"
STATE_FILE="${STATE_DIR}/state.json"
@TTTPOB
TTTPOB / compress_image.rs
Created November 15, 2024 15:05
chatgpt generated code for drag & drop to compress image file (i use it for storing receipt in quertzy). modifed for correctly running
#![windows_subsystem = "windows"]
use image::codecs::jpeg::JpegEncoder;
use image::GenericImageView;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
fn main() {
// Collect arguments passed to the executable (paths of the dropped files)
@TTTPOB
TTTPOB / restart_snipaste.vbs
Created July 8, 2024 03:40
restart snipaste, useful when you swtich between screen configs
Set objShell = CreateObject("Shell.Application")
' Kill snipaste.exe
objShell.ShellExecute "cmd.exe", "/c taskkill /f /im snipaste.exe", "", "runas", 0
' Start snipaste.exe, adjust the path as necessary
objShell.ShellExecute "Snipaste.exe", "", ""
@TTTPOB
TTTPOB / qr-send.py
Created July 6, 2024 13:50
send a file through terminal qrcode
#!/usr/bin/env python
import argparse
import base64
import hashlib
import json
import math
import os
import struct
import time
@TTTPOB
TTTPOB / pam.py
Created April 28, 2024 08:45
mark pam
#!/usr/bin/env python3
import argparse
import re
from pyfaidx import Fasta
mainchr_re = re.compile(r"chr[0-9XY]{1,2}$")
pam_re = re.compile(r"(?=(.GG))")
@TTTPOB
TTTPOB / reveal-nature-journals.user.js
Last active April 17, 2024 02:03
reveal nature journal names in google search results
// ==UserScript==
// @name Nature Article Journal Modifier for Google Search
// @namespace http://tampermonkey.net/
// @version 1.3
// @description Modify Nature article titles in Google Search results to display their journal names, using Fetch API
// @author tttpob
// @match https://www.google.com/search?*
// @grant none
// ==/UserScript==
@TTTPOB
TTTPOB / script.js
Last active March 9, 2024 09:29
render latex equations in claude chat
// ==UserScript==
// @name Claude Equation Renderer
// @namespace http://tampermonkey.net/
// @author tpob
// @downloadURL https://gist.github.com/TTTPOB/84ea9ece3ec640414416649fae09ff04/raw/script.js
// @updateURL https://gist.github.com/TTTPOB/84ea9ece3ec640414416649fae09ff04/raw/script.js
// @version 0.0.2
// @description Renders LaTeX equations in claude
// @match https://claude.ai/chat/*
// @grant none