Skip to content

Instantly share code, notes, and snippets.

View chf007's full-sized avatar
🐱
In thinking...

chf007 chf007

🐱
In thinking...
View GitHub Profile
@chf007
chf007 / cursor-agent-system-prompt.txt
Created July 29, 2025 10:45 — forked from sshh12/cursor-agent-system-prompt.txt
Cursor Agent System Prompt (March 2025)
You are a powerful agentic AI coding assistant, powered by Claude 3.5 Sonnet. You operate exclusively in Cursor, the world's best IDE.
You are pair programming with a USER to solve their coding task.
The task may require creating a new codebase, modifying or debugging an existing codebase, or simply answering a question.
Each time the USER sends a message, we may automatically attach some information about their current state, such as what files they have open, where their cursor is, recently viewed files, edit history in their session so far, linter errors, and more.
This information may or may not be relevant to the coding task, it is up for you to decide.
Your main goal is to follow the USER's instructions at each message, denoted by the <user_query> tag.
<communication>
1. Be conversational but professional.
@chf007
chf007 / wg-route-rules.service
Last active May 13, 2024 04:31
systemd 开机启动执行命令
# /etc/systemd/system/wg-route-rules.service
# systemctl start wg-route-rules
# systemctl enable wg-route-rules
[Unit]
Description=wg route rules
After=network.target
[Service]
Type=simple

Keybase proof

I hereby claim:

  • I am chf007 on github.
  • I am chf007 (https://keybase.io/chf007) on keybase.
  • I have a public key ASAij5DCEqEP5z1p7WUSWeKj4WAX4Lc9pT-J6BicxRNuvQo

To claim this, I am signing this object:

@chf007
chf007 / docker-registry-mirrors.md
Created June 30, 2023 09:12 — forked from y0ngb1n/docker-registry-mirrors.md
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@chf007
chf007 / copyText.ts
Created May 14, 2020 14:57
copy text
/**
* 复制字符串文档至剪贴板
*/
export function copy(value: string): Promise<string> {
return new Promise<string>((resolve): void => {
let copyTextArea: HTMLTextAreaElement | null = null;
try {
copyTextArea = document.createElement('textarea');
copyTextArea.style.height = '0px';
copyTextArea.style.opacity = '0';
@chf007
chf007 / find.sh
Created March 18, 2020 02:44
如何删除计算机上的所有node_modules文件夹
# 该命令将打印出每个文件夹,甚至向我们显示该文件夹占用了多少空间!
cd documents
find . -name "node_modules" -type d -prune -print | xargs du -chs
# 删除目录中找到的所有node_modules 警告:此过程不可逆!
cd documents
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \;
.recommend-item.fade-in {
transform: translateY(0);
opacity: 1;
animation-duration: 3.3s;
animation-name: fade;
animation-timing-function: ease-in-out;
}
.recommend-item.fade-out {
transform: translateY(0);
@chf007
chf007 / uniqu-index.sql
Created August 30, 2019 08:12
删除mysql重复数据,并添加唯一索引
# 查询重复数据条数
SELECT * FROM (SELECT room_id, user_id, COUNT(1) AS num FROM live_room_subscribe GROUP BY room_id, user_id) temp WHERE num > 1;
# 删除除了最小id之外的重复数据
DELETE
FROM
live_room_subscribe
WHERE
export const getMbStringLength = str => {
let totalLength = 0;
const list = str.split('');
for (let i = 0, len = list.length; i < len; i++) {
const s = list[i];
if (s.match(/[\u0000-\u00ff]/g)) {
//半角
totalLength += 1;
} else if (s.match(/[\u4e00-\u9fa5]/g)) {
//中文
@chf007
chf007 / gist:ab50d07b74d299d56bc604db9e5f3af9
Created August 8, 2019 04:32
格式化手机号脱敏,如 '188****8888'
/**
* 格式化手机号脱敏,如 '188****8888'
*
* @param phone 手机号
* @returns 脱敏后的手机号字符串
*/
export function phoneNumberDesensitization(phone: number | string): string {
return phone.toString().replace(/(\d{3})\d{4}(\d{4})/, '$1****$2');
}