All posts by

André Roaldseth

expand_more

Comparing your privates in PHP

Blog post header

While 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

Blog post header

Composer 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

Blog post header

If 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

Blog post header

Do 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

Blog post header

The 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

Blog post header

Some time ago I saw a

Safari on iOS 5 Randomly Switches Images, Part 2

Blog post header

This 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

Blog post header

Since 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

Blog post header

See how you can use recursion in PHP to create a tree structured array with a single pass.

Unit testing with streams in PHP

Blog post header

Using 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