Skip to content

Instantly share code, notes, and snippets.

View githubhjs's full-sized avatar
🎯
Focusing

Chih-Hsueh "Josh" Huang githubhjs

🎯
Focusing
View GitHub Profile
@githubhjs
githubhjs / llm-wiki.md
Created April 5, 2026 13:01 — forked from karpathy/llm-wiki.md
llm-wiki

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@githubhjs
githubhjs / MagicInstall.bat
Created January 30, 2026 15:43 — forked from TaiNing1237/MagicInstall.bat
Office 2024 MagicInstall Script
@echo off
setlocal
:: =========================================================
:: 重要:切換到腳本所在的資料夾
:: 這能解決 "找不到 xml" 或路徑錯誤的問題
:: =========================================================
cd /d "%~dp0"
:MENU
CLS
@githubhjs
githubhjs / rm-wrapper.sh
Last active December 5, 2025 08:17
(繁體中文) 你的 NFS .nfsXXXX 殘留檔案是經典痛點。因為有 process 還 hold 著 FD,所以 rm 會直接吐你一句 device or resource busy。最好的策略,就是自動 fallback → 改用 mv 把東西丟去一個「墓地目錄」,並附上 UUID,不阻塞你的 flow。 下面給你一個可直接放在 $PATH 裡的 rm-wrapper.sh。設計理念是: 先試著正常 rm -rf。 如果遇到 device or resource busy → 自動改名成 .deleted-by-moving.<UUID>。 顯示訊息方便 debug。
#!/usr/bin/env bash
set -e
if [ $# -eq 0 ]; then
echo "Usage: rm-wrapper.sh <target1> <target2> ..."
exit 1
fi
for target in "$@"; do
@githubhjs
githubhjs / 0.README.md
Created December 3, 2025 04:41 — forked from intellectronica/0.README.md
Filez - Ad-Hoc File Sharing Using GitHub Pages

GitHub Pages File-Sharing

If you sometimes find yourself needing to share a file over HTTP, there are not many file-sharing solutions you can use.

This action works by publishing files via GitHub Pages behind an obscure prefix path. It updates the repository README with the URLs, so that you have links to the published files.

You can keep the repository secret, and the files are public but semi-secret, so you can share them without concern that other files will be discovered.

@githubhjs
githubhjs / 0.README.md
Created December 3, 2025 04:40 — forked from intellectronica/0.README.md
Invoice Generator SKILL (Example)

Invoice Generator SKILL (Example)

Get invoice.zip

Note: This is an example skill for educational purposes. It demonstrates how to create a skill that generates PDF documents from templates. You should use it to learn how to build your own invoice or document generation skills, not as a production invoicing solution.

Use this skill to generate professional PDF invoices by collecting invoice details interactively and processing them through a Word document template. It handles seller/buyer information, line items, VAT calculations, and payment terms.

Works with Claude Code locally (extract to ~/.claude/skills/), with Skillz for any agent, or on the Claude web app.

@githubhjs
githubhjs / 0.README.md
Created December 3, 2025 04:39 — forked from intellectronica/0.README.md
SKILL: Fetch YouTube Transcript

YouTube Transcript SKILL

Get youtube-transcript.zip

Use this skill to fetch the transcript of a YouTube video, with or without timestamps.

Use this skill with Claude (by extracting it to .claude/skills/) or with any other agent using Skillz.

Note: This skill is unlikely to run successfully on the Claude web app, since access to YouTube is blocked. Use it with Claude Code or other local agents.

@githubhjs
githubhjs / git-teleporter.sh
Created November 20, 2025 05:44
git-teleporter.sh:讓你在任何目錄下,用「檔案路徑」當參數執行 git 指令。
#!/bin/bash
# -----------------------------------------------------------------------------
# git-teleporter
#
# 功能:
# 讓你在任何目錄下,用「檔案路徑」當參數執行 git 指令。
# 腳本會自動偵測參數裡哪一個是實際存在的路徑,cd 到該檔案所在的目錄,
# 然後在那個目錄裡執行指定的 git 指令。
#
@githubhjs
githubhjs / nfs-watch.sh
Last active September 18, 2025 02:19
② 低權限「一鍵巡檢」面板 把下面存成 nfs-watch.sh(單檔自畫面迴圈),一般使用者可直接跑:
#!/usr/bin/env bash
# nfs-watch.sh -- user-mode NFS watch panel (no sudo)
INT=${1:-2} # 重新整理秒數,預設 2s
have_nfsiostat=0
command -v nfsiostat >/dev/null 2>&1 && have_nfsiostat=1
while true; do
clear
echo "NFS Watch | host=$(hostname) time=$(date '+%F %T') refresh=${INT}s"
@githubhjs
githubhjs / nfs-mountstats-lite.sh
Last active September 18, 2025 02:18
① mountstats 解析器(無需 sudo) 功能:取樣兩次 /proc/self/mountstats(或用 nfsiostat 若系統有),輸出每個 NFS 掛載點的 ops/s(讀/寫)、avg RTT / avg exe、rpc bklog、以及「初步瓶頸判定」。 把下面存成 nfs-mountstats-lite.sh,給執行權限(不需 sudo):
#!/usr/bin/env bash
# nfs-mountstats-lite.sh -- user-space NFS health snapshot
# 用法:./nfs-mountstats-lite.sh [-i interval_sec] [-c samples]
# 預設 interval=2, samples=3(總觀察 ~4 秒)
set -euo pipefail
INT=2; CNT=3
while getopts "i:c:" o; do
case "$o" in
i) INT="$OPTARG";;
@githubhjs
githubhjs / pinmux_x_path_checker.sv
Created September 17, 2025 11:08
pinmux_x_path_checker systemverilog
// pragma translate_off
// Checker module: verifies that when pinmux select is high, any X value
// from the module output must propagate to the corresponding GPIO within
// a given cycle latency window. Otherwise, it triggers a fatal error.
module pinmux_x_path_checker #(
parameter int MIN_LAT = 1, // Minimum cycle delay allowed
parameter int MAX_LAT = 8, // Maximum cycle delay allowed
parameter int WIDTH = 1 // Data width (1 = single bit)
)(
input logic clk,