Calling parent function in Symfony/Twig form theme

17th November, 2020 - Posted by david

I’ve recently started building a new web app and have decided to build it in Symfony (and hopefully ultimately Vue for the front-end), as a way of learning what looks like a really cool framework. I’d had an introduction to Symfony through work, then did some online courses, including a load of the excellent SymfonyCasts, […]

Read more...

Releasing software: from chaos to sanity

12th April, 2019 - Posted by david

This post was originally written for the engineering blog of my employer, Smartbox Ltd., who are also the source of the content. The original is available at https://medium.com/smartbox-engineering/releasing-software-from-chaos-to-sanity-12fcdc563e93 This article is about how, at Smartbox, we improved our release process over a period of around 2 years, going from ad hoc releases, with little structure […]

Read more...

KnockoutJS: multiple jquery actions in one binding handler

5th August, 2016 - Posted by david

A general rule I follow when using KnockoutJS is that there should be no DOM manipulation in the viewModel. The viewModel should be completely independent of any markup, while any changes to the DOM (via jQuery or otherwise) should be handled in the binding handler. This makes your viewModels much more portable and testable. As […]

Read more...

Passing options to Reveal modal in Foundation via HTML

18th March, 2016 - Posted by david

In my current job, we use Foundation for stuff like modal popups, fancy drop downs etc. I haven’t used it too much but I know for the modal dialogs you can either instantiate them via Javascript ($(‘#elem’).foundation(‘reveal’, ‘open’, {option: ‘value’});) or via HTML attributes (<a href=”#” data-reveal-id=”elem”>Open</a> and <div id=”elem” data-reveal>). Passing options to Foundation […]

Read more...

Autocomplete with KnockoutJS

3rd February, 2016 - Posted by david

Recently I started a new job at a company that is looking to transition away from a customised, unstructured, jQuery module set up to use KnockoutJS and RequireJS for it’s modules. This approach was chosen because the core platform is based on Magento and the forthcoming Megento 2 uses KnockoutJS heavily throughout it’s frontend templates. […]

Read more...

Deeplink to a sub-page within a Facebook iframe app

24th May, 2015 - Posted by david

Facebook have long had the ability for developers to write custom apps and embed them as tabs in people’s or company’s Facebook profile pages. What I’m talking about here is when you write your own HTML app and host it at e.g. https://fb.mysite.com, which is then embedded into profile pages via an iframe. These apps […]

Read more...

Phantom rewrite rule in Apache

7th March, 2015 - Posted by david

TL;DR The MultiViews option in Apache automatically will map e.g. /xfz/ to /xyz.php I was recently creating a new section of the website I work for and decided to opt for tidy URLs, for SEO purposes, instead of our standard.long?url=format URLs that we have elsewhere. Let’s say the new section I was creating was called […]

Read more...

How to call some Pixastic functions

21st February, 2015 - Posted by david

I was doing a bit of work with Canvas recently, manipulating images in the browser and writing the results out to files. I was looking for a package that could do various effects on the images, such as sharpen, blur etc. and came across the Pixastic package used in similar applications. However, unfortunately, the website […]

Read more...

Homepage takeover with existing skyscraper ads

14th February, 2015 - Posted by david

UPDATE: Originally I was using Javascript to position the 2 banner divs along the main content, but have since figured out how to do this with just CSS alone. I’ve left the article as it was for posterity; there should be enough here to still figure out what you need to do! Anyways, to achieve […]

Read more...

Opening hours done right, in PHP and MySQL

7th February, 2015 - Posted by david

I often see different ways of storing and displaying opening hours for various businesses when browsing the web. Some seem to simply store them as an unstructured blob of plaintext and spit that back to the user. Others will store the exact times for each day and display all 7 days on 7 separate rows. […]

Read more...