Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active February 15, 2026 23:33
microgpt
"""
The most atomic way to train and inference a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@Klerith
Klerith / testing-configuration.md
Last active February 15, 2026 23:33
Configuración de Vitest + React Testing Library
@marciopuga
marciopuga / ask.md
Last active February 15, 2026 23:31
A three-letter shell function that makes Claude Code a first-class Unix citizen. Pipe in logs, diffs, configs, kubectl output — anything. No quotes, no flags, no friction. Just ask and go.

ask — Pipe First, Ask Questions Later

Claude Code already supports piping — but the syntax is a mouthful:

ls -la | claude -p "Help me understand why these build artifacts look wrong"

That's too much typing for something you want to reach for 50 times a day. So I wrapped it in a three-letter shell function and it changed how often I use it.

// ==UserScript==
// @name Microsoft Loop to Markdown
// @namespace http://tampermonkey.net/
// @version 1.4
// @description Convert Microsoft Loop pages to Markdown
// @author Talha Oz (ozt@)
// @match https://loop.cloud.microsoft/*
// @match https://*.loop.cloud.microsoft.com/*
// @grant GM_setClipboard
// @updateURL https://gist.github.com/oztalha/8724b72bf1f37d721c8b55eb02228cc6/raw/loop-to-markdown.user.js
@branquito
branquito / file-folder-rename-bash-recursive.txt
Created March 1, 2013 00:19
batch rename files or folders recursively in bash
command to find recursively files {can be modified for folders too, change -type f}, and renamed them by specfying regex pattern
find . -type f -maxdepth [depth] -name "[filepattern]" | while read FNAME; do mv "$FNAME" "${FNAME//search/replace}"; done
example:
find . -type f -maxdepth 1 -name "domain*.php" | while read FNAME; do mv "$FNAME" "${FNAME//domain/lead}"; done
before: after:
@BjoernRave
BjoernRave / gist:0a9a6e1168ca5956cda345cd76fb6518
Last active February 15, 2026 23:21
Function to get a decklist of a cardmarket wanted list. Just go to your wanted list, right click somewhere, click inspect, go to console, paste this in and hit enter
(function scrapeData() {
const tbody = document.querySelector('tbody');
const trElements = tbody.querySelectorAll('tr');
const result = [];
trElements.forEach((tr) => {
const amountElement = tr.querySelector('.amount');
const nameElement = tr.querySelector('.name');
if (amountElement && nameElement) {
@felipeadeildo
felipeadeildo / rocketseat_downloader.py
Last active February 15, 2026 23:20
Rocketseat Downloader
import json
import os
import pickle
import queue
import random
import re
import threading
from pathlib import Path
from typing import Optional
from urllib.parse import parse_qs