Skip to content

Instantly share code, notes, and snippets.

@karpathy
karpathy / microgpt.py
Last active September 11, 2026 09:32
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
@joshenders
joshenders / swap.md
Last active September 11, 2026 09:30
Stop making swap partitions

Stop making swap partitions—use swap files instead!

Swap files have had the same performance characteristics as swap partitions for more than 20 years and yet, linux distributions continue to encourage the use of swap partitions during install.

Swap files are easier to use/add/remove/modify/extend after installation. They're better in every way––use swap files!

  1. Create a swap file.

💡 You can use dd for this too but if your filesystem supports it, fallocate is faster.

@nyancodeid
nyancodeid / commit-message-id.md
Last active September 11, 2026 09:27
Commit Message Guidelines

Pedoman Commit Message

Kami memiliki aturan yang sangat tepat tentang bagaimana pesan git commit kami dapat diformat. Ini mengarah ke pesan yang lebih mudah dibaca yang mudah diikuti ketika melihat melalui history proyek. Dan juga, kami menggunakan pesan git commit untuk menghasilkan log perubahan pada Angular.

Format Commit Message

Setiap pesan komit terdiri dari header, konten, dan catatan kaki. Judul memiliki format khusus yang mencakup jenis, cakupan, dan subjek:

<type>(<scope>): <subject>
<BLANK LINE>
@miurhz
miurhz / BMW_USB_Software_Update.md
Last active September 11, 2026 09:25
USB firmware update files for BMW CIC (Multimedia) and Combox (Bluetooth/Telephone), no longer available on official servers. Includes download links (from official site) and instructions for updating via USB.

BMW CIC & Combox USB Firmware Updates

Officially titled: BMW Software Update for External Devices – Multimedia and Telephone

ℹ️ About This Guide:

  • I am not pro at any of this. I started to search for information how to update vehicle's multimedia because of my own Bluetooth issue.
  • As BMW no longer provided software updates on their main site at that time, the task was to find is it still possible to get them.
  • After long searches I managed to solve my issue successfully and decided to put everything I found in one place.
@neodix42
neodix42 / install-clang-21.sh
Last active September 11, 2026 09:22
Install clang-21
# TON is moving to clang-21 for very pragmatic reasons — not because it's fashionable,
# but because it materially improves what we ship.
# We use clang-21 because we want the best C++ the language currently offers,
# stronger safety guarantees, better diagnostics, better generated code, and a toolchain that won't rot under us.
# Important! Remember, at this time no TON fullnodes or validators should be running on Ubuntu 20.04.
# This guide shows how to install clang-21 on Ubuntu 22.04 and 24.04 only.
# Ubuntu 22.04
@lidgnulinux
lidgnulinux / Fedora_via_rootfs_installation.md
Last active September 11, 2026 09:20
Experimental way to install fedora via rootfs archive / the arch way. GRUB kind of work.

Experimental way to install fedora via rootfs archive / the arch way.

Don't ever try this if you don't know what you're doing !

Prerequisites.

  • Any live usb bootable.
  • Fedora rootfs archive, we can get it here. It's better to choose the most update / latest archive.
  • Some partitions, for root system (/), efi (if you have uefi machine) and swap (optional).
  • Basic commandline knowledge.

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.

@cscsb
cscsb / gist:5637fcfc4644da3e538584c4b4065413
Created September 11, 2026 08:59
语言相关规则
1.主人懒得打字,所以和你对话的时候,字数很少,这个时候不确定性会很强,所以你需要通过选择题问我, 来减少不确定性, 选择题选项用数字选项,我会用“题号 选项”表示答案,例如第2题第3个,我会回答23
2.需要列出问题、选项、清单或步骤时,默认使用 `text` 代码块包裹列表内容,代码块内部可以使用 `1.`、`2.`、`3.` 这类编号。
正确写法示例:
```text
1. 第一个问题
2. 第二个问题
3. 第三个问题