Skip to content

Instantly share code, notes, and snippets.

View twmbx's full-sized avatar
🇿🇲

Twaambo Haamucenje twmbx

🇿🇲
View GitHub Profile
@twmbx
twmbx / llm-wiki.md
Created June 18, 2026 06:14 — forked from karpathy/llm-wiki.md
llm-wiki

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.

@twmbx
twmbx / wc-delete-all-products.sql
Created April 21, 2021 08:18
WooCommerce Delete All Products, Product Attachments and custom Product Attributes
-- Products
DELETE relations.*, taxes.*, terms.*
FROM wp_term_relationships AS relations
INNER JOIN wp_term_taxonomy AS taxes
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
INNER JOIN wp_terms AS terms
ON taxes.term_id=terms.term_id
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type='product');
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type = 'product');
DELETE FROM wp_posts WHERE post_type = 'product';
@twmbx
twmbx / ffmpeg.sh
Created April 19, 2020 20:33
FFMPEG complex Video Trim
# cut out parts of a video by splitting it into parts delineated by seconds
# then combining them to create a single video
# example splits into 4 and then combines.
ffmpeg -i input-video.ext -filter_complex "
[0:v]split=4[vc1][vc2][vc3][vc4],
[vc1]trim=00:911,setpts=PTS-STARTPTS[v1],
[vc2]trim=974:2971,setpts=PTS-STARTPTS[v2],
[vc3]trim=2997:5129,setpts=PTS-STARTPTS[v3],
@twmbx
twmbx / App.svelte
Created May 15, 2019 13:58
Svelte Twitter Tweet Box
<script>
let message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit';
let messageCounter;
let buttonState;
let counterState;
$: message;
$: messageCounter = calcCounter(message);
$: buttonState = getButtonState(messageCounter);
$: counterState = getCounterState(messageCounter);
@twmbx
twmbx / useful-wp-stuff.md
Last active October 21, 2025 14:30
Useful WordPress Stuff
@twmbx
twmbx / routes.php
Created January 4, 2018 10:23 — forked from fhferreira/routes.php
Logout of Auth Basic on Laravel
<?php
Route::get('logout-basic', function() {
return Redirect::to(preg_replace("/:\/\//", "://log-me-out:fake-pwd@", url('/')));
});
@twmbx
twmbx / vanilla-ajax-poll.js
Last active February 6, 2023 14:57
Polling in JS with an async ajax call that returns a promise ( modified from: https://davidwalsh.name/javascript-polling )
// The polling function
function poll(fn, timeout, interval) {
var endTime = Number(new Date()) + (timeout || 2000);
interval = interval || 100;
var checkCondition = function(resolve, reject) {
var ajax = fn();
// dive into the ajax promise
ajax.then( function(response){
// If the condition is met, we're done!
@twmbx
twmbx / CockroachAdapter.php
Last active July 20, 2017 14:10
Phinx: Cockroach (Postgres) Adapter ( Cockroach DB Fixes )
<?php
/**
* Phinx
*
* (The MIT license)
* Copyright (c) 2015 Rob Morgan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated * documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
@twmbx
twmbx / PdoAdapter.php
Last active July 20, 2017 14:05
Phinx: PDO Adapter ( Cockroach DB Fixes)
<?php
/**
* Phinx
*
* (The MIT license)
* Copyright (c) 2015 Rob Morgan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated * documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
@twmbx
twmbx / database.sql
Created May 31, 2017 10:30
Example schema for directus 6.4rc testing
-- MySQL dump 10.15 Distrib 10.0.29-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: localhost
-- ------------------------------------------------------
-- Server version 10.0.29-MariaDB-0ubuntu0.16.04.1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;