Generating https urls in Django using CloudFront

Configure CloudFront to set the Cloudfront-Forwarded-Proto in order to allow a Django application to know the client’s request protocol.…

Keep reading

Secure Route 53 healthchecks using HAProxy

It’s possible to configure HAProxy to have separate health check and service endpoints, allowing to set up different firewall rules for each.…

Keep reading

Taming PYTHONPATH in PyCharm and IntelliJ

PyCharm and IntelliJ have some odd defaults that can mask mistakes until they hit CI.…

Keep reading

Using pyenv and pyenv-virtualenv on OSX

Until recently I relied on OS X native python for anything 2.7.x and Homebrew’s python3 for anything 3.x.x. As already implied by the lots of ‘x’-es: Far from ideal. But it worked. Until I accidentally ran a brew upgrade which put my python 3 version to a bleeding edge 3.6.0. Newer than what’s provisioned on our stack and besides that I ran into some errors when installing requirements in a new virtualenv that I suspected to be related to the python version bump.…

Keep reading

Moving from Wordpress to Hugo

For some years my blog has been inactive. Now this could imply that ‘not much was happening’ on a professional level but that hasn’t been the case, on the contrary. Recently I’ve been thinking about adding new content and it became clear that my old Wordpress setup wasn’t the best fit anymore for my needs. Several people I know have been very positive about Hugo and the webserver Caddy so I decided to give that a try.…

Keep reading

DDD using Doctrine 2: A case study

Nowadays developing web applications usually requires a flexible process due to changing business logic, shifting priorities or new insights. Besides choosing the right methodology this also requires designing the application in such a way that this flexibility can be achieved.

[Domain Driven Design][1] fits this process as it isolates business logic in the Domain layer and separates it from infrastructure and presentation layers. Questions like where or how to store data or what to build (website, mobile app, API) can be addressed separately.

[Doctrine 2][2] provides PHP developers with a powerful tool to create a Domain layer that contains business logic that is easy to unit test and therefore easy to expand upon in iterations.

In this article I will show how to implement a specific case using Doctrine 2. Full code accompanying this article can be [found on GitHub][3].

Keep reading

DPC 2011 preview

The yearly dutch PHP event is getting close so time to check out the schedule. Once again there are lots of interesting sessions to choose from so I probably will miss some of the good stuff. Mixing ‘simply interesting’ and ‘directly usable in day-to-day job’ results in the preliminary list: Day 1 TDD and Getting Paid – Because indeed TDD is good and can be hard to keep doing thoroughly Pursuing practices of Domain-Driven Design in PHP – Fits both the ‘interesting’ and ‘directly usable’ categories.…

Keep reading

Usability: Autofocus and not breaking the backspace-button

A while ago during a project we were asked to implement autofocus on the generic search field that every page in the application has. At a first glance a pretty straightforward task, from a technical perspective that is. Not from a user perspective, as indicated by a colleague mentioning his dislike of such autofocus fields “because they prevent backspace going to the previous page”. In this post I will outline some usability considerations and conclude with a jQuery plugin that will take away some of the possible hindrance of autofocusing a field.…

Keep reading

Fixing mysqldump on Zend Server CE on OS X

A while ago I installed Zend Server Community Edition on OS X which was pretty straightforward. It was only recently that I found out that, as opposed to mysql which worked fine, mysqldump didn’t work correctly and terminated with the error: `A while ago I installed Zend Server Community Edition on OS X which was pretty straightforward. It was only recently that I found out that, as opposed tomysqlwhich worked fine,mysqldump` didn’t work correctly and terminated with the error: `` Inspecting the mysql configuration contained in /usr/local/zend/mysql/data/my.cnf confirmed that the section [client] showed the socket as returned by executing SHOW VARIABLES; from the mysql client: /usr/local/zend/mysql/tmp/mysql.sock Although it is possible to specify the socket by using mysqldump’s --socket switch, that doesn’t really seem a ‘solution’.…

Keep reading

Dutch PHP Conference (DPC) 2010

Past weekend the Amsterdam RAI was the centre of the PHP universe as there the 2010 edition of the Dutch PHP Conference was held. Similar to past year it consisted of two presentation days, which I attended, preceded by a tutorial day. Among the presentations I attended on the first day were: Kevlin Henney’s keynote presentation, titled 97 Things every programmer should know. I suppose every attendant will have recognised some of the things he addressed, like “Do lots of deliberate practice” or “Hard work does not pay off”.…

Keep reading