Skip to content

Instantly share code, notes, and snippets.

View hereisderek's full-sized avatar
😐
- =

Derek Zhu hereisderek

😐
- =
View GitHub Profile
@hereisderek
hereisderek / README.md
Last active October 12, 2026 06:13
Claude Code status line: git info, cache hit and expiry, 5h/7d limits, context, cost. One-line install.

Claude Code status line

A status line for Claude Code. Needs jq. git is optional.

days-that-matter  |  ⎇ feat/login  |  worktree login  |  +2 ~1 ?3 ↑1  |  PR #12 pending  |  Opus 5.5
cache 94% avg 94% ⏱ 47:36  |  5h ▮▮▮▮▮▮▮▮▮ 2% ↻4h36m  |  7d ▮▮▮▮▮▮▮▮▮ 76% ↻13h56m  |  ↑68.6k ↓9.6k ◆1.0M  |  $206.51

Everything fits on one line when the terminal is wide enough; otherwise it splits into the two rows below.

@hereisderek
hereisderek / install_mitmproxy.sh
Last active August 21, 2026 00:31
mitmproxy installer script
#!/bin/sh
# Exit immediately if a command exits with a non-zero status
set -e
UPDATE_ONLY=0
AUTO_UPDATE=0
INSTALL_SERVICES=""
ROOT_DIR=""
show_help() {
@hereisderek
hereisderek / .gitignore
Created March 10, 2026 10:12
gitignore
# =========================
# Operating System Files
# =========================
# macOS
.DS_Store
.AppleDouble
.LSOverride
._*
.DocumentRevisions-V100
@hereisderek
hereisderek / db.json
Created February 8, 2026 11:26
donggua.db.json
{
"sites": [
{ "key": "dyttzy", "name": "电影天堂", "type": 1, "api": "http://caiji.dyttzyapi.com/api.php/provide/vod" },
{ "key": "bfzy", "name": "暴风资源", "type": 1, "api": "https://bfzyapi.com/api.php/provide/vod" },
{ "key": "tyyszy", "name": "天涯资源", "type": 1, "api": "https://tyyszy.com/api.php/provide/vod" },
{ "key": "ffzy", "name": "非凡影视", "type": 1, "api": "https://api.ffzyapi.com/api.php/provide/vod" },
{ "key": "zy360", "name": "360资源", "type": 1, "api": "https://360zy.com/api.php/provide/vod" },
{ "key": "maotaizy", "name": "茅台资源", "type": 1, "api": "https://caiji.maotaizy.cc/api.php/provide/vod" },
{ "key": "wolong", "name": "卧龙资源", "type": 1, "api": "https://wolongzyw.com/api.php/provide/vod" },
{ "key": "jisu", "name": "极速资源", "type": 1, "api": "https://jszyapi.com/api.php/provide/vod" },
@hereisderek
hereisderek / DiscordWithVencord.ps1
Last active December 30, 2025 13:39
This PowerShell script is designed to automate the maintenance of Vencord
# ============================================
# Discord + Vencord Launcher (Universal)
# ============================================
#
# execute the following in powershell:
# iex (iwr "https://gist.githubusercontent.com/hereisderek/ab09258af0d67b2be1dfd9572cd8fa3f/raw/DiscordWithVencord.ps1" -UseBasicParsing).Content
# or in run:
# powershell.exe -ExecutionPolicy Bypass -WindowStyle Hidden -NoProfile -Command "iwr 'https://gist.githubusercontent.com/hereisderek/ab09258af0d67b2be1dfd9572cd8fa3f/raw/DiscordWithVencord.ps1' -UseBasicParsing | iex"
$ErrorActionPreference = "SilentlyContinue"
@hereisderek
hereisderek / README.md
Last active October 26, 2026 05:22
asciinema auto record shell

term-record (Asciinema Terminal Session Recorder)

A robust, lightweight wrapper around asciinema to record interactive shell sessions, auto-save casts safely on session exit or terminal tab close, and prevent terminal breakages in IDEs and AI coding tools (Orca, VS Code, Cursor, Claude Code). Fully compatible with macOS and Linux.

One-Liner Install & Update

Run this command in your terminal (macOS / Linux):

mkdir -p ~/.config/asciinema && curl -fsSL https://gist.githubusercontent.com/hereisderek/8f41efc72e5b2f60b1089041bb1fc388/raw/auto_asciinema.sh -o ~/.config/asciinema/auto_asciinema.sh && bash ~/.config/asciinema/auto_asciinema.sh --install
@hereisderek
hereisderek / rename_statements.sh
Created July 20, 2025 02:54
script to automatically rename my bills to a more human readable formate, currently support statements pdf from watercare for water, genesis for electricity/gas(NZ).
#!/bin/bash
# Determine which date command to use
if [[ "$(uname)" == "Darwin" ]]; then
if command -v gdate >/dev/null 2>&1; then
DATE_CMD="gdate"
else
echo "Error: macOS detected but 'gdate' (GNU date) not found."
echo "Please install it using: brew install coreutils"
exit 1
@hereisderek
hereisderek / combine.sh
Last active April 14, 2023 23:42
script to combine xiaomi camera recordings
#!/bin/bash
## to get the latest version of this script, see: https://gist.githubusercontent.com/hereisderek/6a2ca0afcc957858d8a465392212edb8/raw/combine.sh
## to run this script as a cron task:
## * * * * * /usr/bin/wget -qO- https://gist.githubusercontent.com/hereisderek/6a2ca0afcc957858d8a465392212edb8/raw/combine.sh | /bin/bash -s /mnt/xiaomi/xiaomi_camera_videos /mnt/xiaomi/xiaomi_camera_videos/output >/dev/null 2>&1
function example_usage {
export your_healthcheck_url="https://hc-ping.com/37174a73-****-****" && wget "${your_healthcheck_url}/start" -T 10 -t 5 -O /dev/null && wget --no-cache 'https://gist.githubusercontent.com/hereisderek/6a2ca0afcc957858d8a465392212edb8/raw/combine.sh' -qO /tmp/combine.sh && chmod a+x /tmp/combine.sh && /tmp/combine.sh && wget "${your_healthcheck_url}" -T 10 -t 5 -O /dev/null
}
@hereisderek
hereisderek / zram.sh
Created October 27, 2022 02:53
create ramdisk on startup
#!/bin/bash
### BEGIN INIT INFO
# Provides: zram
# Required-Start: $all
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: your description here
### END INIT INFO
#
# rclone's log
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=<nil>
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/: Lookup: name="mi_camera"
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/: >Lookup: node=Video/Others/mi_camera/, err=<nil>
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: Attr:
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: >Attr: attr=valid=1s ino=0 size=0 mode=drwxrwxrwx, err=<nil>
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: Lookup: name="netease_.swp"
Jun 28 16:12:36 pi2 rclone[499]: Video/Others/mi_camera/: >Lookup: node=Video/Others/mi_camera/netease_.swp, err=<nil>