Skip to content

Instantly share code, notes, and snippets.

View bradparks's full-sized avatar

Brad Parks bradparks

  • Fredericton, New Brunswick, Canada
View GitHub Profile
@bradparks
bradparks / microgpt.py
Created March 2, 2026 01:55 — forked from karpathy/microgpt.py
microgpt
"""
The most atomic way to train and run inference for a GPT in pure, dependency-free Python.
This file is the complete algorithm.
Everything else is just efficiency.
@karpathy
"""
import os # os.path.exists
import math # math.log, math.exp
@bradparks
bradparks / README.md
Created February 3, 2025 23:15 — forked from ackvf/README.md
Bookmarklets and script snippets
@bradparks
bradparks / transcribe.py
Created September 21, 2024 21:14 — forked from scpedicini/transcribe.py
Python Dictation Transcription Application
# This script will transcribe an audio file (mp3, wav, etc.) to text and then clean the text using a local LLM model.
# GETTING STARTED:
# 1. Install openai
# 2. Git clone a copy of ggerganov/whisper (https://github.com/ggerganov/whisper.cpp)
# 3. Build the whisper binary
# 4. Download the whisper model (largev2 is the most accurate for all languages, though the base model works pretty well for English).
# 5. Install ffmpeg
# 6. Install ollama (https://ollama.com/download)
# 7. Download an LLM model (https://ollama.com/library)
@bradparks
bradparks / pandoc.css
Created February 7, 2024 01:05 — forked from killercup/pandoc.css
Add this to your Pandoc HTML documents using `--css pandoc.css` to make them look more awesome. (Tested with Markdown and LaTeX.)
/*
* I add this to html files generated with pandoc.
*/
html {
font-size: 100%;
overflow-y: scroll;
-webkit-text-size-adjust: 100%;
-ms-text-size-adjust: 100%;
}
@bradparks
bradparks / bashfile
Created January 16, 2024 22:46 — forked from lwneal/bashfile
#!/usr/bin/echo calm down it's just a shebang
#!/bin/bash
# ^
# There's nothing magical about shebang (#!) lines- they just tell the shell which executable should be used to run this script
# The <<EOF syntax is called a heredoc (https://en.wikipedia.org/wiki/Here_document)
# It allows us to conveniently cat a large amount of text
# Let's use a heredoc to write the Dockerfile
cat >Dockerfile <<'EOF'
# syntax = docker/dockerfile:1.4.0
@bradparks
bradparks / Dockerfile
Created January 16, 2024 22:43 — forked from adtac/Dockerfile
#!/usr/bin/env docker run
#!/usr/bin/env -S bash -c "docker run -p 8080:8080 -it --rm \$(docker build --progress plain -f \$0 . 2>&1 | tee /dev/stderr | grep -oP 'sha256:[0-9a-f]*')"
# syntax = docker/dockerfile:1.4.0
FROM node:20
WORKDIR /root
RUN npm install sqlite3
@bradparks
bradparks / About Search.jpg
Created June 21, 2023 00:02 — forked from ryanlucas/About Search.jpg
Unlocking iPhone 8 iOS 11
About Search.jpg
@bradparks
bradparks / falsehoods-programming-time-list.md
Created September 2, 2022 12:18 — forked from timvisee/falsehoods-programming-time-list.md
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).