Skip to content

Instantly share code, notes, and snippets.

View t3dotgg's full-sized avatar

Theo Browne t3dotgg

View GitHub Profile
@t3dotgg
t3dotgg / page.tsx
Created February 26, 2024 21:21
Example of a page refreshing content using unstable_cache in Next.js App Router
import { revalidateTag, unstable_cache } from "next/cache";
import { db } from "~/server/db";
import { todoItems } from "~/server/db/schema";
const getTodos = unstable_cache(
async () => {
return await db.query.todoItems.findMany();
},
["todoItems"],
{
@t3dotgg
t3dotgg / model-prices.csv
Last active April 24, 2025 17:26
Rough list of popular AI models and the cost to use them (cost is per 1m tokens)
Name Input Output
Gemini 2.0 Flash-Lite $0.075 $0.30
Mistral 3.1 Small $0.10 $0.30
Gemini 2.0 Flash $0.10 $0.40
ChatGPT 4.1-nano $0.10 $0.40
DeepSeek v3 (old) $0.14 $0.28
ChatGPT 4o-mini $0.15 $0.60
DeepSeek v3 $0.27 $1.10
Grok 3-mini $0.30 $0.50
ChatGPT 4.1-mini $0.40 $1.60
@t3dotgg
t3dotgg / claude-allowed-filetypes.txt
Created February 4, 2025 02:45
This is a list of all the file types Claude allows on their web app. Posting it so others have it
.pdf
.doc
.docx
.rtf
.epub
.odt
.odp
.pptx
.txt
.py
{
"description": "Caps Lock to Hyper, Hyper + u/o to pageup/pagedown, IJKL to arrows, Hyper + A to Ctrl+A",
"manipulators": [
{
"from": {
"key_code": "caps_lock",
"modifiers": { "optional": ["any"] }
},
"to": [
{
@t3dotgg
t3dotgg / try-catch.ts
Last active April 24, 2025 13:01
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};

If it's so easy to guess a uuid, here you go

I ran crypto.randomUUID() twice on my machine.

The first ID was 15041508-fd38-4eda-bc1d-7b74e4738cd9

The second? That's your challenge.

I encrypted a text file with the following command: