At my employer Softhouse (the best IT consultancy in Karlskrona, and we’re hiring!) I recently got the requirement to make an AngularJS web application work properly in the captive portal window on Apple iOS. These requests are made with HTTP header: User-Agent: CaptiveNetworkSupport-325.10.1 wispr A captive portal is the login screen you get when you connect to many wifi… Continue reading Limitations of Apple iOS captive portal web browser
Category: Web development
ng-transclude that also transcludes scope
With the built-in ng-transclude the the scopes become siblings. What if we want the transcluded HTML to inherit the scope of our directive? Thanks to Controlling Scope on the Transclude Function on ng-nuggets I was able to figure this out: angular .module(‘myApp.myModule’) .directive(‘myDirective’, myDirective); function myDirective() { return { controller: Controller, transclude: true, restrict: ‘E’,… Continue reading ng-transclude that also transcludes scope
Add PDO support to PHP 5.4 on OpenShift Origin
yum install php54-php-pdo yum install php54-php-pdo_mysql
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
Customizing ZendViewHelperNavigationMenu in ZF2
I have created gist: 4045344 with example code for replacing the navigation menu helper in Zend Framework 2.
Injecting context into controller?
I’m toying with my own PHP micro-framework. I’m trying to make it both simple and easy; explicit but not verbose. (Good luck to me!) For testability I have abstracted the Superglobals so that I have full control of them in my tests. Currently they are passed as a parameter to the controller action. Would it… Continue reading Injecting context into controller?