Uncategorized

  • PHP 5.6 verifies TLS peers by default, and old code notices

    PHP’s encrypted stream wrappers did not verify certificates. file_get_contents(‘https://…’) on 5.5 opened the connection, negotiated TLS and never checked who was on the other end, which made every…

  • $.each and forEach take their arguments in opposite orders

    $.each hands the callback the index first and the value second. Array.prototype.forEach hands it the value first and the index second. Both signatures are two arguments of convenient…

  • Laravel 4’s IoC container is the part worth keeping

    Most of what gets written about Laravel 4 is about the parts you see — routes, Blade, Eloquent. The piece that changed how I write plain PHP is…

  • Replacing 30 script tags with a Grunt build

    Thirty-one requests before the page could do anything, most of them under 2 KB. Concatenation in a declared order, source maps, and cache busting that proxies respect.

  • Gulp streams where Grunt writes temporary files

    Both tools drive the same underlying programs, so the choice is not about capability. The difference is that a Grunt task reads files from disk, does one thing…

  • wp db export handles a database phpMyAdmin gives up on

    phpMyAdmin exports a database inside a PHP request, so it is bounded by max_execution_time, memory_limit, the web server’s own timeout and the browser staying open. Somewhere around a…

  • The @ operator costs you even when nothing goes wrong

    The error suppression operator looks like a targeted silence — this one call, this one expected warning. It is neither targeted nor free. PHP implements it by saving…

  • array_filter with ARRAY_FILTER_USE_KEY, from 5.6

    array_filter() has always passed the value to the callback and never the key, so filtering an associative array by its keys meant building the predicate out of three…

  • $.ajaxSetup is global, and that is the whole problem

    $.ajaxSetup is the documented way to attach a CSRF token or an authentication header to every request, and it does exactly that — including requests made by jQuery…

  • A stopped container still exists until you remove it

    docker ps lists what is running, and after a fortnight of experiments it looks reassuringly short. The container that exited is not gone — its writable layer, its…