21votes
2answers
3.6kviews

CSS-only accordion that animates open using grid-template-rows 0fr to 1fr

The eternal problem: you can't transition height: auto, so every accordion prompt gives me either a JS height-measuring hack or a max-height guess that's either clipped or has a laggy delay when conte
21votes
1answers
3.4kviews

GPT prompt to scaffold a Next.js marketing site with sane structure, not one 800-line page.tsx

When I ask for a "Next.js landing page" I get everything crammed into one giant app/page.tsx with inline styles and no separation. Fine for a demo, painful the moment you want to edit the pricing sect
21votes
1answers
2.9kviews

Getting a chatbot to say 'I don't know' instead of confidently making things up

The hardest moment for any assistant I build is the one where it should admit it doesn't know. Left alone, models fill silence with fluent nonsense, and one confident fabrication costs more trust than
21votes
2answers
2.7kviews

Animated SVG flow-field lines that stay crisp at any zoom, seeded and hand-tuned

I love flow fields but canvas ones get blurry when someone zooms the page or exports to print. I wanted the same look as pure SVG paths so it stays vector-crisp forever. My naive prompt drew thousands
21votes
0answers
4.2kviews

Three.js solar system with orbit controls from a single prompt - sharing what finally worked

Getting a correct-feeling solar system out of one prompt is surprisingly hard: you either get planets orbiting at the same speed or a camera stuck inside the sun. This prompt gets the scale relationsh
21votes
1answers
2.8kviews

Accessible hover and focus states in one prompt, with a banned-patterns list

The recurring failure: models give me pretty hover effects that vanish for keyboard users, remove the focus outline "because it's ugly", or convey state with color alone. I got tired of fixing the sam
20votes
1answers
5.2kviews

Bounding concurrency in an asyncio scraper so I stop opening 5000 sockets at once

I asked for an async version of a fetcher and the model gleefully did await asyncio.gather([fetch(u) for u in urls]) over 5000 URLs. It opened every connection simultaneously, the event loop thrashed,
20votes
1answers
1.9kviews

Getting GPT to write clean fbm noise in GLSL without the hash function collapsing to bands

Whenever I asked for a fragment shader with fractal brownian motion I got a hash based on sin(dot(p, vec2(12.9898,78.233))) 43758.5453. It looks fine at small scale then produces visible diagonal band
20votes
2answers
3.1kviews

Prompt that turns a messy codebase into a README people actually finish reading

Our README was the usual wall: a paragraph of marketing, then npm install, then nothing. New hires bounced off it constantly. What finally worked was forcing the model to write for one specific reader
19votes
1answers
2.7kviews

Getting the model to write actually safe bash instead of a footgun with set -e

I kept getting shell scripts that looked fine and then nuked a directory because an unset variable expanded to empty and rm -rf "$DIR/" became rm -rf /. Adding set -e alone is a trap: it silently does
19votes
1answers
2.9kviews

How I get GPT to scaffold a whole repo (folder tree contract) instead of a single file dump

0-to-1 is my whole thing, so I want the model to lay down a real repo I can take the wheel on, not one 600-line file I have to explode by hand. What finally worked was treating the folder tree as a si
19votes
1answers
3.4kviews

Context-engineering trick to fit a 40-file module in one prompt cheaply

I kept blowing my context budget dumping a whole module into Claude for a cross-cutting change. Pasting all 40 files raw cost a fortune and buried the model in noise, so its edits drifted from the par
18votes
2answers
2.0kviews

Choropleth of US counties with a projection and legend that don't lie

I was mapping a rate per county and the first output used Web Mercator, which visually inflates the northern counties and makes the whole map misleading for anything area-related. It also binned the d
18votes
1answers
2.4kviews

Prompt for procedural roguelike dungeons that don't have unreachable rooms

Doing a small browser roguelike at 2am and the generated dungeons kept producing rooms with no doors or whole sections cut off from the start. Classic naive procedural gen. Asking for "random rooms an
18votes
2answers
1.6kviews

Prompt for a dedup + latest-record SQL query using window functions with a self-check

Reporting handed me an events table with duplicate rows per entity (late-arriving data, at-least-once delivery) and I needed exactly the latest row per key. The naive GROUP BY + MAX(updatedat) approac