Skip to content

Instantly share code, notes, and snippets.

@joematthews
joematthews / gemma-e4b-retain.jinja
Created June 20, 2026 03:27
Gemma 4 E4B chat template — retains reasoning in history to stop llama.cpp KV-cache reprocessing. Credit: vevi33 & aldehir, llama.cpp#21912
{%- macro format_parameters(properties, required) -%}
{%- set standard_keys = ['description', 'type', 'properties', 'required', 'nullable'] -%}
{%- set ns = namespace(found_first=false) -%}
{%- for key, value in properties | dictsort -%}
{%- set add_comma = false -%}
{%- if key not in standard_keys -%}
{%- if ns.found_first %},{% endif -%}
{%- set ns.found_first = true -%}
{{ key }}:{
{%- if value['description'] -%}
@joematthews
joematthews / humble-pi.md
Last active July 25, 2026 23:27
Humble Pi -- local agentic coding on minimal hardware

Humble Pi -- local agentic coding on minimal hardware

A coding agent that runs entirely on your own machine. No API keys, no cloud, works offline.

web_search in pi -- search, fetch, answer

pi is the agent you talk to. It runs against a local llama.cpp server hosting Google Gemma 4 (the unsloth

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.

@nat-418
nat-418 / nix-home-manager-neovim-setup.md
Last active August 3, 2026 05:37
Manage Neovim plugins (and more!) with Nix and Home Manager

Manage Neovim plugins (and more!) with Nix and Home Manager

Highly extensible software like Emacs, Vim, and Neovim tend to grow their own package managers. A software developer, for example, might want to install editor plugins that hook into a particular programming language's linter or language server. The programmer's text editor is therefore extended to support managing additional software to extend the text editor. If this loop continues for too long, the programmer's editor becomes more delicate and complex. The remedy for this problem is to manage software using dedicated tools apart

@mihirchanduka
mihirchanduka / Arch_Linux_Install_Guide.md
Last active December 19, 2025 23:19
Arch Install Guide with BTRFS, Full Disk Encryption and Encrypted Swap Partition

Arch Linux Installation Guide


Guide to install Arch Linux on an EFI System. Includes these features:

  • Full Disk Encryption with LUKS
  • BTRFS with @ and @home subvolumes
  • Timeshift Backups
  • Encrypted Swap Partition
  • rEFInd bootloader
  • SDDM display manager
  • KDE Plasma desktop environment
@davesteele
davesteele / curses_demo.py
Last active November 18, 2025 03:20
A Python asyncio curses template
#
# This file supports http://davesteele.github.io/development/2021/08/29/python-asyncio-curses/
#
import asyncio
from abc import ABC, abstractmethod
from curses import ERR, KEY_RESIZE, curs_set, wrapper
import _curses
@GabriOliv
GabriOliv / syscall_table_x86.md
Created February 28, 2021 21:16
Syscall Table x86 Linux for Assembly Programming

Syscall x86 Linux ASM

Extracted from W3Challs Syscalls

# Name eax ebx ecx edx esi edi ebp Definition
0 restart_syscall 0x00 - - - - - - kernel/signal.c:2501
1 exit 0x01 int error_code - - - - - kernel/exit.c:1095
2 fork 0x02 - - - - - - arch/x86/kernel/process.c:271
3 read 0x03 unsigned int fd char *buf size_t count - - - fs/read_write.c:460
@jirihnidek
jirihnidek / sub-sub-command.py
Last active September 12, 2025 19:04
Python example of using argparse sub-parser, sub-commands and sub-sub-commands
"""
Example of using sub-parser, sub-commands and sub-sub-commands :-)
"""
import argparse
def main(args):
"""
Just do something
@selimslab
selimslab / get_gists.py
Last active February 6, 2026 01:55 — forked from leoloobeek/get_gists.py
Download all gists of a user
import sys
from subprocess import call
import json
import os
import requests
def download_gists(gists: list):
for gist in gists:
call(["git", "clone", gist["git_pull_url"]])
" Specify a directory for plugins
call plug#begin('~/.vim/plugged')
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'scrooloose/nerdtree'
"Plug 'tsony-tsonev/nerdtree-git-plugin'
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'ryanoasis/vim-devicons'
Plug 'airblade/vim-gitgutter'