Skip to content

Instantly share code, notes, and snippets.

@dazuiba
dazuiba / README.md
Last active May 28, 2026 03:44
claudep — Claude Code proxy wrapper via oc-cc-proxy

claude-p — Claude Code + OpenCode Go 代理

一、背景:在 Claude Code 中使用 OpenCode Go 订阅

Claude Code 默认走 Anthropic API。如果你有 OpenCode Go 订阅,可以用它来跑 Claude Code,享受 opencode-go 的极低价格和模型选择(如 deepseek-v4)。

为什么值得

  • deepseek-v4 能力持平 sonnet / gpt-5.4,它们能干的事 deepseek-v4 都能干
  • 成本是后者的 ~1/3;而 opencode-go 的价格又是官方 deepseek 的 ~1/3
@dazuiba
dazuiba / README.md
Created May 28, 2026 02:41
claudep — Claude Code proxy wrapper via oc-cc-proxy
#!/usr/bin/env bash
export ANTHROPIC_BASE_URL=http://127.0.0.1:4000
export ANTHROPIC_AUTH_TOKEN=unused
export ANTHROPIC_MODEL=deepseek-v4-flash
export ANTHROPIC_DEFAULT_OPUS_MODEL=deepseek-v4-pro
export ANTHROPIC_DEFAULT_SONNET_MODEL=deepseek-v4-flash
export ANTHROPIC_DEFAULT_HAIKU_MODEL=deepseek-v4-flash
export CLAUDE_CODE_SUBAGENT_MODEL=deepseek-v4-flash
exec claude "$@" --dangerously-skip-permissions
@dazuiba
dazuiba / status-line.sh
Created March 20, 2026 00:01
Claude Code status line script - shows model, context usage, and git info
#!/bin/bash
# Read JSON input from stdin
input=$(cat)
# Extract information from JSON
model_name=$(echo "$input" | jq -r '.model.display_name')
current_dir=$(echo "$input" | jq -r '.workspace.current_dir')
# Extract context window information
@dazuiba
dazuiba / plan.md
Last active November 2, 2025 11:52
plan mode for codex

place the following content to /Users/sam/.codex/prompts/plan.md


description: Plan according to the user's request, without starting the implementation.

$INSTRUCTIONS

Follow the instructions given by the user. You have to come up with a plan first, User will review the plan and let you know what to change or ok to proceed. You can record the plan using your own way like using the todo tool, but in additional, give user a text version of the plan to read. Only start implementing after getting the approval.

@dazuiba
dazuiba / bash_path
Last active March 15, 2024 09:21
path
# golang 编译cgo时需要的环境变量
export LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -L/usr/local/homebrew/opt/ruby@2.7/lib"
export LIBRARY_PATH="$LIBRARY_PATH:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" # Needed for Rust compilation and linking
export CPATH="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include"
export CGO_LDFLAGS="-L/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks"
export CGO_CFLAGS="-F/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks -Wno-nullability-completeness"
export GOROOT="/usr/local/go"
export GOBIN=~/go_bin
export PATH=$PATH:$GOBIN
/**
type v10 struct {
data [10]byte
}
//函数参数,指针
//当struct大小在1K时,指针传递(无拷贝)快1个数量级。低于1K差别不大
func BenchmarkPointer10In(b *testing.B) {
var v v10
vscode-gist>error: extension.gist.create > Requires authentication
//to fix this issue, you can add this to ~/.bashrc:
//
// export CPATH=`xcrun --show-sdk-path`/usr/include
npm ERR! #include <errno.h>
~/dev/my/outline-apps[master]$ npm install -g iconv
npm ERR! code 1
@dazuiba
dazuiba / dedict.c
Created July 29, 2016 17:07 — forked from josephg/0dedict.py
Apple dictionaries
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "zlib.h"
#define CHUNK 16384
/*
40 Length of the zlib stream
sphinx: &using
address: sphinx-server-host-ip
bin_path: /usr/local/bin
searchd_binary_name: searchd
indexer_binary_name: indexer
enable_star: 1
min_prefix_len: 3
prefix_fields: name
mem_limit: 1024M
morphology: 'none'