Skip to content

Instantly share code, notes, and snippets.

View msvargas's full-sized avatar

msvargas msvargas

  • Bucaramanga, Colombia
View GitHub Profile
@msvargas
msvargas / llm-wiki.md
Created April 6, 2026 23:53 — 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.

@msvargas
msvargas / import2lazy.js
Last active October 28, 2022 15:20
Import to React Lazy
const { execSync } = require('child_process');
const os = require('os');
const path = require('path');
const fs = require('fs');
const tempFile = path.resolve(os.tmpdir(), 'importFile.js');
const IMPORT_REGEX = /import\s+(\S+)\s+from\s+['|"](\S+)['|"]/gm;
let result;
let output = '';
@msvargas
msvargas / axios.refresh_token.1.js
Created September 7, 2020 16:05 — forked from Godofbrowser/axios.refresh_token.1.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
@msvargas
msvargas / Base64.ts
Last active November 16, 2021 07:41
Signature Pad component with react-native-svg
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
const Base64 = {
btoa: (input: string = '') => {
let str = input;
let output = '';
for (
let block = 0, charCode, i = 0, map = chars;
str.charAt(i | 0) || ((map = '='), i % 1);
output += map.charAt(63 & (block >> (8 - (i % 1) * 8)))
"use strict";
/* qr.js -- QR code generator in Javascript (revision 2011-01-19)
* Written by Kang Seonghoon <public+qrjs@mearie.org>.
*
* This source code is in the public domain; if your jurisdiction does not
* recognize the public domain the terms of Creative Commons CC0 license
* apply. In the other words, you can always do what you want.
*/
// per-version information (cf. JIS X 0510:2004 pp. 30--36, 71)