Code used in the 3rd August 2013 deferred and promise objects workshop