Skip to content

Instantly share code, notes, and snippets.

View lucafregoso's full-sized avatar

Luca Fregoso lucafregoso

View GitHub Profile
@lucafregoso
lucafregoso / llm-wiki.md
Created July 11, 2026 16:29 — 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.

@lucafregoso
lucafregoso / Laravel Sail Setup.md
Created June 23, 2023 16:27 — forked from LaurenceRawlings/Laravel Sail Setup.md
Setup Laravel Sail from source control

Laravel Sail Setup

This is a simple script along with some useful information to help when setting up a Laravel Sail project that was cloned from source control. I made this because I could not find anywhere that explained how to do this and kept running into problems. The main issue was a problem with database authentication. It turns out that when the Docker volume is created for the database for the first time the password that is in the .env file is used, which I usually created after starting Sail for the first time. Another issue was not having access to the Sail binary to start the containers. This is solved by the script by installing the composer dependencies with a disposable container. If you follow the steps below in order you should not run into any issues. Feel free to leave a comment on this Gist if it could be improved.

How to use

@lucafregoso
lucafregoso / one-liners.md
Last active April 20, 2023 06:58
One Liners

Capitalize Text

    const capitalize = (str) => `${str.charAt(0).toUpperCase()}${str.slice(1)}`;

Calculate Percent

    const calculatePercent = (value, total) => Math.round((value / total) * 100)

Info:

  • area può essere frontend o adminhtml
  • router può essere standard o admin

Creazione modulo

  • creare cartella app/code/Vendor/Module
  • composer init
    {