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:
| 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. |
| # /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 |
I hereby claim:
To claim this, I am signing this object:
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
| /** | |
| * 复制字符串文档至剪贴板 | |
| */ | |
| 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'; |
| # 该命令将打印出每个文件夹,甚至向我们显示该文件夹占用了多少空间! | |
| 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); |
| # 查询重复数据条数 | |
| 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)) { | |
| //中文 |
| /** | |
| * 格式化手机号脱敏,如 '188****8888' | |
| * | |
| * @param phone 手机号 | |
| * @returns 脱敏后的手机号字符串 | |
| */ | |
| export function phoneNumberDesensitization(phone: number | string): string { | |
| return phone.toString().replace(/(\d{3})\d{4}(\d{4})/, '$1****$2'); | |
| } |