| // A macOS GUI app written in pure C, using the Objective-C runtime directly. | |
| // No Objective-C syntax anywhere. Just raw objc_msgSend and runtime calls. | |
| // This is cursed. Enjoy. | |
| // Compile with clang -Wall -Wextra -o hello_runtime hello_runtime.c \ | |
| // -framework Cocoa -lobjc | |
| #include <objc/objc.h> | |
| #include <objc/message.h> | |
| #include <objc/runtime.h> |
A compact contract for CLIs that humans can use (good UX) and machines can trust (predictable behavior, stable output).
Use when designing, implementing, or reviewing command-line tools, especially CLIs that need reliable automation behavior, stable machine-readable output, safe mutation semantics, or good terminal UX.
When building or reviewing a CLI:
- First classify it by capability/risk dimensions:
| /* | |
| * fakedis_server.cpp | |
| * | |
| * A vibe-coded (Codex) Redis server implementation in C++. | |
| * Or: A TERRIBLE THING MADE JUST TO SEE HOW LONG IT WOULD TAKE AND HOW BAD | |
| * IT WOULD BE. | |
| * | |
| * This is a vibe-coded C++ Redis lookalike built with one goal: pass | |
| * the Redis 2.0 compatibility test suite. And it does. But it's not a | |
| * Redis replacement (plus 2.0 is ancient anyway - it's up to like 8.2 now). |
| // drop | |
| // | |
| // A dependency-free Bun web app for short-lived file sharing. It serves a | |
| // drag-and-drop page, accepts SVG, PNG, PDF, GIF, WEBP, and JPEG uploads after | |
| // detecting the file type from contents, stores each upload in /tmp/images under | |
| // a random UUID filename, and deletes stored files after 5 minutes. The storage | |
| // directory is capped at 1 GB by deleting the oldest files first, and is kept at | |
| // 0700 so only the app's Unix user can inspect stored files directly. | |
| // | |
| // Run: |
You are a 'thinking agent'. Instead of answering queries directly and quickly, you engage in a protracted period of thought in .. tags where you riff on how you might answer the query, what facts or context you need to take into account, and what would go into a good answer. Your answer will then follow, based upon the ideas that arose during your thinking. It is important that you query yourself and second guess your thinking in order to extract new thoughts, approaches, and engage in reflection to ensure you reach the best level of thinking for your eventual answer. Your thinking should read in the first person in the way that a person may think in terms of an internal monologue. For example, you might start by thinking 'Ok, so I need to...' and go through processes where you think like 'I guess that..' or 'Maybe I should..' in order to surface new ideas and considerations. If you are unsure about anything, do not guess or fabricate facts you are unsure of. You are allowed to be uncertain a
| #!/bin/bash | |
| # Ingest new Maildir messages into ~/mail.db, then delete the files. | |
| # | |
| # schedule in cron with something like: | |
| # * * * * * /home/exedev/bin/fetch-mail.sh >> /home/exedev/.fetch-mail.log 2>&1 | |
| set -euo pipefail | |
| DB="$HOME/mail.db" | |
| NEW="$HOME/Maildir/new" | |
| LOCK="$HOME/.fetch-mail.lock" |
| """Reusable LED control for the Akai MPD218 over USB MIDI. | |
| from mpd218 import pad_on, pad_off, all_on, all_off | |
| pad_on(13) # light pad 13 | |
| pad_off(13) | |
| all_on(); all_off() | |
| Pad indices are 1..16 (bottom-left = 1, top-right = 16, matching the device's default | |
| note mapping of pads 1..16 -> MIDI notes 36..51 on channel 10). | |
| """ |
You are a coding agent on macOS. Your job is to set up an environment where you can build NES (Nintendo Entertainment System) ROMs in C, run them in an emulator, and drive that emulator from the command line so you can iterate without a human pressing buttons. Aim for the state described below; report back at each milestone with what you did and what is verified.
By the end you should have:
- An emulator running. FCEUX 2.6+ installed and able to load
.nesROMs. It exposes a Lua scripting API; that API is how you will control it programmatically. - A C toolchain for the 6502.
cc65(which providescc65,ca65,ld65,cl65) and a copy of Shiru/clbr's NESLib, a small C-callable helper library that wraps the bits of the NES hardware most games need (palettes, sprites, controllers, PPU, frame waits, optional famitone2 audio).
| require "informers" | |
| MODEL = "Snowflake/snowflake-arctic-embed-s" | |
| embedder = Informers.pipeline( | |
| "embedding", | |
| MODEL, | |
| dtype: "int8", | |
| device: "cpu", | |
| ) |
