Skip to content

Instantly share code, notes, and snippets.

View sorrycc's full-sized avatar
🌻
Working on Neovate Code

chencheng (云谦) sorrycc

🌻
Working on Neovate Code
View GitHub Profile
@sorrycc
sorrycc / check-axios-attack.ts
Created March 31, 2026 10:53
Axios supply chain attack detector (axios@1.14.1 / axios@0.30.4) - Bun script to check for RAT artifacts, malicious dependencies, C2 connections
#!/usr/bin/env bun
/**
* Axios Supply Chain Attack Detector
* Detects compromise from axios@1.14.1 / axios@0.30.4 (2026-03-31)
*
* Malicious versions inject plain-crypto-js@4.2.1 which deploys a
* cross-platform RAT (Remote Access Trojan) via postinstall hook.
*
* Usage: bun run check-axios-attack.ts [--scan-dir /path/to/projects]
*
@sorrycc
sorrycc / extract-claude-code.mjs
Created March 31, 2026 09:31
Download Claude Code from npm and extract original TypeScript source from its source map. Usage: bun extract-claude-code.mjs [version]
#!/usr/bin/env bun
/**
* Download a specific version of Claude Code from npm,
* then extract the original TypeScript source from its source map.
*
* Usage:
* bun extract-claude-code.mjs [version]
*
* Example:
@sorrycc
sorrycc / extract-sourcemap.mjs
Created March 31, 2026 08:57
Extract original source code from JavaScript .map (source map) files. Reads sourcesContent, skips node_modules, reconstructs the original file tree.
#!/usr/bin/env node
/**
* Extract original source code from a JavaScript source map file.
*
* Usage:
* node extract-sourcemap.mjs <path-to-.map-file> [output-dir]
*
* Example:
* node extract-sourcemap.mjs cli.js.map ./src-extracted
date created 2026-01-19
date modified 2026-03-31

不写代码的程序员

AI 编程实战分享 2026.03.31

云谦

@sorrycc
sorrycc / claude-version-manager.sh
Created March 26, 2026 15:03
Claude Code Version Manager - list, install, and remove Claude Code versions interactively
#!/bin/bash
set -euo pipefail
GCS_BUCKET="https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases"
GCS_API="https://storage.googleapis.com/storage/v1/b/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/o"
VERSIONS_DIR="$HOME/.local/share/claude/versions"
# Colors
RED='\033[0;31m'
GREEN='\033[0;32m'
@sorrycc
sorrycc / check-litellm.sh
Last active March 26, 2026 08:08
LiteLLM Supply Chain Attack Detector — check for compromised versions (1.82.7/1.82.8) and TeamPCP IoCs
#!/bin/bash
# LiteLLM Supply Chain Attack Detector
# Checks for compromised litellm versions (1.82.7 / 1.82.8) and related IoCs
# Reference: https://github.com/BerriAI/litellm/issues/24512
# Date: 2026-03-24
set -euo pipefail
RED='\033[0;31m'
GREEN='\033[0;32m'
@sorrycc
sorrycc / btw-command-implementation.md
Created March 12, 2026 12:14
Claude Code /btw command - Quick Side Question implementation details

/btw — Quick Side Question Command Implementation

Overview

/btw is a slash command that lets users ask a quick side question without interrupting the main conversation flow. It forks a lightweight, single-turn API call using the existing conversation context but with no tools available.

The response is displayed inline and can be dismissed with Space/Enter/Escape to resume the main conversation.


@sorrycc
sorrycc / loop.txt
Created March 7, 2026 14:31
/loop command implementation analysis in Claude Code 2.1.71
/loop — Detailed Implementation in versions/2.1.71/cli.js
Overview
/loop is a slash command (skill) that schedules a prompt to run on a recurring
interval. It is syntactic sugar over the internal Kairos Cron scheduling
system (CronCreate / CronDelete / CronList tools).
---
// ==UserScript==
// @name 语雀文档导出工具
// @namespace http://tampermonkey.net/
// @version 0.1.0
// @description 导出语雀文档为 Markdown 文件
// @author sorrycc
// @match https://www.yuque.com/*
// @match https://yuque.antfin.com/*
// @require https://cdn.jsdelivr.net/gh/eligrey/FileSaver.js@v2.0.4/dist/FileSaver.min.js
// @require https://cdn.jsdelivr.net/gh/Stuk/jszip@v3.0.0/dist/jszip.min.js
@sorrycc
sorrycc / a.json
Created February 27, 2026 02:44
Change right_command to hyper key (f19 when alone). Change right_option to fn.
{
"description": "Change right_command to hyper key (f19 when alone). Change right_option to fn.",
"manipulators": [
{
"from": {
"key_code": "right_option",
"modifiers": {
"optional": [
"any"
]