Welcome to doginthehat — the website of Ben Lagoutte.

I’m the senior developer at Gozer Studio in Melbourne AU & the experimental father of a 19 month old.

Recent Posts

Fixing Google Analytics integration in Lemonstand V1

With Lemonstand V1 now unfortunately unsupported, we’re starting to see a few random errors appearing now and then that won’t be fixed — e.g. braintree payments fix. Once such problem is the recent deprecation of Google’s auth login system and switch to oAuth2 which throws an error in the dashboard. Fear not, someone has already created a fix for it and published the code on Github: https://github.com/TuzBot/LS-V1-Google-Analytics-oAuth2 Effortlessly applied to a few sites. Thanks Michael…

Read More

Deprecated error with Lemonstand V1 and Braintree Payments

If you’re running an eCommerce website using Lemonstand V1 (which is now unsupported since their V2 is the new hot stuff) and have recently upgraded your server to PHP 5.5+, you may run into a deprecated error when using Braintree Payments. The error is in /modules/shop/payment_types/shop_braintree_transpredirect_payment/Braintree/Util.php and is pretty easy to fix. There are two functions using the deprecated /e modifier: delimiterToCamelCase & camelCaseToDelimiter. The fixed versions of these methods are: delimiterToCamelCase public static function…

Read More

Considerations with HSTS and storing website assets on Amazon S3

With SSL getting pretty cheap through some providers and many guides offering easy instructions to get going on setting up, be sure to approach with caution. Aral Balkan has a pretty well written set of instructions on this website on how to setup SSL with the best practice configuration. It’s all very good information available there. There is one line that you should be very cautious about understanding properly: # Add HSTS add_header Strict-Transport-Security “max-age=31536000;…

Read More


Interesting results trying to optimise a website for a client. This is the blitz.io results before and after. In both cases the website run the same Lemonstand installation. The before setup had a standard cPanel installation with: Apache 2.2.25 PHP 5.4.21 with XCache MySQL 5.0.96 2GB Ram The after setup has: nginx 1.0.15 PHP 5.5.15 with Zend OPcache (running as php-fpm) MySQL 5.5.39 6GB Ram There is obviously a lot of difference between the two…

Read More

Basic openssl RSA encrypt/decrypt example in Cocoa

Caveat – I’m building an OSX app for Maverick – this may work for iOS but I haven’t tried. In a recent project I’ve had to build a small Cocoa app that decrypt a packaged document. The document packaging is basically provided by a RSA public/private key encryption. The encryption is generated by a website and I had zero issue doing this in PHP.. actually was insanely simple. Then I had to do it in…

Read More

Compiling webpay on a cPanel based server

This is more of note-to-self for future reference but other people might appreciate it. If you have to use the St George webpay API, high five to you first and you’ve probably suffered through trying to install it. Assuming that you have all the requirements to compile it (swig, php), the only things you need to remember are: You need to compile it using the active php installation from cPanel/WHM, which includes the correct extension…

Read More

phpMyAdmin showing a 500 error after a WHM/cPanel upgrade

I did an upgrade to WHM/cPanel server today. Moved it to the latest cPanel software and did an easyApache upgrade to the latest php 5.3. All worked smoothly until I launch phpMyAdmin. No worky, dang. This one had me puzzle for a while. The crazy part is that I couldn’t find an error in the log. Turns out.. that when the upgrade happened, because it’s now php 5.3, the phpMyAdmin config file doesn’t set a…

Read More

Lemonstand Module – Dog Tools

Started a Lemonstand Module where I plan to add a few helpful developer items. Just one helper in there, the Dumb Gateway payment type: Dumb Gateway was never the smartest in class. Dumb Gateway goes nowhere and does as it feels. Add Dumb Gateway and set the mood. When Dumb Gateway is Happy, payment goes well. When Dumb Gateway is Sad, payment goes poorly. Sometimes Dumb Gateway is undecided. Dumb Gateway likes developers, but Dumb…

Read More

Zero-padding (and other things) a string with the Twig template engine

This might sound a bit “duh” when you come to the conclusion but I did have to search for it and couldn’t find an immediate answer. I want to zero-pad a month variable to always be 2 digits long, using the Twig template engine Twig doesn’t actually have a built-in filter for this. {{month|pad(‘0+’,2)}} doesn’t exist. However, Twig does have a filter called format that gives you access to the power of sprintf. You can…

Read More

Got a Raspberry Pi

My Raspberry Pi just arrived in the post on Friday (bought from Element14). Not sure what I’m going to do with it yet. Pretty sweet little device; even tinier than I had it pictured. Check it out on www.raspberrypi.org

Read More

Recent Projects