StrayObject


Hi!

I'm Mike; I help startups and larger companies make their applications as good as possible.
Visit projects or about to learn more.

All Medium Twitter

2017-10-18 Automated Test #2743

2017-08-05 Past week in #php https://t.co/MYkxj4RvAC

2017-08-03 When coding at scale, poor design decisions always come back to bite in the ass. One might no longer be there to se… https://t.co/A79wOW142A

2017-05-18 https://t.co/Uhp79Pyimy #linux #ubuntu #satire #laugh #sad #convergence

2017-05-16 If your PHP Application's Security is important to you and your team, check out DC4D: PHPAppSec. https://t.co/51psJrhMDJ #DC4D #PHP

Dump all keys stored in redis

2017-03-28

Dump all keys stored in redis

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

Such a facepalm moment.

2017-03-26

Such a facepalm moment.

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

2017-03-26

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

2017-03-09

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

Your route declaration:

$router->add(‘/register/complete/{guid}’,
[
‘controller’ => ‘auth’,
‘action’ => ‘complete’,
]
)->setName(‘register-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

2017-03-05

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

2017-02-02

A few different ideas. One is bound to work ;)
http://stackoverflow.com/questions/37631098/how-to-bundle-an-angular-2-app-for-production

Good Bye SublimeText, hello PhpStorm

2017-02-01

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

2017-01-25

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

2017-01-23

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

2017-01-14

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.