Skip to content

Instantly share code, notes, and snippets.

@wong2
wong2 / claude-code-tools.md
Last active June 23, 2025 13:45
Tools and system prompt of Claude Code

Task

Launch a new agent that has access to the following tools: Bash, Glob, Grep, LS, exit_plan_mode, Read, Edit, MultiEdit, Write, NotebookRead, NotebookEdit, WebFetch, TodoRead, TodoWrite, WebSearch. When you are searching for a keyword or file and are not confident that you will find the right match in the first few tries, use the Agent tool to perform the search for you.

When to use the Agent tool:

  • If you are searching for a keyword like "config" or "logger", or for questions like "which file does X?", the Agent tool is strongly recommended

When NOT to use the Agent tool:

  • If you want to read a specific file path, use the Read or Glob tool instead of the Agent tool, to find the match more quickly
  • If you are searching for a specific class definition like "class Foo", use the Glob tool instead, to find the match more quickly
  • If you are searching for code within a specific file or set of 2-3 files, use the Read tool instead of the Agent tool, to find the match more quickly
@fengmk2
fengmk2 / .husky pre-commit
Last active June 20, 2025 06:58
eggjs oxlint config and .prettierrc config
npx lint-staged
@gomezcabo
gomezcabo / recursive-required.ts
Last active May 9, 2025 15:13
Typescript RecursiveRequired generic type
type RecursiveRequired<T> = Required<{
[P in keyof T]: T[P] extends object | undefined ? RecursiveRequired<Required<T[P]>> : T[P];
}>;
type ExampleType = {
a?: number;
b: number;
c?: {
d?: {
e?: number;
@Aschen
Aschen / README.md
Last active January 17, 2025 05:31
Benchmarking AsyncLocalStorage

What is the overhead of AsyncLocalStorage?

Run the benchmark:

$ npm i benchmark

# Run the AsyncLocalStorage benchmark
$ node async-local-storage.js ASL
ASL x 15,551 ops/sec ±3.30% (79 runs sampled)
@prmichaelsen
prmichaelsen / deep-complete.ts
Created May 16, 2019 23:37
recursively mark all properties of a typescript type as defined
/** private type, not exported */
declare type NonObject = undefined | null | boolean | string | number | Function;
/**
* This type allows you to mark an object with
* optional properties as required.
*/
export declare type Complete<T> = {
[K in keyof T]-?: T[K];
}
/**
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active June 28, 2025 05:50
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@Akiyamka
Akiyamka / blend-mode-polyfill.js
Created November 9, 2018 10:13
blend-mode-polyfill
/**
* @author Boggddan <github.com/boggddan>
* Запускается в браузерах которые не поддерживают свойство background-blend-mode.
* Полифил применяется к тегам помеченым атрибутом `data-background-blend-mode` в свойтвах которого нужно передать режим смешивания.
* Поддерживается: normal, multiply, lighten, screen, darken. (протестировано в IE 11)
* @example: <div data-background-blend-mode="multiply"></div>
*/
/* Element.prepend polyfill for IE 11 */
function prependPolyfill() {
const delay = (time) => {
return new Promise(resolve => setTimeout(resolve, time));
};
const serviceFactory = (timeout) => {
return async () => {
await delay(timeout);
return timeout;
};
};
@hollodotme
hollodotme / Install-nginx-with-http2-support.md
Created April 9, 2016 17:07
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common
@atian25
atian25 / README.md
Created March 9, 2016 14:07 — forked from steve-jansen/README.md
Stop and start Symantec Endpoint Protection on OS X

This script enables you stop and start Symantec Endpoint Protection on OS X

Installation

sudo curl https://gist.githubusercontent.com/steve-jansen/61a189b6ab961a517f68/raw/sep -o /usr/local/bin/sep
sudo chmod 755 /usr/local/bin/sep
sudo chown root:staff /usr/local/bin/sep