Skip to content

Instantly share code, notes, and snippets.

@dryan
dryan / middleware.py
Created September 13, 2023 14:40
Django CSP Middleware
import random
import string
import typing
from django.conf import settings
# if you have a Report-To service, add it to settings.py along with
# adding ReportToMiddleware to settings.MIDDLEWARE
@veekaybee
veekaybee / normcore-llm.md
Last active October 22, 2025 08:37
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

@adrienbrault
adrienbrault / llama2-mac-gpu.sh
Last active April 8, 2025 13:49
Run Llama-2-13B-chat locally on your M1/M2 Mac with GPU inference. Uses 10GB RAM. UPDATE: see https://twitter.com/simonw/status/1691495807319674880?s=20
# Clone llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
# Build it
make clean
LLAMA_METAL=1 make
# Download model
export MODEL=llama-2-13b-chat.ggmlv3.q4_0.bin
@harkabeeparolus
harkabeeparolus / Typer_cheat_sheet.md
Last active August 28, 2025 13:29
Typer — my attempt at reference documentation
@kylemcdonald
kylemcdonald / function-calling.ipynb
Created June 14, 2023 01:10
Example of OpenAI function calling API to extract data from LAPD newsroom articles.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jbranchaud
jbranchaud / playwright-platforms.md
Last active January 21, 2025 09:03
Platforms that support running Playwright + Chromium
@kconner
kconner / macOS Internals.md
Last active October 21, 2025 15:03
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@snmishra
snmishra / Dockerfile
Last active April 29, 2023 17:54
Slimmed Playwright image
FROM node:18-slim as builder
ARG PLAYWRIGHT_VERSION
ARG PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
RUN npx playwright@${PLAYWRIGHT_VERSION} install chromium
FROM node:18-slim as runner
ARG PLAYWRIGHT_VERSION
ARG PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
COPY --from=builder /ms-playwright /ms-playwright
RUN npx playwright@${PLAYWRIGHT_VERSION} install-deps chromium
USER node
@ericflo
ericflo / lora.py
Last active April 30, 2023 03:58
import os
import json
import random
import textwrap
import re
import math
import torch
from torch import nn
from torch.utils.data import DataLoader, Dataset, IterableDataset
@tonybaloney
tonybaloney / tidy.sh
Last active April 22, 2023 20:17
tidy script
# Delete all forks that haven't been updated since 2020
gh auth refresh -h github.com -s delete_repo
gh search repos \
--owner tonybaloney \
--updated="<2020-01-01" \
--include-forks=only \
--limit 100 \
--json url \
--jq ".[] .url" \ | xargs -I {} gh repo delete {} --confirm