Skip to content

Instantly share code, notes, and snippets.

View DrayChou's full-sized avatar
😸

Dray DrayChou

😸
View GitHub Profile
@DrayChou
DrayChou / claude-code-tools.md
Created June 14, 2025 14:42 — 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
@DrayChou
DrayChou / mcp-sse-start.ps1
Created April 5, 2025 17:25
windows 下简单的管理 sse 服务的脚本
# --- 配置 ---
# 定义要启动和监控的服务
# 格式: '服务名称' = '要执行的命令'
# 服务名称将用作后台作业的名称,便于识别和管理
$servicesToMonitor = @{
"SuperGateway_MCP_Time" = 'npx -y supergateway --stdio "uvx mcp-server-time --local-timezone=Asia/Shanghai" --port 34802'
"SuperGateway_MCP_Fetch" = 'npx -y supergateway --stdio "uvx mcp-server-fetch" --port 34815' # 注意: 你原始命令是 -port,这里保持一致,但通常应该是 --port
"SuperGateway_MCP_Memory" = 'npx -y supergateway --stdio "npx -y @modelcontextprotocol/server-memory" --port 34813'
}
// ==UserScript==
// @name 抓取30天之前的推文ID
// @namespace dray
// @version 1.0
// @description 抓取 Twitter 我的推文页面中30天之前的所有推文的ID
// @author dray
// @match https://twitter.com/*
// @grant none
// @run-at document-start
// @require unsafe-inline
// Website you intended to retrieve for users.
const upstream = 'api.openai.com'
// Custom pathname for the upstream website.
const upstream_path = '/'
// Website you intended to retrieve for users using mobile devices.
const upstream_mobile = upstream
// Countries and regions where you wish to suspend your service.
@DrayChou
DrayChou / delete-likes-from-twitter.md
Created March 16, 2021 14:46 — forked from aymericbeaumet/delete-likes-from-twitter.md
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to: https://twitter.com/{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
    d.click()
 }
#!/usr/bin/env bash
# SOURCE: https://eligiblestore.com/blog/2017/05/02/how-to-install-mosh-on-centos/
# ensure running as root
if [[ "$(id -u)" != "0" ]]; then
exec sudo "$0" "$@"
fi
# install mosh
yum install -y epel-release
<?php
/**
* 生成短连接的相关方法--通过记录ID换算成为58位的字符串(十进制转换成58进制)
*/
class BaseConvert {
const key_code_64 = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$';
const key_code_58 = '123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ';
<?php
/**
* crontab 时间格式php解析类(PHP 5 >= 5.1.0)
*
* @author 肖武 <[email protected]>
* @link https://code.google.com/p/xwcrontab/
*/
class XwCrontab {
<?php
$file_id = "1XSE7fHxtV-etUze91fkbRKaZodDPmQx9G_6Kc8I9sPE";
$access_token = "ya29.Ci-9A9Ckkgr6hn7Uu2UdNOm8XxK20jHNu3VfDT9mV_LbR2LmCYSo4ced8DOuEZif1g";
$url = "https://drive.google.com/thumbnail?sz=w320&id=" . $file_id;
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
<?php
ini_set('memory_limit', '4G');
if (mb_internal_encoding() != "UTF-8") {
mb_internal_encoding("UTF-8");
}
$file = "test2.txt"; // 一个编码为gbk的中文文件
// $encodeings = mb_list_encodings();