Skip to content

Instantly share code, notes, and snippets.

@tangyl
tangyl / claude-code-tools.md
Created July 9, 2025 10:27 — forked from wong2/claude-code-tools.md
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
@tangyl
tangyl / gcsettings.sh
Created August 6, 2020 04:55 — forked from svanoort/gcsettings.sh
Blessed GC settings for big servers
# Base settings and GC logging
-server -XX:+AlwaysPreTouch # First should be default, but we make it explicit, second pre-zeroes memory mapped pages on JVM startup -- improves runtime performance
# -Xloggc:gc-%t.log # CUSTOMIZE LOCATION HERE - $path/gc-%t.log -- the %t in the gc log file path is so we get a new file with each JVM restart
-XX:NumberOfGCLogFiles=5 -XX:+UseGCLogFileRotation -XX:GCLogFileSize=20m # Limits the number of files, logs to folder
-XX:+PrintGC -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintHeapAtGC -XX:+PrintGCCause
-XX:+PrintTenuringDistribution -XX:+PrintReferenceGC -XX:+PrintAdaptiveSizePolicy # gather info on object age & reference GC time for further tuning if needed.
# G1 specific settings -- probably should be default for multi-core systems with >2 GB of heap (below that, default is probably fine)
-XX:+UseG1GC
-XX:+UseStringDeduplication
@tangyl
tangyl / README.md
Last active February 20, 2019 05:13 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@tangyl
tangyl / hive_external_json.sql
Created October 31, 2018 05:17
create hive external table with schema from json
create external table if not exists {{table_name}}(
url string,
title string,
duration int,
play_count int,
created_time bigint,
last_crawl_time bigint
)
ROW FORMAT SERDE
'org.openx.data.jsonserde.JsonSerDe'
@tangyl
tangyl / hive_external_table.sql
Created October 31, 2018 05:15
create hive external table
drop table if exist reddit_post;
create external table reddit_posts(
post_data string
)
location '<hdfs|s3 path>';
@tangyl
tangyl / ehcache.xml
Created October 25, 2018 08:10
ehcache.xml for play framework
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../config/ehcache.xsd" updateCheck="false">
<defaultCache
maxElementsInMemory="10000000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="false"
maxElementsOnDisk="10000000"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
@tangyl
tangyl / instaclip.user.js
Last active November 1, 2020 19:03
instaclip.user.js
// ==UserScript==
// @name InstaClip Poster
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Create InstaClip post from current video page
// @author Yilong Tang [email protected]
// @match https://www.facebook.com/*
// @match https://www.instagram.com/*
// @match https://www.youtube.com/*
// @match http://road-to-champion-2018.op-mobile.opera.com/assets/view/instaclip.html
@tangyl
tangyl / install-emacs25
Last active September 25, 2017 10:46
install emacs25 in ubuntu
#!/usr/bin/env
sudo apt-get install build-essential wget libncurses-dev
wget http://mirrors.ibiblio.org/gnu/ftp/gnu/emacs/emacs-25.3.tar.gz -O /tmp/emacs-25.3.tar.gz
cd /tmp
tar -zxvf emacs-25.3.tar.gz
cd emacs-25.3
./configure --with-x=no
make -j 8
sudo make install