Skip to content

Instantly share code, notes, and snippets.

View joshuadavidthomas's full-sized avatar

Josh Thomas joshuadavidthomas

View GitHub Profile
@djm
djm / .envrc
Created September 20, 2022 23:17
YunoJuno Nix Developer Environment
export OP_ACCOUNT=yunojuno.1password.com
# Create .env.local if it does not exist
if [ ! -f .env.local ]
then
echo "Creating .env.local"
cat <<EOF > .env.local
# Place secret env variables from 1Password and custom overrides here
#
# Any variables here will override ones set in .env.native.dist
@randerzander
randerzander / football.css
Last active December 24, 2024 11:20
Terminal UI for displaying live college or nfl game status
Game {
height: 3;
width: 50%;
}
import { reactive } from '@vue/reactivity'
function switchboard(value) {
let lookup = {}
let current
let get = () => current
let set = (newValue) => {
# myapp/management/commands/make_smoke_tests.py
from django.core.management.base import BaseCommand
from django.urls import get_resolver, URLPattern, URLResolver
import re
import os
class Command(BaseCommand):
help = 'Generates smoke tests for projects.'
def add_arguments(self, parser):
Postgres Internals
Djangocon US 2024
Elizabeth Christensen
## psql basics
--whoami
\conninfo
--user list
@marksweb
marksweb / conftest.py
Created August 2, 2025 10:01
Models as pytest fixtures
from django.apps import apps
def create_model_fixture(model):
"""
This injects the model names as fixtures.
eg def test_something(MyModel):
will make the `MyModel` available in a test.
"""
@steipete
steipete / agent.md
Created October 14, 2025 14:41
Agent rules for git
  • Delete unused or obsolete files when your changes make them irrelevant (refactors, feature removals, etc.), and revert files only when the change is yours or explicitly requested. If a git operation leaves you unsure about other agents' in-flight work, stop and coordinate instead of deleting.
  • Before attempting to delete a file to resolve a local type/lint failure, stop and ask the user. Other agents are often editing adjacent files; deleting their work to silence an error is never acceptable without explicit approval.
  • NEVER edit .env or any environment variable files—only the user may change them.
  • Coordinate with other agents before removing their in-progress edits—don't revert or delete work you didn't author unless everyone agrees.
  • Moving/renaming and restoring files is allowed.
  • ABSOLUTELY NEVER run destructive git operations (e.g., git reset --hard, rm, git checkout/git restore to an older commit) unless the user gives an explicit, written instruction in this conversation. Treat t
"""
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