Skip to content

Instantly share code, notes, and snippets.

@montasaurus
montasaurus / llmc.sh
Last active August 21, 2024 07:47
AI Shell Command Generator
llmc() {
local system_prompt='Output a command that I can run in a ZSH terminal on macOS to accomplish the following task. Try to make the command self-documenting, using the long version of flags where possible. Output the command first enclosed in a "```zsh" codeblock followed by a concise explanation of how it accomplishes it.'
local temp_file=$(mktemp)
local capturing=true
local command_buffer=""
local first_line=true
local cleaned_up=false # Flag to indicate whether cleanup has been run
cleanup() {
# Only run cleanup if it hasn't been done yet
@montasaurus
montasaurus / appleid_auth.py
Created September 24, 2024 17:29
Parse and validate a Sign In with Apple ID JWT token in Python. Works as a CLI to test tokens with `uv run appleid_auth.py`
# /// script
# dependencies = [
# "httpx",
# "pyjwt[crypto]",
# ]
# ///
from dataclasses import dataclass
from datetime import timedelta
from typing import Any