Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active November 26, 2026 13:45
microgpt
"""
The most atomic way to train and run inference for 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
@WJWH
WJWH / c10k.ru
Created October 15, 2018 09:12
The double hijack trick, serving 65k connections from a single ruby process
# This server demo does a socket hijack in Rack and then saves the socket to a global variable
# to prevent it from being GCed when the Puma thread ends. It will then write "BEEP" to each
# socket every ten seconds to prevent the connection timing out. During testing, it easily
# handled up to 65523 connections, after which it ran into the `ulimit` for open file descriptors.
# The bit with the waiting area is there because a normal `Set` is not thread safe and it would
# drop socket due to race conditions. The `Queue` is thread safe and will make sure all sockets
# are preserved.
# run with `rackup -q -p 8000 -o 0.0.0.0 c10k.ru`
# testing: install `ab` and then run `ab -c 20000 -n 20000 <ip adress of server>:8000/
@dmitry-osin
dmitry-osin / css-cheatsheet-rus.md
Created April 28, 2025 23:02
Полная шпаргалка по CSS

LLM Wiki

A pattern for building personal knowledge bases using LLMs.

This is an idea file, it is designed to be copy pasted to your own LLM Agent (e.g. OpenAI Codex, Claude Code, OpenCode / Pi, or etc.). Its goal is to communicate the high level idea, but your agent will build out the specifics in collaboration with you.

The core idea

Most people's experience with LLMs and documents looks like RAG: you upload a collection of files, the LLM retrieves relevant chunks at query time, and generates an answer. This works, but the LLM is rediscovering knowledge from scratch on every question. There's no accumulation. Ask a subtle question that requires synthesizing five documents, and the LLM has to find and piece together the relevant fragments every time. Nothing is built up. NotebookLM, ChatGPT file uploads, and most RAG systems work this way.

@Kjir
Kjir / AoE2UrlHelper.desktop
Last active November 26, 2026 13:36
Running CaptureAge in Linux
[Desktop Entry]
Name=AoE2 URL Opener
Comment=Play this game on Steam (Open URL)
Exec=/home/<youruser>/.local/bin/aoe2url %u
Icon=steam_icon_813780
Terminal=false
Type=Application
MimeType=x-scheme-handler/aoe2de;
Categories=Game;
@mattpocock
mattpocock / README.md
Created July 7, 2026 11:51
agent-proxy — a zero-dep proxy that shows the bloat in Claude Code's requests (ranked tool table + full readable Markdown of every request)

agent-proxy — see the bloat in Claude Code's requests

A zero-dependency logging proxy that sits between Claude Code and the Anthropic API. It forwards every request untouched, streams the reply straight back (so the CLI is unaffected), and writes a readable Markdown document for each request — led by a ranked table of what is eating your context.

Run it

@pgoff
pgoff / shelly_dimmer_2.yaml
Created October 14, 2024 22:41
Blueprint to use Shelly Dimmer 2 in detached mode with button inputs
blueprint:
domain: automation
name: Shelly Dimmer 2 Detached Button Input
description: Map button inputs of the Shelly Dimmer 2
author: Patrick C. Goff
input:
shelly:
name: Shelly Dimmer 2 Switch
description: Shelly Dimmer 2 Switch button inputs
selector:
@0xdevalias
0xdevalias / generating-synth-patches-with-ai.md
Last active November 26, 2026 13:29
Some notes on generating software synthesizer patches with AI
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 26, 2026 13:26
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

Complete Cybersecurity Learning Roadmap 2025

Focused on Red Teaming, Penetration Testing & Script Development

🎯 Phase 1: Essential Foundations (2-3 months)

Core Technical Skills:

  • Linux Mastery: Command line, bash scripting, system administration, file permissions
  • Networking Deep Dive: TCP/IP stack, subnetting, routing, DNS, HTTP/HTTPS protocols
  • Windows Fundamentals: PowerShell, Active Directory basics, Windows security model