Prem Poddar

Writing

How my apps work on the inside. Each post takes one app apart: the problem it solves, the code that does the hard part, and where it still falls short.

Follow with RSS

CaffeinateCat

Keeping a Mac awake with the lid closed, without leaving it broken

Why lid-closed mode needs root, how CaffeinateCat asks for it once for exactly two commands, and the five separate things that make sure your Mac can always sleep again.

6 min read

  1. OAF

    How OAF opens almost any file, and saves without breaking it

    Detecting file types from their bytes instead of their names, a spreadsheet engine with loop detection, and why OAF patches Word and Excel files instead of rewriting them.

    6 min read

  2. Loadstone

    An arrow that admits when it doesn't know

    How Loadstone turns noisy GPS into a pin with an honest radius, keeps a compass arrow steady without making it slow, and fits a place on Earth into seven silly words.

    8 min read

  3. Brewlight

    Searching 16,000 packages in 3 ms per keystroke

    How Brewlight's search works, from byte buffers shaped so every kind of match is one memmem call, to a ranking packed into a single integer, to opening instantly by not asking brew.

    6 min read

  4. Duet

    Eight phones, one song, the same millisecond

    How Duet finds other phones with six words and no server, estimates another phone's clock the way NTP does, and keeps playback in step by easing speed instead of jumping.

    6 min read

  5. LibreChat

    A messenger where the phones are the network

    How LibreChat floods messages across a Bluetooth mesh, holds them for a day when there's no path yet, and starts Signal-style encrypted chats with no server to hand out keys.

    7 min read

  6. Campfire

    A chat server that fits in your pocket

    How Campfire runs a Ktor server on one phone for everyone nearby, keeps every chat rule in one class that never touches a socket, and stops a pasted link from probing your router.

    6 min read