Skip to content

Instantly share code, notes, and snippets.

View johnowhitaker's full-sized avatar

Jonathan Whitaker johnowhitaker

View GitHub Profile
@johnowhitaker
johnowhitaker / fragrances_w_embeddings.json
Created September 25, 2025 20:50
Fragrance database with embeddings
This file has been truncated, but you can view the full file.
[{"name": "A Grove by the Sea \u2022 Arquiste", "url": "https://fumerie.com/arquiste/agrovebythesea", "fragrance_family_name": "Woods", "fragrance_family_url": "https://fumerie.com/fragrance-families/woods", "excerpt": "<div class=\"product-excerpt\"><p><strong>House </strong><a href=\"https://www.fumerie.com/arquiste\">Arquiste</a><br/><strong>Released</strong> 2024<br/><strong>Perfumer </strong><a href=\"https://fumerie.com/parfumeurs/rodrigo-flores-roux\">Rodrigo Flores-Roux</a><br/><strong>Fragrance Family </strong><a href=\"https://fumerie.com/fragrance-families/woods\">Woods</a><br/><strong>Notes</strong> Adriatic fig leaves, black olive, fleur de sel accord, Croatian clementine, Extra virgin olive oil accord, ripe fig fruit, thyme essence, rosemary essence, Mediterranean pine needle, fir balsam, Mediterranean cypress, red clay.</p><p><strong>Description</strong></p><p><strong>August 1508,</strong></p><p><strong>Lopud Island, Adriatic Sea.</strong></p><p>Lopud is an evergreen island with lush fig and ol
@johnowhitaker
johnowhitaker / fragrances_w_embeddings.json
Created September 25, 2025 20:49
Fragrance database with embeddings
This file has been truncated, but you can view the full file.
[{"name": "A Grove by the Sea \u2022 Arquiste", "url": "https://fumerie.com/arquiste/agrovebythesea", "fragrance_family_name": "Woods", "fragrance_family_url": "https://fumerie.com/fragrance-families/woods", "excerpt": "<div class=\"product-excerpt\"><p><strong>House </strong><a href=\"https://www.fumerie.com/arquiste\">Arquiste</a><br/><strong>Released</strong> 2024<br/><strong>Perfumer </strong><a href=\"https://fumerie.com/parfumeurs/rodrigo-flores-roux\">Rodrigo Flores-Roux</a><br/><strong>Fragrance Family </strong><a href=\"https://fumerie.com/fragrance-families/woods\">Woods</a><br/><strong>Notes</strong> Adriatic fig leaves, black olive, fleur de sel accord, Croatian clementine, Extra virgin olive oil accord, ripe fig fruit, thyme essence, rosemary essence, Mediterranean pine needle, fir balsam, Mediterranean cypress, red clay.</p><p><strong>Description</strong></p><p><strong>August 1508,</strong></p><p><strong>Lopud Island, Adriatic Sea.</strong></p><p>Lopud is an evergreen island with lush fig and ol
@johnowhitaker
johnowhitaker / custom.css
Created September 21, 2024 21:21
My Theme (WIP)
div#notebook {
font-family: sans-serif;
font-size: 13pt;
line-height: 170%;
color: #303030;
-webkit-font-smoothing: antialiased !important;
padding-top: 25px !important;
}
body,
div.body {
@johnowhitaker
johnowhitaker / min_p_demo.ipynb
Last active September 16, 2025 03:46
min_p sampling demo for https://youtu.be/GKt5rlDwKNI
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
let context = null;
let canvas = null;
let video = null;
let lastSendTime = 0;
const throttleInterval = 1000; // 1 second in milliseconds
let throttleTimeout = null;
let pendingData = false;
htmx.onLoad(elt => {
// Find and process the canvas element
import requests, json, glob
# Set up
api_key = ...
GPT_MODEL = "gpt-4-1106-preview"
# Read the wordlist and solution from a file
def get_words(idx=0):
files = sorted(glob.glob("connections_data/*.json"))
f = open(files[idx])
@johnowhitaker
johnowhitaker / draw.py
Created June 11, 2024 18:51
Canvas demo direct
from fasthtml.all import *
import anthropic, base64
client = anthropic.Anthropic(
api_key="your_key_here",
)
canvas_js = """
const canvas = document.getElementById('drawingCanvas');
const context = canvas.getContext('2d');
@johnowhitaker
johnowhitaker / draw.py
Last active July 30, 2024 14:45
Canvas demo polling
from fasthtml.all import *
import anthropic, base64, time
client = anthropic.Anthropic(
api_key="your_key_here",
)
canvas_js = """
const canvas = document.getElementById('drawingCanvas');
@johnowhitaker
johnowhitaker / app.py
Created May 30, 2024 21:53
No htmx todo app
from starlette.responses import FileResponse, RedirectResponse
from fastcore.utils import *
from fastcore.xml import *
from fasthtml import *
from sqlite_utils import Database
from fastlite import *
from fastlite.kw import *
db = Database('todos.db')
import requests, json, uuid
from starlette.responses import FileResponse, RedirectResponse
from fastcore.utils import *
from fastcore.xml import *
from fasthtml import *
from oauthlib.oauth2 import WebApplicationClient
# Secrets + URLs