Skip to content

Instantly share code, notes, and snippets.

View nmarley's full-sized avatar
🦀
我想吃一點點東西。

Nathan Marley nmarley

🦀
我想吃一點點東西。
View GitHub Profile
@nmarley
nmarley / claude-code-tools.md
Created August 18, 2025 19:13 — 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
@nmarley
nmarley / cursor-updates.sh
Created March 21, 2025 15:32
Cursor AI - fake the update URL so it stops auto-updating
#! /bin/bash
# I don't know what this hash is, I'm just getting it from the logs. Seems to
# be the same whether I'm coming from v0.45 or v0.47
SOME_HASH="a63aba471623a41801c50fa53f56f7c39d330ab06bb4926d53909805c61a66fe"
# VERSION=0.45.17
VERSION=0.47.8
# URL="https://api2.cursor.sh/updates/api/update/darwin/cursor/${VERSION}/a63aba471623a41801c50fa53f56f7c39d330ab06bb4926d53909805c61a66fe?http2Disabled=false"
@nmarley
nmarley / audio.sh
Created January 22, 2025 17:52
Download best quality audio from YouTube video
#! /bin/bash
# yt-dlp command to download the best audio quality from a youtube video
# yt-dlp --format bestaudio --extract-audio --audio-format opus --audio-quality 0 https://www.youtube.com/watch?v=jhoG3WcECnw
if [ -z "$1" ]; then
echo "Usage: $0 <youtube-url>"
exit 1
fi
PostgreSQL Type PostgreSQL Size Description Range Diesel Type Rust Type
Nullable Types nullable Nullable``
@nmarley
nmarley / README.md
Last active January 8, 2023 19:16
Rust macro testing

Rust macro testing

rustc --test test2.rs
@nmarley
nmarley / out.txt
Created June 16, 2022 20:22
testnet debug log analysis
("masternode-1", MNOutput { debug_log_line: "-rw------- 1 dash dash 10000000 Jun 12 22:55 /dash/.dashcore/testnet3/debug.log", build_version: "v0.17.0.3" })
("masternode-2", MNOutput { debug_log_line: "-rw------- 1 dash dash 10000000 Jun 12 22:54 /dash/.dashcore/testnet3/debug.log", build_version: "v0.17.0.3" })
("masternode-3", MNOutput { debug_log_line: "-rw------- 1 dash dash 10000000 Jun 12 22:54 /dash/.dashcore/testnet3/debug.log", build_version: "v0.17.0.3" })
("masternode-4", MNOutput { debug_log_line: "-rw------- 1 dash dash 10000000 Jun 12 22:54 /dash/.dashcore/testnet3/debug.log", build_version: "v0.17.0.3" })
("masternode-5", MNOutput { debug_log_line: "-rw------- 1 dash dash 10000000 Jun 12 22:55 /dash/.dashcore/testnet3/debug.log", build_version: "v0.17.0.3" })
("masternode-6", MNOutput { debug_log_line: "-rw------- 1 dash dash 10000000 Jun 12 22:54 /dash/.dashcore/testnet3/debug.log", build_version: "v0.17.0.3" })
("masternode-7", MNOutput { debug_log_line: "-rw------- 1 dash dash 10000000 Jun 1
@nmarley
nmarley / get-latest-alpine-ami.sh
Last active April 13, 2021 15:18
Get latest Alpine AMI
#! /bin/bash
# get latest alpine linux AMI
aws ec2 describe-images --output text --filters Name=owner-id,Values=538276064493 Name=name,Values='alpine-ami-3.13*-x86_64*' Name=architecture,Values=x86_64 Name=state,Values=available --query 'max_by(Images[], &CreationDate).ImageId'
@nmarley
nmarley / main.rs
Last active April 23, 2022 12:53
Example of sending interrupt using Rust mpsc channel
use std::sync::mpsc::{channel, Sender};
pub struct PPU {
// data...
cycles: u8,
nmi_channel: Sender<bool>,
}
impl PPU {
pub fn new(chan: Sender<bool>) -> Self {
@nmarley
nmarley / .gitignore
Last active November 27, 2020 12:55
LOD parser in Go (parse Luxembourg Online Dictionary XML files) basic PoC
# ignore the ignore/ dir
ignore/
@nmarley
nmarley / main.go
Created December 12, 2019 18:44
Go basic recursion on string parts
package main
import (
"fmt"
"os"
"regexp"
"strings"
)
var reS3KeyPDFUpload = regexp.MustCompile(`^.*\/(?P<year>\d{4})\/(?P<month>\d{2})\/(?P<day>\d{2})\/.*\.pdf$`)