Now-proofing your development!

At work today we discussed the concept of future-proofing, which I consider a bad practice. I can elaborate another time but my talented colleague Anders Holmberg invented now-proofing on the spot. That’s what we should be aiming for! Our bried discussion was inspired by this quote: If you are not embarrassed by the first version… Continue reading Now-proofing your development!

David’s technology radar

Inspired by ThoughtWorks Technology Radar, here is an attempt to write down my current world view: Adopt AngularJS Bootstrap Cloudflare – reverse proxy in the cloud, protecting and speeding up your web sites Composer – PHP package manager Redis – key/value database sphinx – search server Tonic – PHP microframework for REST(ish) web services VirtualBox – virtualization engine Trial Mozilla Persona –… Continue reading David’s technology radar

formatCurrency bug

Is the formatCurrency method of the NumberFormatter class in PHP working properly for you or does it return things like “NaN” and “¤¤¤”? This is probably PHP bug #54538 that actually is ICU bug #8561 that might be the same as ICU bug #8214. I have worked around it by being more careful about what… Continue reading formatCurrency bug

Script to update an OpenShift repository with changes made on server

If you haven’t tried OpenShift yet, you should! Anyway I have a WordPress installation there. When upgrading WordPress to a new version, files are changed on the server but they would be overwritten if I push the repository. So I created a script to download a snapshot of the OpenShift app, extract the changes in… Continue reading Script to update an OpenShift repository with changes made on server

PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes)

I’m a very happy user of New Relic for my websites, even if I’m only leeching on the free tier. One of my WordPress sites, taurin.se has been suffering from this out-of-memory error for quite some time now and I finally tracked it down. New Relic shows the stack trace, with the failing line on… Continue reading PHP Allowed memory size of 134217728 bytes exhausted (tried to allocate 71 bytes)

Using mod_spamhaus to block TOR in Apache

Some web spammers use the Tor Project to hide their wrongdoings. Because of this, I want to block Tor exit nodes from submitting forms on my web sites. However, there are many legitmate uses of the Tor Project, so I don’t want to block GET requests but primarily POST requests. Run sudo apt-get install libapache2-mod-spamhaus Open /etc/apache2/mods-enabled/mod-spamhaus.conf for editing (as… Continue reading Using mod_spamhaus to block TOR in Apache