PPH l33t

Tech Level up

With the new PPH website out the door, we have adopted many new technologies within our team. The new PPH site is still built with PHP. We use nginx as a proxy to Apache and running on multiple EC2 instances, with an RDS backend utilising multiple read-replicas. We use…

Counting number of properties in a JS object

When there is a JS array, it is easy to count the number of elements. For example: var arr = [“hello”, “world”]; console.log(arr.length); // 2 However, when you have an object it is a bit more tricky. .length wont work. One way is to iterate…

Sprites and the :before element

Lets suppose you have a big sprite with icons place not only vertically, but also horizontaly, effectively creating a complex grid. Now lets suppose you want to create an <a> tag with an icon on the left side, and some text after that. If you…