Skip to content

Instantly share code, notes, and snippets.

View leodutra's full-sized avatar
🦙
Llama and other LLMs

Leo Dutra leodutra

🦙
Llama and other LLMs
View GitHub Profile
@leodutra
leodutra / omarchy-win-dual-boot.bash
Last active May 14, 2026 01:37
Omarchy + Windows 11 Dual Boot Guide (Separate Drives, Secure Boot, Limine) - 05/2026
#!/usr/bin/env bash
# =========================================================
# OMARCHY + WINDOWS SECURE BOOT GUIDE
# Limine + sbctl + Custom Keys
# =========================================================
#
# WHAT THIS DOES:
# - Enables Secure Boot on Omarchy
# - Keeps Windows bootable
@leodutra
leodutra / install-fabric-ai-arch.bash
Last active May 13, 2026 01:38
Install Fabric AI on Arch Linux
sudo pacman -S --needed base-devel git pkgconf cmake make gcc
# Install Paru
if ! command -v paru >/dev/null 2>&1; then
git clone https://aur.archlinux.org/paru.git
cd paru || exit
makepkg -si
fi
# Install Fabric AI + dependencies
@leodutra
leodutra / omarchy-dev-env.bash
Last active May 12, 2026 23:00
Minimal Omarchy Developer Environment Install
#!/usr/bin/env bash
# sets MAKEFLAGS in /etc/makepkg.conf
# so makepkg (AUR/package builds) uses all CPU cores minus one for faster compilation
sudo bash -c 'grep -q "^MAKEFLAGS=" /etc/makepkg.conf && sed -i "/^MAKEFLAGS=/c\MAKEFLAGS=\"-j$(( $(nproc) - 1 ))\"" /etc/makepkg.conf || echo "MAKEFLAGS=\"-j$(( $(nproc) - 1 ))\"" >> /etc/makepkg.conf'
# ------------------------------------------------------------
# Helpers
# ------------------------------------------------------------
zshrc_append() {
@leodutra
leodutra / rust-dev-env-install-arch.bash
Last active May 12, 2026 22:11
Rust Dev Env Install - 2026 - Arch Linux
#!/usr/bin/env bash
set -euo pipefail
# ============================================================
# Rust development environment bootstrap (Arch Linux + zsh)
# ============================================================
# ------------------------------------------------------------
# Helpers
# ------------------------------------------------------------
@leodutra
leodutra / rust-ubuntu-dev-env-2023.md
Last active May 1, 2026 03:21
Rust + Ubuntu Dev Env 2023 + utillities / tools / cli / plugins / cargo / components / sub commands

Install steps

# update the system
sudo apt update && sudo apt upgrade -y

# install minimal dev stuff
sudo apt install -y \
	build-essential \
	ca-certificates \
@leodutra
leodutra / enable-win-git-long-paths.md
Last active April 14, 2026 14:29
Enable long paths on Windows 11 or Windows 10 and Git

Enable Long Paths on Windows

Instructions for Windows 11 and Windows 10

Windows 11

Method 1: Registry Editor (Most Reliable)

  1. Press Win + R, type regedit, and press Enter
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  3. Find LongPathsEnabled (create it if missing as DWORD)
@leodutra
leodutra / llm-wiki.md
Created April 8, 2026 21:59 — 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.

@leodutra
leodutra / bitwise-hacks.js
Last active April 5, 2026 14:02
Fast Int Math + Bitwise Hacks For JavaScript
/**
* Bitwise Mathematics Utilities
*
* A collection of fast bitwise operations for integer mathematics.
* These functions prioritize performance over readability and should be used
* when micro-optimizations are critical (game engines, real-time applications).
*
* References:
* - http://michalbe.blogspot.com.br/2013/03/javascript-less-known-parts-bitwise.html
* - http://jsperf.com/bitwise-vs-math-object
@leodutra
leodutra / obsidian-linux.md
Last active April 5, 2026 14:01
Obsidian free sync using Google Drive on Ubuntu + Android

Ubuntu

Mount rclone sync

This config allows us to mount obsidian folder locally, preventing issues with Google Drive hashes

# create obsidian folder on Google Drive, then
# install rclone
curl https://rclone.org/install.sh | sudo bash
@leodutra
leodutra / getElementsByText.js
Last active March 12, 2026 21:15
Get DOM elements by text content
const getElementsByText = (text, parent) => {
if (!text) return []
const xpath = `//*[text()='${text}']`
const xpathResult = document.evaluate(
xpath,
parent || document,
null,
XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,
null
)