Desk Clarity

A field guide to everyday digital problems.

The guidebook / 181 guides

Developer tools

Code, configuration and workflows. Source-linked checks to help you move forward.

Developer tools · GUIDE

Git Amend No-Edit Still Changes History: Understand a Rejected Push

Keep a message unchanged while recognizing that amend creates a replacement commit.

3 min readSource-linked guide
Developer tools · GUIDE

npm Missing Script Build: Check the Package Before Adding a Command

Find the intended package scripts and workspace rather than inventing a build step.

2 min readSource-linked guide
Developer tools · GUIDE

jq Slurp Creates One Array per Run: Replace a Snapshot Instead of Appending

Convert a stream of JSON objects into one valid array and keep repeated updates valid.

3 min readSource-linked guide
Developer tools · GUIDE

Node maxBuffer Exceeded: Bound a Result or Stream the Output

Choose buffered completion or incremental consumption for child-process output.

2 min readSource-linked guide
Developer tools · GUIDE

Git Cherry-Pick Is Empty: Inspect the Result Before Skipping

Distinguish an already-present change from an intentional empty audit commit.

3 min readSource-linked guide
Developer tools · GUIDE

Git Remote Origin Already Exists: Change the URL or Add a Second Remote

Inspect fetch and push destinations before changing an existing remote name.

2 min readSource-linked guide
Developer tools · GUIDE

Python Parse Qs Drops Empty Values: Preserve Blanks and Repeated Keys Explicitly

A query parameter with an empty value disappears from the parsed mapping.

2 min readSource-linked guide
Developer tools · GUIDE

Python Deque Maxlen Drops Old Items: Choose a Rolling Window or a Work Queue

A bounded deque silently loses older entries when new items are appended.

2 min readSource-linked guide
Developer tools · GUIDE

Python Contextmanager Generator Did Not Stop: Yield Once and Put Retries Outside

A generator-based context manager tries to yield another resource after an error inside the with block.

2 min readSource-linked guide
Developer tools · GUIDE

Python Multiprocessing Bootstrapping Error: Keep Process Creation Behind the Main Guard

A spawned child imports the main module and reaches process startup again before initialization finishes.

2 min readSource-linked guide
Developer tools · GUIDE

Python Pathlib Treats Tilde as a Folder Name: Expand the Home Path Explicitly

Path("~/file") does not automatically select the current user home directory.

2 min readSource-linked guide
Developer tools · GUIDE

Python Logging Prints Twice: Inspect Handler Placement and Propagation

One logging call produces duplicate output because the same record reaches handlers on a logger and its ancestors.

2 min readSource-linked guide
Developer tools · GUIDE

Python Argparse Type List Produces Characters: Use Nargs or Append for Multiple Values

A command-line option returns characters instead of a list of file arguments.

2 min readSource-linked guide
Developer tools · GUIDE

Python Defaultdict Get Returns None: Missing Defaults Apply to Indexing

A defaultdict factory works with brackets but not with get. Choose whether lookup should create a key.

2 min readSource-linked guide
Developer tools · GUIDE

Python Cached Property Stays Stale After a Change: Invalidate the Instance Attribute

A cached property does not recalculate when the fields used to compute it change.

2 min readSource-linked guide
Developer tools · GUIDE

Python Gzip Bytes Change for Identical Content: Set Timestamp and Compression Level Explicitly

A checksum changes although decompression yields identical data. Inspect container metadata and compressor settings.

2 min readSource-linked guide
Developer tools · GUIDE

Python StringIO Getvalue Fails After Close: Capture the Result Before Ownership Ends

A writer or context manager closes an in-memory stream before the caller retrieves its text.

2 min readSource-linked guide
Developer tools · GUIDE

Python Bisect Key Raises TypeError: Pass a Search Key, Not a Record

bisect_left with a key function compares an extracted key to the supplied search value.

2 min readSource-linked guide