Skip to content

Instantly share code, notes, and snippets.

@sidkang
sidkang / cursor-mode.ts
Created August 17, 2026 12:21
hide cursor
import { CustomEditor, type ExtensionAPI } from "@earendil-works/pi-coding-agent";
import { CURSOR_MARKER } from "@earendil-works/pi-tui";
export { CURSOR_MARKER };
const LEADING_SGR = /^\x1b\[([0-9;]*)m/;
const SGR = /\x1b\[([0-9;]*)m/g;
function sgrControls(raw: string): { rawValues: string[]; controls: Array<[number, number]> } {
const rawValues = raw === "" ? [""] : raw.split(";");
@sidkang
sidkang / codex-stats-tps-14d.svg
Last active July 20, 2026 13:16
Public Codex usage-meter speed charts
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sidkang
sidkang / prd.md
Created June 30, 2026 16:57 — forked from ninehills/prd.md
vibe-coding 对比(GLM-5.2 vs GPT-5.5)

企业级 MCP Gateway 平台 PRD

1. 产品定位

企业级 MCP Gateway 平台用于统一管理、发布、安装和调用企业内部的 MCP、Skills、Plugins

平台提供:

  • 控制面
  • MCP Registry
@sidkang
sidkang / usage.json
Last active August 24, 2026 06:40
llm-usage
{
"aad": "created_at",
"alg": "AES-256-GCM",
"ciphertext": "Yea5WOh7YTKZEfmH06b1kqYpxNMLruIiOK0f4m2h09dYfnn331wv0pm_sh4fEJ4C1nvRTwexb1HzwPsufT9VTYvMT2dylPjvaFUrinoau2vGjrNUN-YUz650UwsX5EnPZ8O_7JuTZ8BQHqOUWCz5EnXDjst5cxNNBMGLtes6s93KVg5fqa9t8SP8tPHQOupSIGZ6xdPWgD6Nf8c3B68yVWG-hV1jHsCKNSdqXmQr3-J8wl7t--_6wocytJtqgHQcy9Rp0BSMfATMHXeLA9mzlSZ3QJ2lEuG4oTRMG6VD_NPyezjHX1wzfQuBuh75AoxMDKyQyETurKWQiPYUkH6pvdyjDLrgKFl_iXNAyxxBjztkh_PPzs8yERuivSxV-wBy7Wb0-kB3yp0sQA-8ULQTPqL_o4Dp1dJscr91entjOUmOibPkHx07two36eUj-5WZzozr8GTHw9U9X-DwvcDQH2fabnTl-7RoKy5KOEuXae4M9QiHepSwujIMMPsPejrKbnl1ItgH6EeN1wC-iWPDGHehQOQXfhbkM2JEJIYX89epwMhQuGsg65v18YgCOURwIBtSroBSftxzcwHmjzU8O4cDI9FzfJBz1dXXV8OmnhiXpujNRNaUmYq46OQtJpgwcQR8uJJAz9vcPsqtpzQt0bFv-m2xJ7Vj4yYI_Gma7aVaT8SRxBgAfSb0zsok5zeciLAPqk7zJyMYElYuMgR57EQWOkw5cySWeuln58RKwdS-9D6qSAV5KKbvoPeKMEVV29usr54z4GFqx-pHP1NSLcAZdBrx6r3Ee1pNQW4V4p2oSdNL0ZqK3HCt61rTET-u3bcA_NRP2JNu-mP8e3a26SXLhRGDF8miR9kOjsDwj5DbCqMaVuO2qZh_jI9RIGVbkUw1Op0oA_6a0rCn83jo0EBU1ncGpHiXBEb0OhNAR9lmxZlbU34N-Qe8VR4Ozj
@sidkang
sidkang / SPEC.md
Created May 11, 2026 02:03
Hammerspoon Whichkey

WhichKey Plugin SPEC

Purpose

whichkey.lua is a small Hammerspoon helper that shows a delayed, floating key guide for modal shortcuts.

It is intended for workflows where another tool or hotkey layer enters a mode, waits for the next key, and wants to display an on-screen cheat sheet only if the user hesitates.

Typical usage:

@sidkang
sidkang / 18comic.js
Created March 31, 2026 14:26
18comic.vip 键盘导航增强
// ==UserScript==
// @name 18comic.vip 键盘导航增强
// @namespace http://tampermonkey.net/
// @version 1.7
// @description 左右键翻页,上下键快速滚动,默认隐藏顶部导航,H键切换
// @match https://18comic.vip/photo/*
// @grant none
// @run-at document-idle
// ==/UserScript==
@sidkang
sidkang / config.lua
Created October 13, 2023 10:30
beancount cmp with nvim
return {
{
"hrsh7th/nvim-cmp",
dependencies = {
"crispgm/cmp-beancount",
"hrsh7th/cmp-nvim-lsp-signature-help",
},
opts = function(_, opts)
local cmp = require "cmp"
@sidkang
sidkang / beancount.lua
Created January 29, 2023 03:25
Neovim Beancount Basic Config
-- after/ftplugin/beancount.lua
vim.opt.wrap = false
vim.opt.tabstop = 4
vim.opt.softtabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
vim.g.beancount_separator_col = 55
vim.g.beancount_root = vim.trim(vim.fn.system('pwd')) .. "/" .. "main.bean"
@sidkang
sidkang / resize-pdf.py
Last active May 13, 2025 10:52
Resize PDF Files to Same Page Size Using Python
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.pdf import PageObject
from pathlib import Path
pdf_file = Path.home() / 'Downloads' / 'General harmony - practical, analysis and principle.pdf'
pdf_reader = PdfFileReader(str(pdf_file))
writer = PdfFileWriter()
# assume page 0 is the desired size
page0 = pdf_reader.getPage(0)
@sidkang
sidkang / script.scpt
Last active November 1, 2021 12:14
change IME using AppleScript
launch application "System Events"
delay 0.1
ignoring application responses
tell application "System Events" to tell process "TextInputMenuAgent"
click menu bar item 1 of menu bar 2
end tell
end ignoring
do shell script "killall 'System Events'"
delay 0.1