Skip to content

Instantly share code, notes, and snippets.

View razhangwei's full-sized avatar

Wei Zhang razhangwei

  • Facebook
  • Bay Area
View GitHub Profile
@razhangwei
razhangwei / zotero_mcp.md
Created June 5, 2026 00:04
Connect Claude Code to Zotero

Zotero MCP + Claude Code — Setup Cheatsheet

Connect your Zotero library to Claude Code via the zotero-mcp MCP server, in local mode (no API key — talks to Zotero's on-device HTTP API).

Tested setup: zotero-mcp-server v0.4.1, installed with uv, on macOS. Binary shim: ~/.local/bin/zotero-mcp. Claude Code config: ~/.claude.json (user scope).


@razhangwei
razhangwei / claude-ds.zsh
Last active May 4, 2026 06:04
Claude Code → DeepSeek V4 Pro direct (zsh function, no proxy). Replaces the free-claude-code FastAPI proxy approach.
# Claude Code → DeepSeek V4 Pro direct.
#
# Replaces the free-claude-code (FastAPI proxy) approach with a direct
# call to DeepSeek's Anthropic-compatible endpoint. No proxy, no port,
# no extra process to start — just env vars and a function.
#
# Setup:
# 1. Drop this in your ~/.zshrc (or source it from there).
# 2. Set DEEPSEEK_API_KEY: export DEEPSEEK_API_KEY="sk-..."
#
@razhangwei
razhangwei / settings.json
Last active May 4, 2026 06:54
Claude settings.json
{
"env": {
"CLAUDE_CODE_NO_FLICKER": "1",
"EDITOR": "code --wait",
"VISUAL": "code --wait"
},
"defaultMode": "plan",
"permissions": {
"defaultMode": "bypassPermissions"
},
@razhangwei
razhangwei / claude_ai_memory_system.md
Last active April 19, 2026 23:03
Claude Ai Memory System Explain

Claude.ai 用户记忆系统架构解析

Last Updated: April 19, 2026


概览

Claude.ai 的记忆系统由三个互相配合的层组成,从自动化到手动控制形成了一个完整的记忆管理栈。与 Claude Code 的 CLAUDE.md + Auto Memory + Auto Dream 体系不同,Claude.ai 的记忆更依赖平台层的自动化处理,用户的直接控制力相对有限。

@razhangwei
razhangwei / nextdns-tailscale-funnel-debugging.md
Created April 4, 2026 19:29
NextDNS DNS Rewrite Breaks Tailscale Funnel Access — Debugging & Fix

NextDNS DNS Rewrite Breaks Tailscale Funnel Access

Problem

After setting up Tailscale Funnel to publicly expose self-hosted services (Home Assistant, Nextcloud), certain devices couldn't access the Funnel URLs (https://homelab.taile97128.ts.net and https://homelab.taile97128.ts.net:8443), while others worked fine.

Symptoms

  • Laptop (macOS, Tailscale running): ✅ Works
  • Laptop (macOS, Tailscale off): ❌ Cannot load
@razhangwei
razhangwei / mac_clean_up_space.md
Created February 17, 2026 05:53
Mac clean up spaces tips

Why?

  • There are often many leftovers from previously installed apps--they won't be removed if simply deleting via dropping apps into Trash.

How to clean up?

  • Ask Claude code to come up with a plan.
  • Manually audit and approve its delete action one-by-one.
@razhangwei
razhangwei / vscode_markdown.md
Created January 8, 2026 00:59
markdown editing in #vscode
  • Use Markdown All in One extension so that the most common editing features, like bold, indent, can be greatly improved.
  • Turn on its auto open preview at side window.
@razhangwei
razhangwei / github.md
Last active August 29, 2025 01:55
How to read .github folder in a Github repo

Awesome — we’ll cover the .github/ folder from a reader’s POV: what it is, how it changes what you see on GitHub, and how to quickly make sense of it in any repo.

What the .github/ folder is • Purpose: holds GitHub-specific config (templates, automation, repo metadata). It doesn’t ship in packages or affect runtime code. • Scope: affects issues, PRs, Discussions, security disclosures, CI (GitHub Actions), and repo presentation.

How it changes your experience • Issues/PRs: you’ll see structured forms or prefilled text when opening issues/PRs. • Automation: PRs may auto-label, auto-assign reviewers, run checks/tests, or block merges. • Docs & policies: contribution rules, code of conduct, and security reporting paths show up in dedicated UI entries.

@razhangwei
razhangwei / pyproject.toml.md
Created August 28, 2025 15:07
How to read pyproject.toml

Great question 👍. A pyproject.toml file looks intimidating at first, but it’s just a TOML-formatted config. The trick is to know the sections that matter.

How to Read a pyproject.toml

  1. Build system

[build-system] requires = ["setuptools>=61.0"]

@razhangwei
razhangwei / python_package.md
Last active August 28, 2025 15:04
How to read a python package/repo?
Category File / Directory Purpose
Configuration & Build .gitignore Specifies files/folders Git should ignore.
Configuration & Build .pre-commit-config.yaml Defines linting/formatting hooks for pre-commit.
Configuration & Build .pylintrc Config file for pylint (style/linting rules).
Configuration & Build tox.ini Automates testing across multiple environments.
Configuration & Build pyproject.toml Defines packaging, dependencies, and build system.
Configuration & Build Dockerfile Provides containerized build/runti