This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Replicates what RubyUI's Rails install generator wires up, but for a plain | |
| # Ruby process: make `RubyUI` a Phlex Kit, then load every component file. | |
| require "date" | |
| require "phlex" | |
| require "tailwind_merge" | |
| module RubyUI | |
| extend Phlex::Kit | |
| end |
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:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * 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). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "informers" | |
| MODEL = "Snowflake/snowflake-arctic-embed-s" | |
| embedder = Informers.pipeline( | |
| "embedding", | |
| MODEL, | |
| dtype: "int8", | |
| device: "cpu", | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import TinyTTS from 'tiny-tts'; | |
| const tts = new TinyTTS(); | |
| await tts.speak('Hello, welcome to Node Weekly.', { | |
| output: 'output.wav', | |
| }); | |
| await tts.dispose(); |
NewerOlder
