Skip to content

Instantly share code, notes, and snippets.

View huntabyte's full-sized avatar

Hunter Johnston huntabyte

View GitHub Profile
@huntabyte
huntabyte / model-prices.csv
Created May 2, 2025 05:05 — forked from t3dotgg/model-prices.csv
Rough list of popular AI models and the cost to use them (cost is per 1m tokens)
Name Input Output
Gemini 2.0 Flash-Lite $0.075 $0.30
Mistral 3.1 Small $0.10 $0.30
Gemini 2.0 Flash $0.10 $0.40
ChatGPT 4.1-nano $0.10 $0.40
DeepSeek v3 (old) $0.14 $0.28
ChatGPT 4o-mini $0.15 $0.60
DeepSeek v3 $0.27 $1.10
Grok 3-mini $0.30 $0.50
ChatGPT 4.1-mini $0.40 $1.60
@huntabyte
huntabyte / seed.sql
Created April 7, 2024 16:50
Seeding User Records into Supabase
-- supabase/seed.sql
--
-- create test users
INSERT INTO
auth.users (
instance_id,
id,
aud,
role,
email,
@huntabyte
huntabyte / .eslintrc.cjs
Created October 25, 2023 22:17
Svelte eslint config
module.exports = {
root: true,
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:svelte/recommended",
"prettier"
],
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
@huntabyte
huntabyte / adapter-session-upstash-redis.ts
Last active March 12, 2023 19:01
Lucia Auth Upstash Redis Adapter
import type { SessionSchema, SessionAdapter, AdapterFunction } from 'lucia-auth'
import type { Redis } from '@upstash/redis'
const adapter =
(redisClient: { session: Redis; userSession: Redis }): AdapterFunction<SessionAdapter> =>
() => {
const { session: sessionRedis, userSession: userSessionRedis } = redisClient
const sessionPrefix = 'lucia:session'
const userSessionPrefix = 'lucia:user:session'
return {
@huntabyte
huntabyte / markdown.ts
Created March 11, 2023 19:31
Custom shiki markdown parser that handles attributes for title, language, highlighting, adding, removing, and focusing lines.
import markdown from 'markdown-it'
import shiki, { type Highlighter } from 'shiki'
import type { ElementsOptions, IThemedToken, LineOption } from './types/shiki.types'
export async function compileMarkdown(body: string): Promise<string> {
const highlighter = await getHighlighter()
const md = markdown({
html: true,
highlight: (code, lang, attrs) => {
const metaData = parseCodeMetaData(attrs)
@huntabyte
huntabyte / .zshrc
Created January 22, 2023 16:09
Huntabyte's zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH