Token replacement aka WordPress style shortcodes in ASP.Net MVC

Friday, March 17, 2017

For a digital publishing platform, token replacement can be a good way to allow users to easily insert special types of content into their posts. Wordpress have their square bracket syntax ‘shortcodes’, so plugin developers can enable users to insert say, a contact form into a blog post with code as simple as [contactform]. I… Full post

Using TransactionScope – a pattern for integration testing

Wednesday, August 3, 2016

Integration testing is a valuable check on methods that talk to a database, and a good way to check that stored procedures or sql queries are behaving as expected. I often see one of 2 mistakes with integration tests. The first is reliance on live data that is liable to change. This is easy to… Full post

Geocoding with PostGis

Sunday, May 1, 2016

For small scale geocoding needs I’ve always used the excellent Google maps API, but I recently wanted to do some custom geocoding and return the nearest NHS trust based on a user’s postcode. This was a nice opportunity for me to learn a bit about PostGIS, an amazing spatial database extension for PostgreSQL databases with… Full post

Animating ticks and crosses with SVG

Friday, April 1, 2016

Firstly, I love this article on animating SVGs because it really de-mystified them for me: I wanted to add a really simple animation effect to a quiz app I wrote for the Labour Party (see: ). A little bit of animation goes a long way in making something more visually interesting and therefore engaging, so I… Full post

4 Ways to Speed Up Your Angular App

Monday, November 30, 2015

There are two challenges to managing performance for Angular websites – the time spent performing intensive logic in the client, and the time spent actually rendering content. When writing an app recently that involved displaying a lot of constantly changing data, I found a few quick wins. 1. Use ‘track by’. The ng-repeat directive is… Full post

Should you use Typescript for your next project?

Monday, October 5, 2015

TLDR; yes. As a C# developer, I instantly loved Typescript for its features that make object oriented programming easy. I also love that it supports a lambda syntax for functional programming (which will actually be vanilla Javascript in ECMAScript 6.) But after developing in it for a few months now I thought it was also worth pointing out the other… Full post

Dynamically generated robots.txt and sitemap.xml files in ASP.NET

Wednesday, September 17, 2014

A robots.txt file and a sitemap are important additions to a site from an SEO point of view. You can of course just serve static files but it’s easy to imagine cases in which you’d want the content of these to be dynamically generated: 1. You are regularly adding/changing site content. Certainly on, we’re adding new… Full post

The 2 most useful things I learnt at JQuery UK, 2014

Monday, June 30, 2014

It’s been over a month since JQuery UK but I’m using things I learnt there all the time. Here are the two most useful techniques I took away from it. 1. Event delegation. Instead of attaching an event handler to a specific element on the page, letting the event bubble up and handling it on a parent element, usually… Full post

DateTimes and Cultural Differences in C#

Wednesday, April 23, 2014

The most baffling bugs are the ones that only appear on a remote server and are impossible to reproduce locally. We had one of these recently on a page that retrieved data based on date periods. Locally, the data came back as expected; on our test server, we got nothing. It took us a little… Full post

Responsive circles with CSS

Wednesday, April 16, 2014

We recently released a dashboard for the Hire Space venues’ CMS and the layout involves lots of circular badges with numbers in. I’m no CSS whizz, but I did have fun styling this and it turns out that creating fully responsive circular badges with nothing but CSS is easy. Here are the classes to create… Full post