Developer Reference
Opinionated micro-docs. One right answer. Copy-paste ready.
Categories
Git
4
Version control commands, workflows, and common fixes
JavaScript
1
Language features, patterns, and runtime behavior
TypeScript
4
Type system, compiler options, and type-level programming
Node.js
8
Runtime APIs, module system, and server-side patterns
React
3
Components, hooks, state management, and rendering
CSS & Layout
3
Layout, selectors, responsive design, and visual effects
Linux & Shell
3
Command-line tools, scripting, and system administration
Recently Added
Fix "Cannot find module" with ES modules in Node.js
Node.js
Node.js ES modules require explicit file extensions in import paths.
Undo the last commit but keep the changes
Git
Reset the last commit while keeping all changes staged and ready to re-commit.
Array reduce: sum values and transform objects
JavaScript
Array.reduce() iterates an array and accumulates a single result.
Why useEffect runs twice in development and how to write it so that's fine
React
In development, Strict Mode mounts each component, unmounts it, and mounts it again, so an effect runs, cleans up, and runs once more.
Stash work in progress including new, untracked files
Git
git stash alone leaves new files behind.
Check an object against a type without losing its literal types
TypeScript
Use satisfies when you want the compiler to check a value against a type but keep the narrower type it inferred.
Run a TypeScript file with node and no build step
Node.js
Current Node runs .ts files by stripping the type annotations.
Reset a component's state when the thing it shows changes
React
Give the component a key tied to its subject.
Fail a Node script without cutting off its output
Node.js
Set process.exitCode and let the script end on its own.
Why position sticky isn't sticking
CSS & Layout
A sticky element needs an inset and a scrolling ancestor with no overflow other than visible in between.