trolls.dev

The Night Shift · Department

Engineering

Technical decisions behind our products, with examples from the work.

32 essays filed here

  1. 01

    Almost every 'compress your PDF' tool writes the smaller file back over the one you fed it, and it does this at the exact moment you can least afford it: the twenty minutes before a deadline, when the file that's over the limit is also the only good copy you have. One click later the master is gone and the diminished version is wearing its name. Preflight refuses to work that way. It never touches the file you picked — it builds the optimized copy off to the side, verifies it, and lands it under a new name with an atomic rename, so the original stays bit-for-bit intact and the undo is always the file you started with.

    6 min read
  2. 02

    Most journaling apps put a sync button in settings, and the moment you write something down a copy of it leaves your hand — up a cell tower, into a server you'll never see, forked into a backup and an analytics event and a row in someone's database. Orbit doesn't have that button. We built the journal to stay on the glass in your palm, which means the most private thing you record has no journey to take and no elsewhere to leak from. The cost of that decision is real, and we paid it on purpose.

    6 min read
  3. 03

    You're a third of the way down the front page, thumb settling over a headline, when the wall changes and three new stories break in at the top. In a reader that just redraws the page, the column grows above you and everything you were reading slides down — your thumb comes down on a headline that wasn't there a second ago. The refresh did exactly its job and stole your place. The quiet, load-bearing trick in DReader is scroll anchoring: before the new stories land, note where the line under your thumb is; after they land, put it back. New goes in above the fold and waits behind a small count; the line you were reading never moves a pixel.

    7 min read
  4. 04

    You shipped on Monday, opened the dashboard by lunch, and the sign-up line was up. By Friday it had drifted back to nothing. Nobody touched the code in between — so which read was true? Both were, of the data they had. The early number sat inside an interval wide enough to hold a triumph and a dud at once, and every day of data narrowed that interval a little. This is the peeking problem, and it's why code-results makes you name the window before you ship, then reads it once, when it closes.

    7 min read
  5. 05

    You designed the whole thing on US Letter, so you think of the file as a Letter document. But a PDF has no single size — every page carries its own dimensions, and a submission gate measures all of them, not the one you're looking at. The page that fails is almost always one you never opened: an A4 export the template slipped in, a landscape exhibit, a scan at some odd millimetre. It looked uniform because page one was, and page one is what you saw. Preflight measures the file the way the gate does — every page's box, against the exact size required — names the outlier down to the millimetre, and, if the file is yours, fits it back to size without ever touching the original.

    6 min read
  6. 06

    A push notification is a favor the source does you: it rings the moment something changes so you never have to keep asking. The Drudge Report does no such favor — no push, no webhook, no 'since' cursor, nothing that will ever call DReader to say the wall just changed. So DReader has to knock. Knock too often and you're a nuisance on a page you don't own, and the news is barely fresher for it; knock too rarely and you're serving yesterday on a day that turned over an hour ago. The way out isn't a cleverer fixed number — it's letting the page set the pace: the same flurry of edits that makes the news worth refreshing is the page telling you to knock more often, and a quiet hour is it telling you to leave it alone.

    6 min read
  7. 07

    A PDF is supposed to look the same everywhere — but that promise only holds if the fonts ride inside the file. When a typeface isn't embedded, the reader's machine substitutes its nearest guess, and the substitute is almost never the same width. The text reflows, a line runs long, a paragraph spills onto a page that wasn't there, and the layout you approved arrives subtly broken. It looked right on your Mac because your Mac had the font. Preflight is built to catch the letters that stayed home — it reads the font dictionary, names every face that isn't embedded, and, if the file is yours, welds them in before it flies.

    6 min read
  8. 08

    Sign-ups had their worst week in months, so you shipped a fix. The next week recovered, and the room gave the fix the credit. But the worst week was, by definition, the point the number was most likely to bounce back from — the recovery was loaded into the timing before your code ever ran. This is regression to the mean, the quietest way a deploy takes credit for a rebound it had nothing to do with, and the only thing that can tell the fix apart from the bounce is a control that got no fix and recovered anyway.

    6 min read
  9. 09

    The simplest way to find motion in a video is to subtract one frame from the next: whatever changed, moved. It works beautifully until the camera itself moves — a traffic cam pans, a webcam gets bumped, wind leans a pole — and then everything changed, so by that logic everything moved. The whole frame lights up and the one car actually crossing the intersection is lost in a field of false alarms. Thyseus reads public cameras it doesn't control and can't hold still, so before it can trust that something moved, it has to work out how much of the change was the world and how much was the lens. The fix is to measure the camera's own motion first, cancel it, and only then ask what's left.

    6 min read
  10. 10

    The portal says 'no more than ten pages,' and yours comes back rejected at twelve — even though you wrote exactly ten. A page limit isn't a byte limit: there's no slider that squeezes twelve pages down to ten, and the pages that put you over are almost always ones you never tallied — a cover sheet the template prepended, a signature page a tool appended, a blank verso your export left behind. Preflight counts the file the way the gate does, before the gate does: it reads the real page count, tells you exactly how many over you are, marks the blank pages that are safe to drop, and never touches the original — so the page you didn't count doesn't cost you the whole submission.

    6 min read
  11. 11

    You ship a change, and conversion climbs nine percent. Then someone splits the number by cohort and finds the truth: new users converted worse, returning users converted worse, every segment converted worse. The total rose anyway — because the release quietly changed who showed up, not how well the product worked. It's Simpson's paradox, and it's the trap a single headline metric is built to walk you into. code-results reads the number the only way that can't lie to you: split, and weighted by the mix that actually moved.

    6 min read
  12. 12

    You never typed a password, but the submission portal calls your PDF 'secured' and turns it away. The lock was there before you touched the file — set by a scanner, an export preset, or a download you forgot was protected — and it lives in a dictionary your reader honors silently, so the file opens fine and looks done while quietly refusing to be read by anything automatic. Preflight reads that dictionary before the gate does: it names the lock, tells you exactly what it forbids, and — if the file is yours — hands you a clean copy while leaving the original untouched.

    6 min read
  13. 13

    Every compressor you've ever used returns a smaller file, and smaller feels like success — so nobody checks what the bytes came off of. They come off the parts that made it a document: the selectable text flattened to a picture, the crisp vectors rasterized, the trim box nudged a hair. You find out at the far end, when someone can't select a word or the print shop finds the page moved. Preflight treats a pass that breaks one of those seals as a failure, not a win. If it can't hit the target while keeping the text selectable, the geometry exact, and the result independently verifiable, it refuses — and hands you back your untouched original instead of a smaller file that's quietly ruined.

    6 min read
  14. 14

    Ship one thing on a quiet afternoon and the number that moves after it is yours to read. Ship two things twenty minutes apart and the lift has no owner — it belongs to both changes and neither, and any clean split you draw between them is a number you made up. The honest move isn't to guess which deploy earned the win. It's to notice that, for now, the question can't be answered — and to say so out loud instead of picking a winner.

    6 min read
  15. 15

    Look at the Drudge Report at nine, then again at nine-forty, and the whole wall looks new. Most of it isn't. The same stories get reworded, resized, and shuffled through the day, and the page never tells you which lines are genuinely new and which just changed clothes. The trick to reading it the way a person wishes they could is knowing that the headline is a costume and the link underneath it is the name — so that's what DReader diffs.

    6 min read
  16. 16

    Two PDFs sit side by side on your screen, pixel for pixel identical. One is a real document; the other is a photograph of one. You can't tell them apart by looking — until you press Cmd+A and one of them selects nothing at all. That gap between what a page looks like and what's actually under it is where filings get bounced, citations go missing, and a finished document quietly fails a requirement no one showed you. Preflight reads the layer, not the picture.

    6 min read
  17. 17

    You finish the document, you go to submit it, and a box you never think about turns you away: the file is 5.31 MB and the limit is 5.00. All the work is done and the last obstacle is arithmetic. The reason it stings is that the upload form deals in exact bytes while every tool you reach for deals in vibes — 'compress,' 'reduce size,' a hopeful slider. Preflight is built to close that gap: it measures the file against the exact ceiling, builds a copy that provably fits, and never once touches the original.

    6 min read
  18. 18

    Ship a change, watch the metric, and sometimes the line just… doesn't move. Most tools treat that as a non-event — no green arrow, nothing to celebrate, nothing to file. But a confirmed 'no effect' is a real result, and burying it is how a team pays twice: once to build the thing, and again to relearn that it did nothing. code-results stamps the flat line as a finding, not a gap.

    6 min read
  19. 19

    A map stitched from strangers' browser tabs covers exactly the ground someone happens to be pointing a tab at — and nothing else. The tempting bug is to smooth over the gaps, to let a quiet block read as a clear one. Thyseus does the opposite: it draws its blind spots as blind spots, because a dark square that means 'unwatched' is honest and a dark square that means 'clear' is a lie the map can't back up.

    6 min read
  20. 20

    Almost every content app is a room — furniture arranged to keep you sitting in it, measured by how long you stay. The Drudge Report is the opposite: an index whose entire purpose is to send you somewhere else. So DReader's real product was never the page you look at. It's the round trip — out to the story fast, and back to the exact spot you left, so the next headline is one tap away.

    6 min read
  21. 21

    A change is a trade, not a gift. You ship to move one metric, you watch that metric, it moves, and you call it a win — while the number you never instrumented quietly moves the other way. The bill goes unread because it was never on the screen. code-results reads every deploy against the whole handful a business would notice, so the win and the cost arrive together, on the same board.

    6 min read
  22. 22

    A live map reads like a snapshot of one instant. Thyseus's never is — it's stitched from strangers' browser tabs, each on its own delayed clock, reporting what they saw seconds apart and out of order. The honest half of a live map isn't drawing the dots; it's manufacturing a *now* out of many moments, and admitting the picture is always a little bit in the past.

    6 min read
  23. 23

    The answer to 'did it work?' isn't worth the same on Monday as it is three weeks later. Not because the number changes — because you do. The reason you shipped, the alternatives you weighed, the file you were nervous about: all of it decays out of memory on a curve. A verdict that arrives after the why is gone is a fact you can't act on. code-results is built to catch the answer while the reason is still lit.

    6 min read
  24. 24

    The Drudge Report says what matters not in its words but in its type — one headline set enormous, another flashed red, the rest filed small. That ranking is the editor's whole opinion, and it's the first thing a feed reader throws away. DReader's real job isn't fetching the links. It's carrying the emphasis across.

    6 min read
  25. 25

    A detector can tell you there's a car in the frame and draw a tidy box around it. That box is a claim about pixels, not about the world — column 412, row 380 is not a street corner. The interesting half of Thyseus is the geometry that turns a spot in a camera frame into a coordinate on a map, and why we run it in the same browser tab that saw the car.

    6 min read
  26. 26

    A modern news page makes you download a few megabytes to read a paragraph of headlines. The words — the thing you actually came for — are a rounding error in the bytes. DReader is what's left when you ship only the rounding error, and why that isn't a diet you can apply to the heavy page but a different object entirely.

    5 min read
  27. 27

    Sign-ups are up since you shipped. That feels like a win — but 'up' is a level, and a level is the one thing that can't tell you whether your change did anything. The real question is whether the line broke where your deploy landed, and that's a question of alignment, not analytics.

    5 min read
  28. 28

    A live map drawn by strangers' laptops has an obvious problem: why trust any single detection? A cheap model watching a rainy feed will call a truck a bus. Thyseus doesn't answer that by building a better observer. It answers it the way a newsroom does — by corroboration — and turning agreement into confidence is the part that makes the map real.

    6 min read
  29. 29

    The Drudge Report has no RSS, no API, no app, and no intention of adding any. It is hand-edited HTML that changes dozens of times a day. DReader has to read it the way a person does — by looking at the page — and that constraint, not the styling, is the whole engineering problem.

    5 min read
  30. 30

    Thyseus combines public camera feeds with object detection in volunteers' browsers. Each tab processes video locally and sends detections to a shared map.

    3 min read
  31. 31

    code-results puts deploys alongside business metrics so the team that shipped a change can see what happened afterward, with a clear distinction between correlation and causation.

    3 min read
  32. 32

    Our homepage hid its headline until a 312KB JavaScript bundle ran. We removed the bundle and made the page visible by default, with CSS and small inline scripts handling the motion.

    3 min read