Skip to content

Instantly share code, notes, and snippets.

View allisoneer's full-sized avatar

Allison Durham allisoneer

View GitHub Profile
@trvswgnr
trvswgnr / fileContains.test.ts
Last active February 6, 2025 15:40
check if a file contains a specified phrase, without loading the entire file into memory
import { describe, it, expect, beforeAll, afterAll } from "bun:test";
import { fileContains, BoyerMooreSearcher } from "./fileContains";
import fs from "fs";
import path from "path";
describe("fileContains", () => {
const testDir = path.join(__dirname, "test-files");
beforeAll(() => {
if (!fs.existsSync(testDir)) {
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const exe = b.addExecutable(.{
.name = "ziglibsql",
.root_source_file = b.path("src/main.zig"),
@kalomaze
kalomaze / llm_samplers_explained.md
Last active November 13, 2025 17:49
LLM Samplers Explained

LLM Samplers Explained

Everytime a large language model makes predictions, all of the thousands of tokens in the vocabulary are assigned some degree of probability, from almost 0%, to almost 100%. There are different ways you can decide to choose from those predictions. This process is known as "sampling", and there are various strategies you can use which I will cover here.

OpenAI Samplers

Temperature

  • Temperature is a way to control the overall confidence of the model's scores (the logits). What this means is that, if you use a lower value than 1.0, the relative distance between the tokens will become larger (more deterministic), and if you use a larger value than 1.0, the relative distance between the tokens becomes smaller (less deterministic).
  • 1.0 Temperature is the original distribution that the model was trained to optimize for, since the scores remain the same.
  • Graph demonstration with voiceover: https://files.catbox.moe/6ht56x.mp4
@veekaybee
veekaybee / normcore-llm.md
Last active December 25, 2025 23:35
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@nelson-liu
nelson-liu / filtering-twitter.md
Created May 27, 2023 20:16
Filter the Twitter /home to only show tweets with arxiv links.
  1. Download an ad blocker that supports EasyList filtering syntax. I personally use uBlock Origin.

  2. Add the following custom filter to the extension:

twitter.com##[aria-label="Timeline: Your Home Timeline"] article:not(:has-text(/arxiv.org/i))
@jp1995
jp1995 / win11.xml
Created May 30, 2020 15:44
win11.xml
<!--
WARNING: THIS IS AN AUTO-GENERATED FILE. CHANGES TO IT ARE LIKELY TO BE
OVERWRITTEN AND LOST. Changes to this xml configuration should be made using:
virsh edit win11
or other application using the libvirt API.
-->
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
<name>win11</name>
<uuid>7fae6522-e62e-42be-890f-a65c8e742e8a</uuid>
@VNGXR
VNGXR / setup.sh
Last active January 6, 2023 07:56 — forked from MakiseKurisu/setup.sh
Proxmox VE 6 GPU Passthrough
#!/bin/bash
# Reference guides:
# https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVMF
# https://pve.proxmox.com/wiki/Pci_passthrough
# https://pve.proxmox.com/wiki/Nested_Virtualization
# Remember to turn on SVM in BIOS and disable CSM
# Update packages
@0chroma
0chroma / VFIO Setup Guide.md
Last active February 19, 2025 19:42
Windows 10 VFIO QEMU Setup

VFIO Setup Guide

I play games regularly, and the sad reality is that it forces me to use Windows on my desktop. There's a Linux installation on there, but rebooting into it is such a massive interruption that I usually just move over to my laptop for programming. Working on a laptop leads to all sorts of ergonomic issues, and it felt like a massive waste to not develop on the desktop hardware I invested so much in. So after extensively researching what the VFIO community has been doing, I've deleted my Windows installation and moved all my gaming into a virtual machine on a Linux host.

Normally VMs are too slow for gaming, but thanks to a feature called VFIO you can run games at near-native performance by passing graphics cards and USB controllers directly to a virtual machine. The only requirement is that your board supports IOMMU, which most modern systems have. In this guide I'll wal

@magnetikonline
magnetikonline / README.md
Last active April 29, 2024 23:45
PowerShell execute command (.exe) with arguments safely (e.g. with spaces).

PowerShell execute command with arguments safely

In my opinion this is the best way for executing external commands from PowerShell with arguments in a safe manner - via the use of an array to hold the arguments.

Consider this one a PowerShell gem to keep in the toolbox.

Note

The example below makes use of EchoArgs.exe - a small utility that simply echoes back arguments passed to it. Utility is part of the PowerShell Community Extensions, or the exe alone can be downloaded at https://ss64.com/ps/EchoArgs.exe.

Example