Skip to content

Instantly share code, notes, and snippets.

View ffakenz's full-sized avatar
🐺
Delivering Impact

Franco Testagrossa ffakenz

🐺
Delivering Impact
View GitHub Profile
@ffakenz
ffakenz / llm-wiki.md
Created April 5, 2026 23:15 — 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.

@ffakenz
ffakenz / LibsPrometheus.sol
Last active February 2, 2022 08:28
Solidity Libs for Prometheus
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.11;
library LibPrimaryMarket {
struct PrimaryMarket {
uint id; // unique market id (autoincrement)
uint createdAt; // date of creation
uint updatedAt; // date of last update
uint startAt; // date to start
uint finishAt; // date to finish
@ffakenz
ffakenz / TVarMemoization.hs
Created July 26, 2020 21:24
Memoized Factorial with TVar
import GHC.Conc
import Data.Maybe
import qualified Data.Map as M
factorial :: Int -> TVar (M.Map Int Int) -> STM Int
factorial 0 tVar = return 1
factorial n tVar = do
map <- readTVar tVar
if (M.member n map) then do
let value = fromJust $ M.lookup n map
@ffakenz
ffakenz / MVarMemoization.hs
Last active July 26, 2020 13:36
Memoized Factorial with MVar
import Control.Concurrent
import Data.Maybe
import qualified Data.Map as M
factorial :: Int -> MVar (M.Map Int Int) -> IO Int
factorial 0 mVar = return 1
factorial n mVar = do
map <- takeMVar mVar
if (M.member n map) then do
putMVar mVar map
@ffakenz
ffakenz / embeddingJSON.svg
Created April 22, 2018 16:38
Embedding JSON variable into JS using JSP
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ffakenz
ffakenz / functor.scala
Created February 22, 2018 21:02
Playing around with Functors
trait Functor[A, F[_]] {
def mymap[B](f: A => B)(t: F[A]):F[B]
}
object Functor {
implicit def ListFunctor[A] = new Functor[A, List] {
def mymap[B](f: A => B)(t: List[A]) :List[B] = t match {
case Nil => Nil
case x :: xs => f(x) :: mymap(f)(xs)
// build.sbt => libraryDependencies += "org.scala-lang.modules" %% "scala-parser-combinators" % "1.0.6"
import scala.util.parsing.combinator._
case class GetEquipment(btsNumber: Int, equipment: String, equipmentNumber: Int) {
val equipmentType = equipment match {
case "BCP" => "BBU"
case "RRH" => "RRH"
}
package object stackoverflow {
type Question = Posting
type Answer = Posting
type QID = Int
type HighScore = Int
type LangIndex = Int
}
object Something extends App {
trait DoorStatus