Vindaloo Javascript


Posted in Code, Javascript on Sep 25, 2018

Functions are fun. In most languages, you can pass them as a variable. You can declare them anonymously (lambdas), you can close them over variables (closures). In some languages, you can even execute them on a subset of parameters, and get back another function that takes the missing parameters. This is called currying. In this post, I explore how to implement a form of position-independent currying in Javascript.

git rebase -i --autosquash


Posted in Code, Git on Feb 26, 2016

Automatically place your git commit before another one in the rebase menu via a special commit message.

npm extraneous package


Posted in Code, Javascript on Feb 11, 2016

How to fix the npm "extraneous" package problem

PHP stream_filter_prepend cannot find iconv filters


Posted in Code, PHP on Feb 01, 2016

How to fix the "PHP stream_filter_prepend cannot find iconv filters" message in PHP

Laravel and the compiled.php file


Posted in Code, Laravel, PHP on Dec 18, 2014

To be more efficient, Laravel can optimize its files, by putting certain classes in `bootstrap/compiled.php` to allow the framework to load all of them in one go. The standard composer.json includes a call to `php artisan clear-compiled` as a post-update and post-install command, which has the effect of removing this file. Unfortunately if the updated files are incompatible with the old ones that were just replaced, this can lead to the following error:

Get a mysql replication running again ASAP


Posted in Code, MySQL on Dec 17, 2014

Sometimes, mysql replication fails, because of network problems, a reboot or what have you. The fastest way to get it running again is often to reinitialise the data completely. Here is how to do that.