Digiguru.co.uk

Random musings

The Command Pattern in Javascript and why you should love it

One pattern that I love to use in rich javascript applications is the Command Pattern. By embracing it you unlike your program to the ability to have multi-undo events, macro recording, but more and more prevalent in the sort of sites you see today, the way to distribute events to multiple clients (browsers) at once. Another advantage is it makes you app really easy to test - you can fire the Commands at your app and do some very deep tests on rich interfaces.

The pattern is described by having the following objects…
Read more about The Command Pattern in Javascript and why you should love it (2 minutes)

Don't use an OR statement in your join clause

Found an interesting little problem recently. We had a query we wanted to upgrade for the next release, and added an OR statement to allow us to pre-release the functionality for the new code drop. This had a really big impact on performance and caused lots of issues.

When we investigated it turns out that OR queries in a join are really expensive. Consider the following statement.
Read more about Don't use an OR statement in your join clause (1 minute)

Rename a git branch

After moving our repos from svn to git, we’ve need to rename some of the branches - a simple way of grouping up logical branches.

We have the following naming conventions for our branches.
Read more about Rename a git branch (2 minutes)

Release w:4083d4b · p:fe7d381 · details