I always wanted to write those awesome, informative blog posts, but it turns out I hardly have time for that.
You can find some of my pre 2016 stuff on my old blog. New things are most likely going to be posted to Medium and listed below.

Dump all keys stored in redis


Dump all keys stored in redis

redis-cli KEYS \* |xargs -n 1 -P8 redis-cli dump

Such a facepalm moment.


Such a facepalm moment.

David, how do you handle missing PHP extensions when using dockerised composer?


David, how do you handle missing PHP extensions when using dockerised composer?
Is there a better solution than customising composer image to include any and all required?

PhalconPHP: Volt — generate url for named route with params


This is a quick example of how to generate url from a named route that requires params in Volt templating engine.

Your route declaration:

‘controller’ => ‘auth’,
‘action’ => ‘complete’,

Template tag to display the url (this assumes that the template is receiving a key ‘giud’ in the $params:

{{ url.get([‘for’: ‘register-complete’, ‘guid’: guid]) }}

PHPStorm remote interpreter — docker on Ubuntu


I keep forgetting what the set up is for remote interpreter.

window: CLI Interpreters (click +)
Name: <give it a name>
Remote: docker
Server: Click on “New…” — window: Configure Remote PHP Interpreter
1. Server: Click on “New…” — window: Docker
 — Name: Local Docker
 — API URL: unix://var/tmp/docker.sock
 — Docker Compose executable: docker-compose

2. Image Name: <pick php image>
3. PHP Interpreter Path: <usually php should just work>

Building Angular2 app for production


A few different ideas. One is bound to work ;)

Good Bye SublimeText, hello PhpStorm


It has been a long and great relationship, nah just kidding. As much as I like vim and I had set up Sublime and all the modules to almost perfection, in the end the PhpStorm is simply better. Yes, the cost of ownership is higher, but thanks to that it is a more polished product.
You will find people claiming that it is just a text editor and not a IDE, but those people most likely have not added all the modules to make Sublime a full blown IDE. One place where it fell short is xDebug integration. There is a module and it does work, but the one in PhpStorm is just that bit better.

PhpStorm is not without it’s flaws, some of the shortcuts can only be a keyboard+mouse combo. Case in point multi-caret-select, or however you want to call it. In sublime, I had it at “Alt+UP” and “Alt+DOWN”, in PhpStorm I’m forced to grab a mouse. And then, there is resource consumption. Sitting at 800MB of RAM at runtime and 1.6GB after a while PhpStorm is a resource hog compared to a slick 200–350MB with Sublime. Pair PhpStorm with multitabbed Chrome and slack client, VM or a few docker containers and you might as well forget about any laptop limited to 8GB of RAM.

Overall, no piece of software is perfect and I’m going to use sublime for quick fixes, but in my day to day work phpstorm it is.

P.S. I know I can force the keymap setting by editing a keymap file. Unfortunately on Ubuntu it does not have any effect.

RethinkDB is going to be fine


I quite like RethinkDB (a document based data store with integrity, well thought through query language and enough built in functionality to make you wonder why you’ve never heard about it). What brought it to my attention were change feeds and if you are building anything requiring real time interaction, you should definitely check it out.

So you may have heard that the company behind RethinkDB has folded. You can read the postmortem. This has made some people worried that this awesome DB might go down with the company, despite assurances about making it a community run open-source project, however I’ve recently learned that the process is ongoing and further development is still happening.
From one of the contributors:

We’re nearly done polishing up the 2.4 release, which includes a bunch of sweet stuff like pre-write modifier functions. The biggest hold up on that is building out CI/testing infrastructure from scratch, figuring out how we’re going to release binaries, and the legality of doing so under the official name/domain.
We’ve even begun roadmapping things for 2.5/next including great work done by @srh which improves the performance of hard-durability writes by a significant degree. We intend to publish an official roadmap in the near future, but you can get a pretty good idea just following PRs in GitHub.
More is soon to come! If you’re interested in getting involved or just want to get updates, the best place to be is #open-rethinkdb onSlack.

So there you have it, I’m definitely going to sleep much better knowing that this awesome piece of software will continue.

Postfix in a docker container


Setting up postfix in docker is fairly easy, something I did not really know how to do was testing it. Turns out it’s just as simple with telnet and/or netcat. I followed BLOWB guide. Check it out.

Postman — chasing ghosts


Postman — chasing ghosts

Changing “Type” in postman’s “Authorization” tab does not automatically clear the authorization key from the headers. Something to remember before you start pulling your hair trying to figure out how come user object gets populated.

Take care.