
All posts by
André Roaldseth
Comparing your privates in PHP
André Roaldseth 2014-03-14While working with some code that should compare two different instances of the same class I discovered a “hidden” feature in PHP. I was going to compare several private properties between to objects and started making a piece of code to perform the actual comparison using getters for the properties.
Avoid Dependency on 3rd Party Sources With Composer
André Roaldseth 2013-09-20Composer is the defacto standard dependency manager for PHP out there, also here in VG. We use it for not only our internal packages, but for all external packages like ZF2, Symfony, PHPUnit, etc. For the most parts it has been a pleasant experience, but it creates a hard dependency towards
How To Make GoogleBot Crawl Your Backbone.js Website
André Roaldseth 2013-08-07If you create single page applications with Backbone.js or similiar you will end up with websites which requires JavaScript. This is not a big problem when it comes to regular user-agents, but Google will not be able to see your content. We solve this issue by using PhantomJS.
Getting Bash Completion for Remote Subversion Paths
André Roaldseth 2012-12-19Do you want automatic completion for remote paths when using svn in bash? Do you want to switch easier between branches? I’ve written a small script that gives you autocompletion for all remote paths.
Lazy Loading Resources with Zend Framework Bootstrap
André Roaldseth 2012-06-01The Bootstrapping process in Zend Framework isn’t perfect. You’ll often end up bootstrapping a lot of resources that you don’t need to complete the request. Depending on the resources this can be really expensive and hurt your overall performance. The worst kind are resources that open connections to external services
Don’t Hardcode PHP Executable Path In Shebang
André Roaldseth 2012-02-21Some time ago I saw a
Safari on iOS 5 Randomly Switches Images, Part 2
André Roaldseth 2012-01-18This post is a follow-up to Safari on iOS 5 randomly switches images. In our case almost all of the images on the front page has unique height * width combinations. Since our CMS sets the image size with height/width attributes in the element and rescales the image file to fit
Safari on iOS 5 Randomly Switches Images
André Roaldseth 2011-12-14Since the release of iOS 5 we’ve received several bug reports about images randomly displaying the wrong image(s) on our front page for smartphones. It seems to be completely random and could affect any of the images, anywhere and anyhow. During one week we would receive anywhere between two and
Building Tree Structures in PHP Using References
André Roaldseth 2011-10-31See how you can use recursion in PHP to create a tree structured array with a single pass.
Unit testing with streams in PHP
André Roaldseth 2011-06-27Using the memory/temporary stream provided by php:// stream wrapper you can create a stream with read and write access directly to RAM or to a temporary file. This gives you the possibilty to write unit tests that does not rely on a specific file, resource or stream, but rather on