Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active August 27, 2026 06:47
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
@VictorTaelin
VictorTaelin / rotating_1d_space_with_binary_trees.md
Created March 17, 2025 21:22
Rotating an 1D space with binary trees

Suppose you wanted to represent an 1D space in a pure functional language, i.e., with trees. Suppose that you also needed to shift the whole space left and right. An efficient way to do it would be to use a perfect binary tree to store locations, and bit-strings to represent paths. For example:

(((0 1) (2 3)) ((4 5) (6 7)))

The tree above would represent a space with 8 locations. Then, the path:

[1,0,0]

@mnabila
mnabila / JetBrains trial reset.md
Created February 28, 2024 08:17
Reset all JetBrains products trial in Linux

In some cases, only these lines will work

for product in IntelliJIdea WebStorm DataGrip PhpStorm CLion PyCharm GoLand RubyMine; do
    rm -rf ~/.config/$product*/eval 2> /dev/null
    rm -rf ~/.config/JetBrains/$product*/eval 2> /dev/null
done

But if not, try these

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.

KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
T3ZWQ-P2738-3FJWS-YE7HT-6NA3K
KFZUS-F3JGV-T95Y7-BXGAS-5NHHP
65Z2L-P36BY-YWJYC-TMJZL-YDZ2S
SFZHH-2Y246-Z483L-EU92B-LNYUA
GSZVS-5W4WA-T9F2E-L3XUX-68473
FTZ8A-R3CP8-AVHYW-KKRMQ-SYDLS
Q3ZWN-QWLZG-32G22-SCJXZ-9B5S4
DAZPH-G39D3-R4QY7-9PVAY-VQ6BU
KLZ5G-X37YY-65ZYN-EUSV7-WPPBS
@CocaKova
CocaKova / qwen38-flash-next-q4kxl-spark.md
Created August 26, 2026 21:45
Qwen3.8-Flash-Next UD-Q4_K_XL on one DGX Spark: 128K ctx + q8 KV (fix for qwen4exp self_k_rot assert)

Qwen3.8-Flash-Next UD-Q4_K_XL on a single DGX Spark — 128K context, q8 KV cache

Tested 2026-08-26 on a DGX Spark (GB10, 128 GB unified). Measured, not estimated.

The crash you're hitting

With -ctk q8_0 -ctv q8_0, llama.cpp PR #27742 (qwen4exp) dies at load:

src/models/qwen4exp.cpp:544: GGML_ASSERT(inp->self_k_rot == nullptr && inp->self_v_rot == nullptr) failed
Build time: 314.624679225999
========================================================================================================================================================
html-page-context — 203.048873s own time (64.54% of build) | 701 emissions | depth 0
========================================================================================================================================================
Handler Kind Ext/Module Calls Total(s) Avg(ms)
--------------------------------------------------------------------------------------------------------------------------------------------------------
update_and_remove_templates theme pydata_sphinx_theme 701 200.980517 286.705
set_secondary_sidebar_items theme pydata_sphinx_theme 701 1.510018
@tanyuan
tanyuan / archlinux.md
Created April 21, 2016 13:20
Arch Linux 為什麼這麼迷人?

Arch Linux 為什麼這麼迷人?

Arch Linux 是眾多 Linux 作業系統中的一種,對象是有 Linux 指令操作經驗的「進階使用者」,想要打造更適合自己的環境,例如不同的桌面、視窗環境等,體驗最新的套件。

Arch Linux 只有文字介面,不包含圖形介面。也就是說,當你安裝完 Arch Linux 之後,你會看到整個螢幕黑黑一片,電腦期待著你用鍵盤輸入文字指令。Arch Linux 只提供最基本可以讓電腦跑起來的功能,其他套件都要自己安裝。

成為掌握一切的設計師

Arch Linux 不會裝你不會用到的東西,你會自己親自打造完全屬於自己的電腦。不會有程式任意自動啟動,不會有人強迫你更新。你可以把你的電腦改成任何模樣,同樣你也為你的電腦的易用性和安全性負責。

@almahmudbd
almahmudbd / free-ai-api.md
Last active August 27, 2026 06:31
Free Ai Api keys and credits for agentic coding.

Free AI API Keys for Agentic Coding

Usage Tips

  • Do not subscribe to every service at once. Most free credits expire quickly. Test them one by one and move to the next when your current credits run out.
  • Register, verify your account, and claim your credits. Follow each platform's documentation to connect your coding tools.
  • Keep your API keys private. Do not share them publicly. (save or star this gist for future update)

List 1: Top Sites in This Genre

@Kartones
Kartones / postgres-cheatsheet.md
Last active August 27, 2026 06:30
PostgreSQL command line cheatsheet

PSQL Cheatsheet

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)