Skip to content

Instantly share code, notes, and snippets.

View CodeBoy2006's full-sized avatar
📚
Learning CS and SE

codeboy CodeBoy2006

📚
Learning CS and SE
View GitHub Profile
@CodeBoy2006
CodeBoy2006 / .clang-format
Created August 23, 2025 01:38
clang-format 算法竞赛配置文件
# .clang-format
BasedOnStyle: LLVM
# —— 缩进用 Tab,对齐用空格(更稳妥)——
UseTab: ForIndentation # 缩进使用 Tab,水平对齐仍用空格
TabWidth: 4 # 一个 Tab 等于 4 列
IndentWidth: 4 # 每一级缩进 = 1 个 Tab(= TabWidth)
# —— 紧凑度/可读性:更像竞赛模板 ——
ColumnLimit: 0 # 不自动换行(模板/长宏更安全)
@CodeBoy2006
CodeBoy2006 / override.js
Created July 29, 2025 08:45
Mihomo Party Override
/**
* 个人备份使用,该脚本适用与Mihomo Party和 Clash Verge Rev
* Clash Verge Rev 全局扩展脚本(懒人配置)/ Mihomo Party 覆写脚本
*
* V6: Applied modern DNS and performance optimizations.
* - Replaced old DNS structure with a robust nameserver/fallback model to prevent leaks.
* - Enabled DNS over QUIC (prefer-h3) for faster lookups.
* - Removed default-nameserver to eliminate startup leaks.
* - Added experimental tcp-concurrent for latency reduction.
* V5: Added proxy node preprocessing to rename nodes conflicting with group names.
@CodeBoy2006
CodeBoy2006 / Vision3D.js
Last active August 2, 2025 02:52
SillyTavern 3D视野插件 - 让角色的视野可视化 (通过酒馆助手加载)
// ==UserScript==
// @name 全局脚本 - 3D视野组件 (单 Canvas v10.8 Bbox Fixed)
// @version 10.8
// @description 实现遮挡物半透明效果,当模型包裹另一个时,外层模型自动透视,支持玩家显示开关。已优化移动端触摸支持和性能。新增并修复了bbox格式兼容。
// @author Codeboy, 优化 by AI
// @match */*
// @grant none
// ==/UserScript==
(function () {
@CodeBoy2006
CodeBoy2006 / scan_project.cpp
Created April 4, 2025 01:09
C++ Windows tool: Scans dir, outputs filtered tree & file contents (Markdown), copies to clipboard (for LLMs/docs).
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <filesystem> // Requires C++17
#include <sstream>
#include <stdexcept>
#include <algorithm>
#include <windows.h> // For Windows Clipboard API
Begin by enclosing all thoughts within <thinking> tags, exploring multiple angles and approaches.
Break down the solution into clear steps within <step> tags. Start with a 20-step budget, requesting more for complex problems if needed.
Use <count> tags after each step to show the remaining budget. Stop when reaching 0.
Continuously adjust your reasoning based on intermediate results and reflections, adapting your strategy as you progress.
Regularly evaluate progress using <reflection> tags. Be critical and honest about your reasoning process.
Assign a quality score between 0.0 and 1.0 using <reward> tags after each reflection. Use this to guide your approach:
0.8+: Continue current approach
0.5-0.7: Consider minor adjustments
Below 0.5: Seriously consider backtracking and trying a different approach
@CodeBoy2006
CodeBoy2006 / claude_3.5_sonnet_artifacts.xml
Created August 30, 2024 12:41 — forked from dedlim/claude_3.5_sonnet_artifacts.xml
Claude 3.5 Sonnet, Full Artifacts System Prompt
<artifacts_info>
The assistant can create and reference artifacts during conversations. Artifacts are for substantial, self-contained content that users might modify or reuse, displayed in a separate UI window for clarity.
# Good artifacts are...
- Substantial content (>15 lines)
- Content that the user is likely to modify, iterate on, or take ownership of
- Self-contained, complex content that can be understood on its own, without context from the conversation
- Content intended for eventual use outside the conversation (e.g., reports, emails, presentations)
- Content likely to be referenced or reused multiple times
ffmpeg -y -f lavfi -i "
color=white@0.0:1700x520:d=<SECONDS>,
format=rgba,
drawtext=
fontcolor=black:
fontsize=600:
fontfile=<FONT>.ttf:
text='%{eif\:(<SECONDS>-t)/60\:d\:1}\:%{eif\:mod(<SECONDS>-t, 60)\:d\:2}':
x=(w-text_w)/2:
y=(h-text_h)/2:
@CodeBoy2006
CodeBoy2006 / caryon.h
Created September 10, 2022 14:24
CarYon 数据生成器
#ifndef CARYON_H
#define CARYON_H
#ifndef _GLIBCXX_NO_ASSERT
# include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
@CodeBoy2006
CodeBoy2006 / config.cpeditor
Last active September 10, 2022 12:57
备份CPEditor配置
[General]
tab_width=4
cursor_width=1
geometry=@Rect(1468 225 813 600)
editor_font=@Variant(\0\0\0@\0\0\0\x1c\0J\0\x65\0t\0\x42\0r\0\x61\0i\0n\0s\0 \0M\0o\0n\0o@0\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
use_custom_application_font=true
custom_application_font=@Variant(\0\0\0@\0\0\0\fe\xb9kc|\x97W\x6{\x80OS@(\0\0\0\0\0\0\xff\xff\xff\xff\x5\x1\0\x32\x10)
default_language=C++
format_on_manual_save=false
format_on_auto_save=false
@CodeBoy2006
CodeBoy2006 / OI.h
Created October 14, 2021 12:47
OI专用头文件,包含自带调试模式的IO类,值得拥有
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>