Skip to content

Instantly share code, notes, and snippets.

@dabit3
dabit3 / claude-agent-tutorial.md
Last active January 20, 2026 20:57
The Complete Guide to Building Agents with the Anthropic Agent SDK

Building AI agents with the Claude Agent SDK

If you've used Claude Code, you've seen what an AI agent can actually do—read files, run commands, edit code, figure out the steps to accomplish a task.

And you know it doesn't just help you write code, it takes ownership of problems and works through them the way a thoughtful engineer would.

The Claude Agent SDK is the same engine, yours to point at whatever problem you want, so you can easily build agents of your own.

The Claude Agent SDK is how you build that same thing into your own applications.

@watertim
watertim / redelegate-evmos-all.sh
Last active November 27, 2021 13:54 — forked from apetresc/redelegate-cro.sh
A script to automatically claim staking rewards and re-stake them
#!/bin/bash -e
if [[ "$1" == "-h" || "$1" == "" ]]
then
echo "Usage: $0 <validator-address> [-y]"
exit
fi
# Arguments
VALIDATOR=$1
@davaymne
davaymne / Grafana - Main Page
Last active January 12, 2021 11:36
Grafana - Main Page
{
"__inputs": [
{
"name": "DS_GRAPHQL_DATA SOURCE",
"label": "GraphQL Data Source",
"description": "",
"type": "datasource",
"pluginId": "fifemon-graphql-datasource",
"pluginName": "GraphQL Data Source"
},
@ilap
ilap / grafana_telegram_bot.md
Last active May 9, 2025 23:43
Grafana Telegram Alert

Config Telegrambot for grafana's alerts.

1. Create bot

Open Telegram and search for @BotFather user and message them the following:

You
/newbot 

BotFather
@ad
ad / example.sql
Last active February 23, 2018 22:14
database with triggers and history example
CREATE OR REPLACE FUNCTION "json_append"(IN "data" json, IN insert_data json) RETURNS "json" AS $BODY$
SELECT ('{'||string_agg(to_json(key)||':'||value, ',')||'}')::json
FROM (
SELECT * FROM json_each(data)
UNION ALL
SELECT * FROM json_each(insert_data)
) t;
$BODY$
LANGUAGE sql
COST 100

Scaling your API with rate limiters

The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.

In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.

Request rate limiter

This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.

@ad
ad / ems.sh
Created March 27, 2017 08:44
Tracking EMS (Russian Post) parcel
#!/bin/bash
# usage: ems.sh <tracking> <sleep_duration>
export SLEEP=60
export TRACKING=""
if [ $1 ]; then
TRACKING="$1"
else
@PurpleBooth
PurpleBooth / README-Template.md
Last active January 23, 2026 10:31
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results