Uncategorized

  • Idempotency keys, and where they have to be stored

    A client that times out and retries has sent the same request twice, and the server cannot tell whether the first one succeeded. The key makes the retry…

  • docker system prune, and the disk it gives back

    A development machine that builds images daily accumulates dangling layers, stopped containers and orphaned volumes, and none of it is visible until the disk fills. -a –volumes is…

  • PHPStan 0.10 and the level that is worth stopping at

    Levels 0 to 2 are free — every finding is a name that does not resolve. Level 3 is the first that asks for information the codebase does…

  • ROW_NUMBER, RANK and DENSE_RANK differ where it matters

    All three number rows within a partition and they disagree about ties, which is invisible in test data where nothing ties and obvious in production where everything does.…

  • The dump-server keeps var_dump out of the response

    Dumping from inside a JSON endpoint, a queue worker or a middleware corrupts the output you were trying to inspect, so the debugging tool destroys the thing being…

  • Promise.finally is the one everyone wrote by hand

    Turning off a loading spinner has to happen on both the success and the failure path, so it got duplicated into then and catch, and one of the…

  • hash_hmac is the one to reach for, not hash

    Signing a payload by hashing the secret and the message together is a construction with known weaknesses, and it keeps getting written because it looks obviously correct. HMAC…

  • A meta_query is a join, and it shows

    Every meta key in a meta_query adds a join to wp_postmeta, and that table has one row per key per post with an index that was designed for…

  • Collections lazily, with chunk and cursor

    Model::all() on a table with four hundred thousand rows hydrates four hundred thousand objects and then the process dies, having done nothing. chunkById rather than chunk is the…

  • Bootstrap 4 dropped the float grid

    Two and a half years in alpha, and the grid is flexbox now. The class renames are mechanical; the ones that changed meaning rather than name are not.