{"version":"https://jsonfeed.org/version/1","title":"David Boyer","items":[{"id":"blog\\article\\2015-10-02.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2015-10-02.md","title":"General update","content_html":"<p>Unfortunately I haven&#39;t given my site much attention for a while.  So I decided to take the time to revamp it a little and alter the way I build it (static site generation).  You&#39;ll have to bare with me for a bit as I&#39;m going through my old posts and tidying them up / converting them, meaning not everything that was here is currently here (blog posts older than 2012-03 at least).  Also thought I&#39;d provide a brief update on upcoming posts and other stuff I&#39;m up to.</p>\n<!--more-->\n<h3 id=\"speaking\">Speaking</h3>\n<h4 id=\"cfcamp-2015\">CFCamp 2015</h4>\n<div class=\"row\">\n  <div class=\"col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2\">\n    <div class=\"thumbnail\">\n      <img src=\"/images/blog/2015/10/02/cfcamp2015.png\">\n    </div>\n  </div>\n</div>\n\n<p>CFCamp is a ColdFusion / CFML related conference that&#39;s based in Germany.  I&#39;ve never been to a previous instance of this event but have heard it mentioned by plenty of others.  This will mark the second time I&#39;ve spoken at a conference, the first being Scotch on the Rocks 2014, and I can&#39;t wait to give it a go.</p>\n<h4 id=\"fullstack-2015\">FullStack 2015</h4>\n<div class=\"row\">\n  <div class=\"col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2\">\n    <div class=\"thumbnail\">\n      <img src=\"/images/blog/2015/10/02/fullstack2015.jpg\">\n    </div>\n  </div>\n</div>\n\n<p>This was one I wasn&#39;t expecting!  I threw my proposal at this conference after WAIT 2015 was canceled, not really convinced that I&#39;d get a spot but thought I&#39;d try my luck.  FullStack was also pushed back from the original June date, to October, so I had totally forgotten about it.  Very pleased to be speaking on static site generation at the event, which I&#39;ll detail a little further in a follow up post.</p>\n<h3 id=\"magazine-articles\">Magazine articles</h3>\n<div class=\"row\">\n  <div class=\"col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2\">\n    <div class=\"thumbnail\">\n      <img src=\"/images/blog/2015/10/02/magazine.jpg\">\n      <div class=\"caption\">\n        Web Designer Magazine, issue 240.  Article introducing GitHub&#39;s Atom editor.\n      </div>\n    </div>\n  </div>\n</div>\n\n<p>During my time away from blogging, I&#39;ve had several articles published in Web Designer magazine.  A fantastic publication that comes out monthly, featuring all sorts of coverage for web design and development.  While it may have taken away from my blog as an outlet on occasion, I may start producing follow up entries based off the back of those articles.</p>\n<h3 id=\"side-projects\">Side projects</h3>\n<p>Not much going on at the moment.  I&#39;m still playing around with Node.js, but have been busy enough to not have a little side-project to tinker away on.  Doesn&#39;t mean I don&#39;t have some ideas up my sleeve so maybe I&#39;ll get back to something small soon enough, like the little game idea I had...</p>\n<h3 id=\"work\">Work</h3>\n<p>Still working in the NHS Wales Informatics Service, doing some quite interesting stuff lately which is allowing me to stretch my skills a little in areas I enjoy.  I&#39;ve also had the chance to share some of my Node.js knowledge by holding a short session providing an introduction to it for other software developers in the organisation.</p>\n<h3 id=\"todo-list\">TODO List</h3>\n<p>Here is my tech related hit list for things I really want to try out more:</p>\n<ul>\n<li>React: Probably via the Redux framework.</li>\n<li>Microservices: Especially managing, scaling and making them easily discoverable.</li>\n<li>Kanban: Have been exploring this technique but want to put it into solid practice with a project.</li>\n<li>Webpack / Browisfy: I&#39;ve been too focused on server-side JavaScript and need to get a better understanding of all the tools available for the client-side.</li>\n<li>Mobile Apps: Have dabbled before, but if I get comfortable with React, React-Native could be a nice way to produce some daft little mobile apps for my own amusement ;)</li>\n<li>Speak at a conference in 2016: As long as the 2015 ones go well ;)</li>\n<li>Write more magazine articles</li>\n<li>Do something epic \\o/</li>\n</ul>\n","date_published":"2015-10-02T13:00:00.000Z"},{"id":"blog\\project\\2014-12-05.md","url":"https://misterdai.yougeezer.co.ukblog\\project\\2014-12-05.md","title":"grunt-twbs Custom Twitter Bootstrap","content_html":"<p>This is a short post just to cover a little <a href=\"http://gruntjs.com\">grunt</a> plugin I create called <code>grunt-twbs</code>.  It&#39;s designed to help you with the process of creating customised versions of <a href=\"http://getbootstrap.com/\">Twitter Bootstrap</a>.<!--more--></p>\n<h3 id=\"the-need\">The need</h3>\n<p>Whenever I&#39;ve played around with Twitter Bootstrap, I end up altering its <code>less/bootstrap.less</code> file and then building my custom version using Grunt to execute its own <code>Gruntfile.js</code>.  While this is fine, it means you&#39;ve got a separate <code>Gruntfile.js</code> hanging around and your modifications are made within the Bootstrap source, so you have to backup your changes before upgrading Bootstrap.</p>\n<p>My second approach was to tear out chunks of Bootstrap&#39;s <code>Gruntfile.js</code>, alter them to work with a <code>.less</code> file located outside of the Bootstrap directory and place those chunks within my main <code>Gruntfile.js</code>.  I covered this in a <a href=\"http://misterdai.yougeezer.co.uk/posts/2014/07/25/twitter-bootstrap-customising-css/\">previous blog post</a> and while it keeps the Bootstrap free of modifications (for easier upgrading), it doesn&#39;t get around the fact that we have to keep in line with any changes to Bootstrap&#39;s <code>Gruntfile.js</code> for building the CSS.</p>\n<h3 id=\"the-new-idea\">The new idea</h3>\n<p>Execute Bootstrap&#39;s <code>Gruntfile.js</code> from my main projects <code>Gruntfile.js</code>.  This seemed to make the most sense as I don&#39;thave to worry about changes to the build process between versions and I can use Grunt to copy across my custom <code>.less</code> file.  Upgrading will also be painless as there&#39;s nothing vital held within the Bootstrap directory.</p>\n<h3 id=\"my-solution-grunt-twbs-\">My solution <code>grunt-twbs</code></h3>\n<p>I wrapped my idea up as a Grunt plugin and figured I&#39;d share (I&#39;m good like that).  It&#39;s still early days, so I may eventually add some more functionality to it or even find better ways to achieve my goal.  As the plugin currently stands, it&#39;ll do the following:</p>\n<ul>\n<li>Support building a single or multiple Bootstrap CSS files, based on your custom <code>.less</code> file.</li>\n<li>Your custom <code>.less</code> file should be based on Bootstrap&#39;s <code>less/bootstrap.less</code> file (obviously with your own modifications).</li>\n<li>The plugin will also copy the resulting <code>dist/css/bootstrap.min.css</code> to a directory and filename of your choice.</li>\n<li>Bootstrap can be easily upgraded by replacing your copy of the source or using <a href=\"http://bower.io/\">Bower</a>.</li>\n</ul>\n<p><a href=\"https://github.com/misterdai/grunt-twbs\" class=\"btn btn-info btn-raised\">GitHub</a>\n<a href=\"https://www.npmjs.org/package/grunt-twbs\" class=\"btn btn-info btn-raised\">NPM</a>\n<a href=\"/pages/grunt-twbs\" class=\"btn btn-info btn-raised\">My Project page</a></p>\n<h3 id=\"feedback-welcome\">Feedback welcome</h3>\n<p>If you&#39;ve any ideas for additional features (like building Bootstrap&#39;s JavaScript as well) or other suggestions, feel free to head over to the GitHub page linked above and log an issue.</p>\n","date_published":"2014-12-05T13:00:00.000Z"},{"id":"blog\\speaking\\2014-11-21.md","url":"https://misterdai.yougeezer.co.ukblog\\speaking\\2014-11-21.md","title":"Speaking at WAIT 2015","content_html":"<p>I&#39;ve managed to secure my second speaking appearance at a conference.  This time it&#39;s <strong><a href=\"http://waitconference.eu\">Web Applications In Trend</a></strong> (WAIT) which is taking place in Manchester at the awesome venue, the <a href=\"http://www.manchesterconferencecentre.co.uk/\">Manchester Conference Centre</a> (Manchester, UK), on the 4th &amp; 5th June 2015.  But apart from myself, there are plenty of other reasons for yourself to attend or speak.</p>\n<!--more-->\n<h3 id=\"not-scared-off\">Not scared off</h3>\n<p>From the little feedback I had, from my first attempt at conference speaking, it went smoothly and was reasonably well received.  On my side of the talk, a few things went badly (laptop display failing, cut off screens, nerves!) but I somehow just knuckled down and got through it anyway.  Being stubborn and a glutton for punishment, how could I resist not speaking again!</p>\n<h3 id=\"a-brand-new-conference\">A brand new conference</h3>\n<p>This WAIT conference is the first to take place and it already has a couple of things going for it, that made it my conference of choice (I usually only get allowed out once a year).  If I hadn&#39;t managed to get a speaker slot, I&#39;d have definitely bought a ticket to attend.</p>\n<h4 id=\"the-man-with-the-plan-matt-gifford\">The Man with the plan: Matt Gifford</h4>\n<p><img class=\"pull-left img-circle\" src=\"/images/blog/2014/11/21/matt_gifford.png\"></p>\n<p><a href=\"http://monkehworks.com/\">Matt Gifford</a> is the one pulling the strings to make this conference happen.  Personally, I really respect this dude having gotten to know him over the past couple of years at another conference and through his open source projects.</p>\n<div class=\"clearfix\"></div>\n\n<ul>\n<li>Award: <a href=\"http://web.archive.org/web/20140913124032/http://www.ubelly.com/2012/06/and-the-winners-are-the-critters-2012/\">ubelly.com - Next Big Thing 2012</a></li>\n<li>Award: <a href=\"http://www.creativebloq.com/netmag/net-awards-2011-top-10-developers-9116790\">.net Magazine 2011&#39;s Top 10 developers</a></li>\n<li>Book: <a href=\"http://objectorientedprogrammingincoldfusion.com/\">Object-Oriented Programming in ColdFusion</a></li>\n<li>Book: <a href=\"http://www.packtpub.com/phonegap-mobile-application-development-cookbook/book\">PhoneGap Mobile Application Development Cookbook</a></li>\n<li>Magazines: He&#39;s had <a href=\"http://monkehworks.com/publications/\">75 articles published</a> in Web Designer Magazine and .Net magazine.</li>\n<li>Speaker: Has spoken at <a href=\"http://monkehworks.com/speaking/\">30 past events</a>.</li>\n<li>Open Source: Is someone who is happy to <a href=\"https://github.com/coldfumonkeh?tab=repositories\">share code</a> when he can.</li>\n</ul>\n<p>With a guy like that behind the event, I&#39;m pretty confident he has the skills and experience to put together a fantastic conference.</p>\n<h4 id=\"speakers-already-secured\">Speakers already secured</h4>\n<p>Obviously I&#39;ve already indicated that <a href=\"http://waitconference.eu/speakers#david_boyer\">I&#39;m speaking at the conference</a> and Matt is <a href=\"http://waitconference.eu/speakers#matt_gifford\">making himself to speak</a> and run the conference at the same time.  He&#39;s also managed to secure some other speakers early on, which I&#39;ll briefly mention here but if you follow their links I&#39;m sure you&#39;ll learn much more about them ;)</p>\n<h5 id=\"bruce-lawson-opera-\">Bruce Lawson (Opera)</h5>\n<p><img class=\"pull-left img-circle\" src=\"/images/blog/2014/11/21/bruce_lawson.png\"></p>\n<p>I&#39;ve heard Bruce speak several times and each time has been extremely informative and thoroughly enjoyable. Lanyrd currently (at the time of writing) has him with a tally of <a href=\"http://lanyrd.com/profile/brucel/past/speaking/\">93 past speaker appearances</a>!  Evangelising open web standards through his role at Opera, he&#39;s someone definitely worth listening to.</p>\n<p><a class=\"btn btn-info\" href=\"http://waitconference.eu/speakers#bruce_lawson\">Conference Profile</a>\n<a class=\"btn btn-info twitter\" href=\"http://twitter.com/brucel\"><span class=\"fa fa-fw fa-twitter\"></span></a>\n<a class=\"btn btn-info\" href=\"http://dev.opera.com/\">Opera</a></p>\n<h5 id=\"camille-baldock-government-digital-service-\">Camille Baldock (Government Digital Service)</h5>\n<p><img class=\"pull-left img-circle\" src=\"/images/blog/2014/11/21/camille_baldock.png\"></p>\n<p>Camille isn&#39;t someone I&#39;ve seen present before, but looking through the organisations she&#39;s worked with previously, her developer coaching, open source contributions and other interests... I&#39;m certain that she&#39;ll be worthy of your time and share something worthwhile.</p>\n<p><a class=\"btn btn-info\" href=\"http://waitconference.eu/speakers#camille_baldock\">Conference Profile</a>\n<a class=\"btn btn-info twitter\" href=\"http://twitter.com/camille_\"><span class=\"fa fa-fw fa-twitter\"></a>\n<a class=\"btn btn-info\" href=\"http://camillebaldock.co.uk/\">Website</a>\n<a class=\"btn btn-info\" href=\"https://gds.blog.gov.uk/about/\">Government Digital Service (GDS)</a></p>\n<h5 id=\"chris-mills-mozilla-\">Chris Mills (Mozilla)</h5>\n<p><img class=\"pull-left img-circle\" src=\"/images/blog/2014/11/21/chris_mills.png\"></p>\n<p>Chris is another very experienced speaker with <a href=\"http://lanyrd.com/profile/chrisdavidmills/past/speaking/\">35 past appearances</a>, who has previously worked at Opera before his current role at Mozilla and  been involved with books covering CSS and HTML.  I missed a previous chance to attend one of his talks since I had to sit in on a different track at that event, but I&#39;m going to try and make sure I don&#39;t miss out this time.</p>\n<p><a class=\"btn btn-info\" href=\"http://waitconference.eu/speakers#chris_mills\">Conference Profile</a>\n<a class=\"btn btn-info twitter\" href=\"http://twitter.com/chrisdavidmills\"><span class=\"fa fa-fw fa-twitter\"></a>\n<a class=\"btn btn-info\" href=\"http://developer.mozilla.org/\">Mozilla</a></p>\n<h5 id=\"sally-jenkinson-records-sound-the-same-\">Sally Jenkinson (Records Sound the Same)</h5>\n<p><img class=\"pull-left img-circle\" src=\"/images/blog/2014/11/21/sally_jenkinson.png\"></p>\n<p>Sally, who works as a technical consultant and solutions architect, has <a href=\"http://lanyrd.com/profile/sjenkinson/past/speaking/\">spoken multiple times before</a> and recently authored a <a href=\"http://www.sallyjenkinson.co.uk/atomic-documentation/\">book on documentation</a>.  I&#39;ve crossed paths with her a couple of times at previous conferences I&#39;ve attended and she definitely knows her stuff.  Absolutely worthy of your time if you have the chance to attend one of her sessions.</p>\n<p><a class=\"btn btn-info\" href=\"http://waitconference.eu/speakers#sally_jenkinson\">Conference Profile</a>\n<a class=\"btn btn-info twitter\" href=\"http://twitter.com/sjenkinson\"><span class=\"fa fa-fw fa-twitter\"></a>\n<a class=\"btn btn-info\" href=\"http://sallyjenkinson.co.uk/\">Website</a></p>\n<h4 id=\"great-location\">Great location</h4>\n<p>Manchester is pretty central to the UK, making it a great location to hold the event, with its airport, trains and infrastructure.  The conference is being held in the <a href=\"http://www.manchesterconferencecentre.co.uk/\">Manchester Conference Centre</a> which looks like an amazing and very professional venue.</p>\n<h3 id=\"are-you-a-speaker-\">Are you a speaker?</h3>\n<p>The conference has opened it&#39;s call for speakers.  If you have something that&#39;s worth sharing and web related, why not submit a session (or multiple) and join the rest of us speaking at this event.</p>\n<p><a class=\"btn btn-primary btn-raised\" href=\"http://waitconference.eu/posts/2014/11/17/call-for-speakers/\">Call for Speakers</a></p>\n<h3 id=\"buy-a-ticket-\">Buy a ticket!</h3>\n<p>If I wasn&#39;t speaking, I probably would have bought a ticket to the event already.  There&#39;s <strong>early bird pricing available on the tickets</strong> (until January 1st 2015!) and, as I&#39;ve mentioned already, a pretty decent selection of speakers already announced.  There&#39;s also a ticket incentive system for the conference where the more tickets that are sold, the more bonuses are unlocked for the event (such as t-shirts, evening function, session recordings).  So if you do book yourself a ticket, it&#39;s worth encourage others to come along as well ;)</p>\n<p><a class=\"btn btn-success btn-raised\" href=\"http://waitconference.eu/#tickets\">Tickets</a></p>\n<h3 id=\"keep-track-of-the-event\">Keep track of the event</h3>\n<ul>\n<li><a href=\"http://waitconference.eu/#subscribe\">Subscribe to the email list</a></li>\n<li><a href=\"http://lanyrd.com/2015/wait2015/\">Track the event with Lanyrd</a></li>\n<li><a href=\"https://twitter.com/waitconference\">@WAITConference on Twitter</a></li>\n<li><a href=\"https://twitter.com/misterdai/lists/wait2015\">(My own) Twitter list of people speaking, sponsors and conference staff</a></li>\n<li><a href=\"https://twitter.com/search?q=%23wait2015\">Twitter hashtag #wait2015</a></li>\n<li><a href=\"https://plus.google.com/108299214319968150000/posts\">Google+ WAIT Conference</a></li>\n</ul>\n<h3 id=\"see-you-there-\">See you there?</h3>\n<p>Hopefully I&#39;ve done enough to convince you that this conference is worth attending.  If you&#39;re going to attend, I&#39;d love to heard from you and always happy to meet up at the event itself.  Always willing to have a chat about anything I know, learn new things and usually try and give away a collection of GitHub stickers I&#39;ve acquired ;)</p>\n<h3 id=\"update\">Update</h3>\n<p>Unfortunately WAIT 2015 didn&#39;t end up taking place.  Due to several factors that are best all explained by the <a href=\"http://waitconference.eu/posts/2015/03/17/closing-down/\">conference blog post on the subject</a>.  While I was of course gutted, I didn&#39;t let that stop me and actually secured two further speaker appearances for 2015, at <a href=\"http://www.cfcamp.org/\">CFCamp</a> and <a href=\"https://skillsmatter.com/conferences/6612-fullstack\">FullStack</a>.</p>\n","date_published":"2014-11-21T13:00:00.000Z"},{"id":"blog\\article\\2014-11-20.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2014-11-20.md","title":"The World of JavaScript Tomorrow, Today.","content_html":"<p>As much as I enjoy writing JavaScript, there are various parts of it I&#39;m not the biggest fan of.  When I saw Coffee-Script, I loved how much more enjoyable and easier it seemed to write JavaScript.  But eventually there were places that Coffee-Script just seemed to get in the way or was overly fussy.  I then started finding out about what the future holds for JavaScript, I liked what I saw and I wanted it now.\n<!--more--></p>\n<h3 id=\"what-the-future-holds-for-javascript\">What the future holds for JavaScript</h3>\n<p>I won&#39;t delve into everything that ES6 holds, but I&#39;ll cover what caught my eye as the most interesting.  Don&#39;t let me stop you researching into the other changes in ES6 as you might find something more applicable to your own work.</p>\n<h4 id=\"classes\">Classes</h4>\n<p>Class support has been signed off for ES6.  It includes features such as constructors, inheritance (<code>extends</code>), instances, static methods and calling parent class methods (<code>super.method()</code>).</p>\n<pre><code class=\"language-javascript\">class Game {\n  constructor(config) {\n    this.config = config;\n    this.players = [];\n  }\n\n  getType() {\n    return this.config.type;\n  }\n\n  addPlayer(player) {\n    this.players.push(player);\n  }\n}\n</code></pre>\n<h4 id=\"template-strings\">Template Strings</h4>\n<p>These are used for constructing strings with variables and also add support for multiline strings.</p>\n<pre><code class=\"language-javascript\">var multi = `This is\na multiple lined string\nin JavaScript`;\n\nvar mood = &#39;hate&#39;;\nvar output = &#39;I &#39; + mood + &#39; joining strings together&#39;;\n\nvar output = `I ${mood} joining strings together`;\n</code></pre>\n<h4 id=\"arrow-functions\">Arrow functions</h4>\n<p>If you&#39;ve used Coffee-Script, it&#39;s very similar.  You can create a function as a statement or expression with the advantage of it being bound to the same <code>this</code> that you defined it in.  This can be really helpful as <code>this</code> can be quite confusing sometimes unless you&#39;ve bound it to something (<code>.bind(this)</code>).</p>\n<pre><code class=\"language-javascript\">var array = [1,2,3,4].map((v) =&gt; v * Math.PI);\n\nvar random = (num) =&gt; {\n  return num * Math.random();\n};\n</code></pre>\n<h4 id=\"object-literal-improvements\">Object Literal improvements</h4>\n<p>Objects have had a couple of improvements added.  </p>\n<pre><code class=\"language-javascript\">var name = &#39;bob&#39;;\nvar data = {name};\nconsole.log(data);\n// data = {&quot;name&quot;: &quot;bob&quot;};\n\nvar obj = {\n  method() {\n    // Bound to `this`\n  }\n}\n</code></pre>\n<h4 id=\"destructing\">Destructing</h4>\n<p>This provides a nice way to pull out parts of an array or object.</p>\n<pre><code class=\"language-javascript\">var {readdir} = require(&#39;fs&#39;);\n// Sets readdir to require(&#39;fs&#39;).readdir;\n\nvar [exec, script] = process.argv;\n\n// Set a default if it doesn&#39;t exist\nvar [name = &#39;Dave&#39;] = [];\n</code></pre>\n<h4 id=\"block-scoping-with-let-and-const-\">Block scoping with <code>let</code> and <code>const</code></h4>\n<p>Block scoping provides tighter control over your variables and constants.  This can help when you want to avoid clashing variable names or changing values of a variable you&#39;ve referenced in the wrong way.</p>\n<pre><code class=\"language-javascript\">{\n  let name = &#39;Bob&#39;;\n  console.log(name); // &quot;Bob&quot;\n}\nconsole.log(name); // Undefined\n\n// Doesn&#39;t have to be uppercase, I just like uppercase constants ;)\nconst HARDLIMIT = 5;\nHARDLIMIT = 20;\n// Throws an error\n</code></pre>\n<h4 id=\"modules\">Modules</h4>\n<p>You&#39;ve probably encountered modules in JavaScript before, either with Node.js (<code>require()</code>) or with libraries such as CommonJS, AMD and others.</p>\n<pre><code class=\"language-javascript\">export const fpRatio = Math.PI * 9.23 / 0.7734;\n\nexport function facePalmFactor(embarrassmentLevel, handSize) {\n  return embarrassmentLevel / handSize * fpRatio;\n}\n</code></pre>\n<pre><code class=\"language-javascript\">import facePalmFactor from &#39;lib/facePalm&#39;;\nconsole.log(facePalmFactor(707, 618))\n</code></pre>\n<h4 id=\"maps-and-sets\">Maps and Sets</h4>\n<p>Two new types to play with in ES6 are <code>Map</code> and <code>Set</code>.</p>\n<h5 id=\"map\">Map</h5>\n<p>A <code>Map</code> is similar to how a lot of developers currently use the <code>Object</code> type, as a key - value store.  One of the advantages <code>Map</code> offers is that the key can be anything, whereas the key in an <code>Object</code> is always a string.</p>\n<pre><code class=\"language-javascript\">var map = new Map();\n// Use a string a as a key\nmap.set(&#39;name&#39;, &#39;bob&#39;);\n\n// 1 and &#39;1&#39; are not equal\nmap.set(1, 1).set(&quot;1&quot;, &quot;One&quot;);\nconsole.log(map.get(1), map.get(&quot;1&quot;));\n// Outputs: 1 &quot;One&quot;\n\n// Use anything you like as a key\nvar obj = {some: &#39;random&#39;, data: Math.random()};\nmap.set(obj, {trash: &#39;rubbish&#39;});\nconsole.log(map.get(obj));\n// Outputs: {trash: &#39;rubbish&#39;}\n\nconsole.log(map.size); // 4\n</code></pre>\n<h5 id=\"set\">Set</h5>\n<p>The <code>Set</code> type behaves as an ordered list, which will not contain any duplicates.  You add items using its <code>.add(value)</code> method, which will check if it already contains that value using a <code>===</code> comparison (value and type).  A <code>Set</code> doesn&#39;t allow random access, so you can&#39;t jump straight to the fifth item within one, but it is an ES6 <code>iterator</code> allowing you to walk through the values.  It also provides a <code>.has(value)</code> method which returns a <code>Boolean</code> indicator of presence in the set.</p>\n<pre><code class=\"language-javascript\">var set = new Set();\ns.add(&#39;I&#39;).add(&#39;like&#39;.add(&#39;pi&#39;).add(3.14);\ns.size; // 4\n\ns.add(3.14);\ns.size; // 4\n\ns.add(&#39;3.14&#39;);\ns.size; // 5\n\ns.has(&#39;pi&#39;); // true\n</code></pre>\n<h4 id=\"weakmap-and-weakset\">WeakMap and WeakSet</h4>\n<p>Now that you&#39;ve got an idea of <code>Set</code> and <code>Map</code> types, here are their weak variants.  These work in almost the exact same way, except they don&#39;t hold onto references.  If an object is garbage collected by your JavaScript engine, if it had a reference within a <code>WeakMap</code> or <code>WeakSet</code>, it&#39;d still be collected and vanish from your <code>WeakMap</code> or <code>WeakSet</code>.</p>\n<p>Another important point to remember is that these weak versions can not be iterated over.  This is due to the fact that garbage collection may occur and change the data.  If you need a list of the contents (such as the keys in <code>WeakMap</code>), you&#39;d have to maintain a separate list.</p>\n<h4 id=\"promise\">Promise</h4>\n<p>Now a <code>Promise</code> is something that&#39;ll prove really useful when trying to deal with callbacks.  It allows you to wrap code within a promise and use that promise to fulfil other code (or further promises).  Error management is also easier with certain methods provided.  These are worth investigating further, I&#39;d really recommend research further if you haven&#39;t used them before.</p>\n<pre><code class=\"language-javascript\">// Famous setTimeout example\nfunction fakeAsync(message) {\n  return new Promise((resolve, reject) =&gt; {\n    console.log(message);\n    setTimeout(resolve, 923);\n  });\n}\n\nfake(&#39;Hello&#39;)\n  .then(() =&gt; {\n    fakeAsync(&#39;Goodbye&#39;);\n  }).then(() =&gt; {\n    console.log(&#39;.&#39;);\n  });\n\n\n// --- fictional example\nUser.find({name: &#39;misterdai&#39;})\n  .then((user) =&gt; {\n    return Post.save(data, user);\n  })\n  .catch((error) =&gt; {\n    console.error(error);\n    process.exit(1);\n  });\n</code></pre>\n<h4 id=\"iterators-for-of-and-generators\">Iterators, for-of and generators</h4>\n<ul>\n<li><a href=\"https://developer.mozilla.org/en/docs/Web/JavaScript/Guide/The_Iterator_protocol\">MDN - JavaScript Iterators</a></li>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*\">MDN - JavaScript Generators</a></li>\n</ul>\n<p>I&#39;ll let the above resources explain these features.  Simply because I haven&#39;t had chance to play around with them enough to confidently explain them and provide an example.  Also, they feel worthy of their own blog post once I&#39;m comfortable with them.</p>\n<h3 id=\"es6-in-node-js\">ES6 in Node.js</h3>\n<p>There isn&#39;t much in the way of support for ES6 in Node.js, but parts are there.  This is mostly due to the specifications not being fully signed off yet and the V8 version Node.js uses being a little behind (also dependant on which Node version you use).</p>\n<h4 id=\"0-10-x-stable-\">0.10.x (Stable)</h4>\n<p>At the time of writing this was the highest stable release line (0.10.33 to be exact).  It doesn&#39;t contain much from ES6: <code>Number.isFinite</code>, <code>Number.isNaN</code>, <code>const</code> and some other minor parts.  Even then, you may find the implementations incomplete or out of date (e.g. <code>const</code> is not block-scoped).</p>\n<p>There are some command line options you can invoke to beef this support up a little, hidden in the list of V8 options (<code>--v8-options</code>).</p>\n<p><samp>\n--harmony_typeof (enable harmony semantics for typeof)\n      type: bool  default: false\n--harmony_scoping (enable harmony block scoping)\n      type: bool  default: false\n--harmony_modules (enable harmony modules (implies block scoping))\n      type: bool  default: false\n--harmony_proxies (enable harmony proxies)\n      type: bool  default: false\n--harmony_collections (enable harmony collections (sets, maps, and weak maps))\n      type: bool  default: false\n--harmony (enable all harmony features (except typeof))\n      type: bool  default: false\n</samp></p>\n<p>Ignore <code>--harmony-typeof</code>, the reason why it isn&#39;t enabled when you use <code>--harmony</code> is due to it being rejected from the ES6 standard.  Better off without it really.  Other features like <code>--harmony_modules</code> won&#39;t work as the specification wasn&#39;t complete enough at the time.</p>\n<h5 id=\"harmony-0-10\">Harmony 0.10</h5>\n<p>Running with the <code>--harmony</code> flag (e.g. <code>node --harmony index.js</code>) will brighten our dark little world a little with some ES6 goodies.  But in places it&#39;ll work if you set strict mode <code>&quot;use strict&quot;;</code> in your files.</p>\n<ul>\n<li>Better <code>const</code> support (strict only)</li>\n<li><code>let</code> support (strict only)</li>\n<li><code>WeakMap</code>&#39;s</li>\n<li>block-level function declaration</li>\n</ul>\n<h4 id=\"unstable-0-11\">Unstable 0.11</h4>\n<p>The <code>0.11</code> series has been around for over a year at the time of writing (release March 2013) and contains</p>\n<ul>\n<li><code>Math.imul</code></li>\n<li><code>Number</code> complete number properties from ES6</li>\n<li><code>Promise</code> which makes async code management a little easier</li>\n<li><code>WeakMap</code> and <code>WeakSet</code></li>\n</ul>\n<h5 id=\"harmony-0-11\">Harmony 0.11</h5>\n<p>Take this version of node and running it with <code>--harmony</code> provides the following additional support for ES6, on top of what the harmony flag enables for <code>0.10.x</code>.</p>\n<ul>\n<li>All new addtions to <code>Math</code>.</li>\n<li><code>Array</code> now supports <code>.find</code>, <code>.findIndex</code>, <code>.fill</code>, <code>.keys</code>, <code>.values</code>, <code>.entries</code>.</li>\n<li><code>Symbol</code> functionality, although some areas are lacking.</li>\n<li><code>String</code> gets <code>.repeat</code>, <code>.startsWith</code>, <code>.endsWith</code> and <code>.contains</code>.</li>\n<li><code>Map</code> and <code>Set</code></li>\n<li>Octal and Binary literals and <code>Number</code> support.</li>\n<li>Generators and the <code>yield</code> keyword.</li>\n</ul>\n<h4 id=\"is-this-enough-\">Is this enough?</h4>\n<p>Not for me, what can I say apart from &quot;I&#39;m greedy&quot;.  I could probably also say that I really like the look of some other ES6 functionality like: <code>modules</code>, <code>classes</code> and having more complete support of the features Node.js can supply.</p>\n<h3 id=\"traceur\">Traceur</h3>\n<p>Enter Google&#39;s <a href=\"https://github.com/google/traceur-compiler\">Traceur</a>.  This is a compiler that&#39;ll take your ES6 (and even some ES7) code and convert it into ES5 code, providing polyfills for missing features and rewriting code to behave as intended but in your ES5 environment (like Node.js or most web browsers).</p>\n<ul>\n<li><a href=\"https://github.com/google/traceur-compiler/wiki/LanguageFeatures\">List of ES6 features Traceur supports</a></li>\n</ul>\n<p>You can use Traceur to run your code as is or pre-compile it before hand.  I prefer to pre-compile it, as I may not want the extra overhead or additional files required when deploying the code.</p>\n<h3 id=\"gluing-it-together-with-grunt\">Gluing it together with Grunt</h3>\n<p>This is where we&#39;ll actually start getting to work.  The following example shows how I set up my project.</p>\n<ol>\n<li><kbd>mkdir es6</kbd></li>\n<li><kbd>cd es6</kbd></li>\n<li><kbd>npm init</kbd></li>\n<li><kbd>npm install --save-dev grunt grunt-traceur</kbd></li>\n<li><kbd>npm install -g grunt-cli</kbd></li>\n</ol>\n<h4 id=\"-grunt-traceur-\"><code>grunt-traceur</code></h4>\n<p>A grunt plugin that wraps traceur, making it a little easier to use.  It makes it easier to set the options you may want to supply or even have different options for various parts of your source.</p>\n<h5 id=\"traceur-vs-node-js-harmony\">traceur vs. Node.js harmony</h5>\n<p>We&#39;ve already established that Node.js has some ES6 support with it&#39;s harmony flag, especially the <code>0.11</code> series.  In the following examples, I&#39;m going to be targeting Node.js <code>0.11</code> with the <code>--harmony</code> flag enabled.  Because of this choice, there are some ES6 features that I want traceur to leave alone. There&#39;s no point in recompiling code if Node.js can support it.</p>\n<p>This may not be a complete list but I&#39;ll ask traceur to skip over Octal/Binary literals and generators.</p>\n<h5 id=\"source-maps-\">Source maps!</h5>\n<p>If we&#39;re going to try and trace an error in our code back to our original source files, we&#39;ll need a map. Simply due to the fact that traceur will be altering our code to work in ES5.  Traceur will support creation of the map files but we&#39;ll also need an additional module for Node.js to make use of them.</p>\n<h6 id=\"enter-source-map-support-\">Enter <code>source-map-support</code></h6>\n<p><kbd>npm install --save source-map-support</kbd></p>\n<p>We won&#39;t actually make use of this module in any code under <code>es6/src</code>.  Instead it&#39;ll go into the <code>es6/index.js</code> file which will bootstrap our code.</p>\n<h5 id=\"traceur-runtime\">Traceur runtime</h5>\n<p>With all the code rewrites that Traceur performs, it also needs a runtime to inject the rest of its polyfills.  Just like the source map support, we&#39;ll make use of this in our <code>es6/index.js</code> file.</p>\n<p><kbd>npm install --save traceur-runtime</kbd></p>\n<h4 id=\"structure\">Structure</h4>\n<ul>\n<li>es6<ul>\n<li>lib - Destination for our compiled JavaScript (ES5)</li>\n<li>src - Original source of our ES6 JavaScript</li>\n<li>index.js - File used to bootstrap our code</li>\n<li>Gruntfile.js - Our grunt file for compiling</li>\n</ul>\n</li>\n</ul>\n<p>All the code we create should live under <code>es6/src</code>, which is where we&#39;ll tell traceur to look.</p>\n<h4 id=\"gruntfile-js\">Gruntfile.js</h4>\n<pre><code class=\"language-javascript\">module.exports = function(grunt) {\n  grunt.initConfig({\n    traceur: {\n      options: {\n        sourceMaps: &#39;file&#39;,\n        generators: &#39;parse&#39;,\n        numericLiterals: &#39;parse&#39;,\n        modules: &#39;commonjs&#39;\n      },\n      custom: {\n        files: [{\n          expand: true,\n          cwd: &#39;src/&#39;,\n          src: [&#39;**/*.js&#39;],\n          dest: &#39;lib/&#39;\n        }]\n      },\n    },\n    }\n  });\n\n  grunt.loadNpmTasks(&#39;grunt-traceur&#39;);\n\n  grunt.registerTask(&#39;default&#39;, [&#39;traceur&#39;]);\n};\n</code></pre>\n<p>Now we should be able to run <code>grunt</code> and any code contained within <code>es6/src</code> will be compiled by traceur and saved (along with source maps) to <code>es6/lib</code>.</p>\n<h4 id=\"index-js\">index.js</h4>\n<p>Our main bootstrap file.  This will be executed with <code>node --harmony index.js</code> and contains the following:</p>\n<pre><code class=\"language-javascript\">require(&#39;source-map-support&#39;).install();\nrequire(&#39;traceur-runtime&#39;);\n\n// Execute our code\nrequire(&#39;./lib/index.js&#39;);\n</code></pre>\n<h3 id=\"a-minor-example\">A minor example</h3>\n<p>Just to get you started, here is a rather short and daft example.</p>\n<pre><code class=\"language-javascript\">// es6/src/module.js\nexport const fpRatio = Math.PI * 9.23 / 0.7734;\n\nexport function facePalmFactor(embarrassmentLevel, handSize) {\n  return embarrassmentLevel / handSize * fpRatio;\n}\n</code></pre>\n<pre><code class=\"language-javascript\">// es6/src/index.js\nimport {facePalmFactor} from &#39;./module.js&#39;;\n\nconsole.log(facePalmFactor(10, 3));\n</code></pre>\n<p>Then run the following to compile and execute:</p>\n<ol>\n<li><kbd>grunt</kbd></li>\n<li><kbd>node --harmoney index.js</kbd></li>\n</ol>\n<h3 id=\"final-words\">Final words</h3>\n<p>Good luck! If you have any problems putting this together, let me know and I&#39;ll try to help out.  I&#39;m still feeling my way around all of this myself, so if you&#39;ve spotted a mistake or want to suggest something, feel free to let me know in the comments or the various other ways to contact me.</p>\n","date_published":"2014-11-20T13:00:00.000Z"},{"id":"blog\\project\\2014-11-18.md","url":"https://misterdai.yougeezer.co.ukblog\\project\\2014-11-18.md","title":"Whatever happened to hubReports?","content_html":"<p>Another little side project of mine bites the dust, but not due to failure. I discontinued this one due to hitting the limits of my hosting resources and a few other reasons.  Read of if you&#39;re curious.</p>\n<!--more-->\n<h3 id=\"what-was-hubreports-\">What was hubreports?</h3>\n<p>If you have no idea what hubreports was, I&#39;ll try and provide a simple explanation.  It was a side project of mine that accessed <a href=\"https://github.org\">GitHub&#39;s</a> API on a daily basis.  Information was collected on each programming language (that GitHub recognised): Counts of repositories / users / code, top repositories and users, top new repositories and a few other bits and bobs.</p>\n<p>From all the information gathered, several reports were generated as a website.  From the website you could browse these statistics for github as a whole or a specific language (some features were restricted to the top 10 or so languages).  Historical information was also retained, so you could see how a repositories number of stars changed over time or their chart position in relation to other projects.</p>\n<h3 id=\"why-create-it-\">Why create it?</h3>\n<p>Originally I wanted to keep track of new popular repositories on github for my own blog posts.  But the more I dabbled with their API, the more I wanted to create something larger out of it.  I also wanted an excuse to put Node.js and MongoDB to good use, provided a good experience to gain knowledge with them.</p>\n<h3 id=\"its-downfall\">Its downfall</h3>\n<h4 id=\"bad-design-choices\">Bad design choices</h4>\n<p>I used hubreports as a learning exercise.  It became too easy to pick various new trends and try them all out at the same time.  Looking back, I should have stayed well away from AngularJS for this project.  Without having the spare time to come up with a solution, it meant that the site wasn&#39;t going to be indexed by search engines correctly.  With few ways to encourage visitors, it ended up getting pretty quite as no one knew it was there.</p>\n<h4 id=\"no-budget-\">No budget ;)</h4>\n<p>It was a personal project, so with no relation to my day job there was never going to be any help forthcoming with any costs from there.  Personally, I&#39;ve got zero money spare for this sort of thing.  On the odd occasion with my little pet projects, I&#39;ll splash out on a domain or some other cheap one off cost, but any regular cost would always be out of the question.</p>\n<p>Thankfully there were resources available to help with this to a degree.  I took advantage of OpenShift&#39;s free tier to host the project and it worked perfectly...</p>\n<h4 id=\"end-of-the-line\">End of the line</h4>\n<p>Everything has a limit, especially stuff that&#39;s offered for free.  Eventually hubreports had sucked up enough data to reach the memory limits on the OpenShift free tier.  At that point the database server was no longer responding to any requested and I struggled to even get my data out of it manually.  That meant that I could either try and slim down the database or call it a day.</p>\n<h3 id=\"its-success\">Its success</h3>\n<p>I still consider the project a success.  Sure, it didn&#39;t make me millions, but it did help my wrap my head around Node.js and move into more interesting areas with it.  From the knowledge I gained, I felt confident enough to speak on Node.js and Express at a conference for the first time.  Then off the back of that I worked with <a href=\"http://monkehworks.com/\">Matt Gifford</a> on three Node.js related articles for <a href=\"http://www.webdesignermag.co.uk\">Web Designer Magazine</a>.</p>\n<p>It&#39;s a success because all I want out of my side projects is a learning experience.  Sure if one of them ever makes me some money or secures me an amazing job somewhere, I&#39;ll be really happy.  But that&#39;s never the reason I start any of them ;)</p>\n<h3 id=\"what-s-next-\">What&#39;s next?</h3>\n<p>There&#39;s something I&#39;m playing around with.  It&#39;ll be GitHub related again, simply because I love fooling around with their data and I&#39;ll also make use of OpenShift again due to my limited resources.  I don&#39;t want to give much else away but it&#39;ll be a bit of useless fun and not very productive at all.  My challenge with it will be to try and make use of Web Sockets and possibly a client side framework like React or something similar.  Just don&#39;t hold your breath that it&#39;ll be out any time soon ;)</p>\n","date_published":"2014-11-18T13:00:00.000Z"},{"id":"blog\\article\\2014-07-25.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2014-07-25.md","title":"Twitter Bootstrap, customising CSS","content_html":"<p>I&#39;ve always wanted a way to customise <a href=\"http://getbootstrap.com/\">Twitter Bootstrap</a> easily, without having to overwrite existing CSS styles with my own or worry about how I would keep it up to date.  So I decided it was time to try and put together a process to build my own Bootstrap CSS file using the <a href=\"http://lesscss.org/\"><code>.less</code></a> files Bootstrap is built from.  Here&#39;s what I managed to come up with.</p>\n<!--more-->\n<h3 id=\"getting-your-tools-ready\">Getting your tools ready</h3>\n<p>First things first, you&#39;ll need to make sure you have your tools ready.</p>\n<ul>\n<li><a href=\"http://nodejs.org/\"><strong>Node.js</strong></a>: To power the Twitter Bootstrap build process.</li>\n<li><a href=\"https://www.npmjs.org\"><strong>npm</strong></a>: For installing the other tools we need.  This is normally packaged with Node.js but if you find it isn&#39;t, check out its <a href=\"https://www.npmjs.org/doc/README.html\">documentation</a>.</li>\n<li><a href=\"http://bower.io/\"><strong>Bower</strong></a>: Will manage retrieval of Bootstrap and its dependencies.</li>\n<li><a href=\"http://gruntjs.com/\"><strong>Grunt</strong></a>: Used to build our customised version of Bootstrap.</li>\n</ul>\n<p>For <code>node</code> and <code>npm</code>, check out their websites for more information on their installation.  Under most circumstances, <code>npm</code> will be available after you have installed <code>node</code>.  Once they are available, you can use them to install <code>grunt</code> and <code>bower</code>.</p>\n<p><strong>Execute this command</strong></p>\n<pre><code class=\"language-bash\">npm install -g grunt-cli bower\n</code></pre>\n<p>The <code>grunt-cli</code> package provides the <code>grunt</code> command that we&#39;ll be using to execute our build tasks.</p>\n<h4 id=\"eacces-error-\">EACCES error?</h4>\n<p>If you ran the above command and received an <code>EACCES</code> error message, then the user you ran <code>npm</code> with hasn&#39;t got permission to the directory that globally available modules are installed to.  This is usually seen on Linux based systems as they&#39;ll default to <code>/usr/local/lib/node_modules/</code>.  There are a few ways to approach this and the one I&#39;d recommend the most would be to configure <code>npm</code> to use a directory underneath your users <code>$HOME</code>.</p>\n<p><strong>Execute this command</strong></p>\n<pre><code class=\"language-bash\">npm config set prefix ~/npm\n</code></pre>\n<p><strong>Append this to your <code>~/.bashrc</code> file</strong></p>\n<pre><code class=\"language-bash\">export PATH=$HOME/npm/bin:$PATH\n</code></pre>\n<p>If you&#39;re still having problems with this, try searching for help with it elsewhere as there are various other approaches available.  Most suggestions recommend using <code>sudo</code>, but I prefer not having to invoke root powers to install global modules.</p>\n<h3 id=\"grabbing-twitter-by-the-bootstraps\">Grabbing Twitter by the Bootstraps</h3>\n<p>We should now be ready to roll.  Time to grab Twitter Bootstrap.  We&#39;ll create a folder to house our project and ask <code>bower</code> to retrieve Bootstrap for us.</p>\n<pre><code class=\"language-bash\">mkdir website\ncd website\nbower init\nbower install --save bootstrap\nmkdir webroot\nmkdir webroot/css\n</code></pre>\n<p>The <code>bower init</code> line is interactive and will <a href=\"https://www.youtube.com/watch?v=1mC9eOqsyTg\">ask you a bunch of questions</a>.  For our basic usage you should be able to go with the default for all of them, except you may want to consider the question <code>[?] would you like to mark this package as private which prevents it from being accidentally published to the registry?</code>, which I normally answer with <code>Y</code> as you can always change it later if needed.</p>\n<p>Hopefully, you&#39;ll see <code>bower</code> produce messages about Bootstrap and any dependencies, like <code>jquery</code>.  Once it has finished, there will be a new <code>bower_components</code> directory that contains Bootstrap and probably jQuery too.</p>\n<h3 id=\"what-s-the-plan-\">What&#39;s the plan?</h3>\n<p>We have Bootstrap and our tools at the ready but what approach are we taking with our customisations?  I prefer to leave anything under <code>bower_components</code> untouched, to make life simple if we ever update anything underneath it (which is simple with <code>bower update</code>).  The idea is the follow:</p>\n<ul>\n<li>Create a folder for our site code to live in.</li>\n<li>Have our own <code>.less</code> file, in our folder, that includes the Bootstrap <code>.less</code> files.</li>\n<li>Borrow parts of Bootstrap&#39;s <code>Gruntfile.js</code> for building our own <code>.css</code> file.</li>\n</ul>\n<p>This will provide us with the ability to exclude parts of Bootstrap that we may not be using, slimming down the size of the <code>.css</code> file produced.  Plus, the chance to customise the Less variables that control the appearance of Bootstrap, like its colours, sizes and grid.  Following Bootstrap&#39;s approach closely for building means we&#39;ll retain their copyright / license banner, minimised <code>.css</code> file and the <code>.css.map</code> file for easier style debugging.</p>\n<h3 id=\"getting-ready-to-grunt\">Getting ready to grunt</h3>\n<p>We&#39;re going to be using <code>grunt</code> and several of its task modules.  It&#39;s always a good idea to keep track of these when installing them into your project, through creation of a <code>package.json</code> file.  We&#39;ll use <code>npm</code> for the task.</p>\n<pre><code class=\"language-bash\">npm init\n</code></pre>\n<p>Again, you&#39;ll be asked a bunch of question.  If you want to make sure that you never accidentally publish this to the package registry, add a <code>&quot;private&quot;: true&quot;</code> to the <code>package.json</code> file.</p>\n<h4 id=\"what-grunt-packages-do-we-need-\">What grunt packages do we need?</h4>\n<p>It&#39;s a good idea to check what Bootstrap is using, to protect yourself from any changes them may make to their build process.  Within <code>bower_components/bootstrap/Gruntfile.js</code> you will find lines that declare the CSS build tasks.</p>\n<pre><code class=\"language-javascript\">// CSS distribution task.\ngrunt.registerTask(&#39;less-compile&#39;, [&#39;less:compileCore&#39;, &#39;less:compileTheme&#39;]);\ngrunt.registerTask(&#39;dist-css&#39;, [&#39;less-compile&#39;, &#39;autoprefixer&#39;, &#39;usebanner&#39;, &#39;csscomb&#39;, &#39;cssmin&#39;]);\n</code></pre>\n<p>From the registered tasks we can build a list of modules to install and task definitions to duplicate.  We can also skip certain items, if we don&#39;t need them. In this post I won&#39;t bother with <code>less:compileTheme</code> as I want the standard Bootstrap for customisation, plus I&#39;ll skip the <code>csscomb</code> task as that is used for CSS code style formatting.  This gives us the following list:</p>\n<ul>\n<li>less:compileCore</li>\n<li>autoprefixer</li>\n<li>usebanner</li>\n<li>cssmin</li>\n</ul>\n<p>Those are our grunt task configurations and the module names. We now need to check <code>bower_components/bootstrap/package.json</code> file, as it lists the modules installed and their versions, allowing us to easily match module names against the <code>grunt</code> tasks.</p>\n<pre><code class=\"language-javascript\">  &quot;grunt&quot;: &quot;~0.4.5&quot;,\n  &quot;grunt-autoprefixer&quot;: &quot;~0.8.2&quot;,\n  &quot;grunt-banner&quot;: &quot;~0.2.3&quot;,\n  &quot;grunt-contrib-cssmin&quot;: &quot;~0.10.0&quot;,\n  &quot;grunt-contrib-less&quot;: &quot;~0.11.3&quot;,\n</code></pre>\n<p>Now we&#39;ll install those module versions for our own use.</p>\n<pre><code class=\"language-bash\">npm install --save-dev grunt@~0.4.5 grunt-autoprefixer@~0.8.2 grunt-banner@~0.2.3 grunt-contrib-cssmin@~0.10.0 grunt-contrib-less@~0.11.3\n</code></pre>\n<h4 id=\"sniffing-around-bootstrap-s-grunt\">Sniffing around Bootstrap&#39;s Grunt</h4>\n<p>Our modules are ready, we now need to prep our own <code>Gruntfile.js</code> and drop in our customised versions of the tasks we&#39;re mimicking from Bootstrap.  Create <code>Gruntfile.js</code> in our project folder and open it up in an editor, along with <code>bower_componets/bootstrap/Gruntfile.js</code>.  Look for the following tasks:</p>\n<ul>\n<li>less:compileCore</li>\n<li>autoprefixer</li>\n<li>usebanner</li>\n<li>cssmin</li>\n</ul>\n<p>Then we need to take a few steps to customise it for our usage.</p>\n<ul>\n<li>Remove additional task configuration that isn&#39;t need for our use.<ul>\n<li><code>cssmin.docs</code></li>\n<li><code>less.compileTheme</code></li>\n<li><code>autoprefixer.docs</code></li>\n<li><code>autoprefixer.examples</code></li>\n</ul>\n</li>\n<li><p>Update configuration</p>\n<pre><code class=\"language-javascript\">// in less.compileCore\nfiles: {\n  &#39;webroot/css/&lt;%= bspkg.name %&gt;.css&#39;: &#39;webroot/css/customboot.less&#39;\n}\n\n// in less.compileCore.options\nsourceMapURL: &#39;&lt;%= bspkg.name %&gt;.css.map&#39;,\nsourceMapFilename: &#39;webroot/css/&lt;%= bspkg.name %&gt;.css.map&#39;,\npaths: &#39;&lt;%= bspath %&gt;/less&#39;\n\n// in autoprefixer.core\nsrc: &#39;webroot/css/&lt;%= bspkg.name %&gt;.css&#39;\n\n// in cssmin.core, note we remove the &quot;-theme&quot; related line\nfiles: {\n  &#39;webroot/css/&lt;%= bspkg.name %&gt;.min.css&#39;: &#39;webroot/css/&lt;%= bspkg.name %&gt;.css&#39;\n}\n\n// in usebanner.options\nbanner: &#39;&lt;%= banner %&gt;&#39;\n\n// in usebanner\nfiles: {\n  src: &#39;webroot/css/&lt;%= bspkg.name %&gt;.css&#39;\n}\n</code></pre>\n</li>\n</ul>\n<p>After these changes, your <code>Gruntfile.js</code> should look like this:</p>\n<pre><code class=\"language-javascript\">module.exports = function(grunt) {\n  grunt.initConfig({\n    bspkg: grunt.file.readJSON(&#39;bower_components/bootstrap/package.json&#39;),\n    bspath: &#39;bower_components/bootstrap&#39;,\n    banner: &#39;/*!\\n&#39; +\n            &#39; * Bootstrap v&lt;%= bspkg.version %&gt; (&lt;%= bspkg.homepage %&gt;)\\n&#39; +\n            &#39; * Copyright 2011-&lt;%= grunt.template.today(&quot;yyyy&quot;) %&gt; &lt;%= bspkg.author %&gt;\\n&#39; +\n            &#39; * Licensed under &lt;%= bspkg.license.type %&gt; (&lt;%= bspkg.license.url %&gt;)\\n&#39; +\n            &#39; */\\n&#39;,\n    less: {\n      compileCore: {\n        options: {\n          strictMath: true,\n          sourceMap: true,\n          outputSourceFiles: true,\n          sourceMapURL: &#39;bootstrap.css.map&#39;,\n          sourceMapFilename: &#39;webroot/css/bootstrap.css.map&#39;,\n          paths: &#39;&lt;%= bspath %&gt;/less&#39;\n        },\n        files: {\n          &#39;webroot/css/bootstrap.css&#39;: &#39;webroot/css/customboot.less&#39;\n        }\n      }\n    },\n    autoprefixer: {\n      options: {\n        browsers: [\n          &#39;Android 2.3&#39;,\n          &#39;Android &gt;= 4&#39;,\n          &#39;Chrome &gt;= 20&#39;,\n          &#39;Firefox &gt;= 24&#39;, // Firefox 24 is the latest ESR\n          &#39;Explorer &gt;= 8&#39;,\n          &#39;iOS &gt;= 6&#39;,\n          &#39;Opera &gt;= 12&#39;,\n          &#39;Safari &gt;= 6&#39;\n        ]\n      },\n      core: {\n        options: {\n          map: true\n        },\n        src: &#39;webroot/css/bootstrap.css&#39;\n      }\n    },\n    cssmin: {\n      options: {\n        compatibility: &#39;ie8&#39;,\n        keepSpecialComments: &#39;*&#39;,\n        noAdvanced: true\n      },\n      core: {\n        files: {\n          &#39;webroot/css/bootstrap.min.css&#39;: &#39;webroot/css/bootstrap.css&#39;\n        }\n      }\n    },\n    usebanner: {\n      options: {\n        position: &#39;top&#39;,\n        banner: &#39;&lt;%= banner %&gt;&#39;\n      },\n      files: {\n        src: &#39;webroot/css/bootstrap.css&#39;\n      }\n    }\n  });\n\n  // Loading our grunt modules\n  grunt.loadNpmTasks(&#39;grunt-autoprefixer&#39;);\n  grunt.loadNpmTasks(&#39;grunt-banner&#39;);\n  grunt.loadNpmTasks(&#39;grunt-contrib-cssmin&#39;);\n  grunt.loadNpmTasks(&#39;grunt-contrib-less&#39;);\n\n  // CSS distribution task.\n  grunt.registerTask(&#39;dist-css&#39;, [&#39;less:compileCore&#39;, &#39;autoprefixer&#39;, &#39;usebanner&#39;, &#39;cssmin&#39;]);\n\n};\n</code></pre>\n<h4 id=\"less-is-more\">less is more</h4>\n<p>We&#39;re almost there! One last step before we can execute <code>grunt</code> is the creation of our <code>webroot/css/customboot.less</code> file.  The contents of which will be exactly the same as <code>bower_components/bootstrap/less/bootstrap.less</code> so take a copy of that file and rename it for our use.</p>\n<h3 id=\"first-run\">First run</h3>\n<p>Let&#39;s do this.  It&#39;s finally time to run <code>grunt</code> and execute our <code>dist-css</code> task.</p>\n<pre><code class=\"language-bash\">grunt dist-css\n</code></pre>\n<p>This should output something similar to:</p>\n<pre><code class=\"language-bash\">Running &quot;less:compileCore&quot; (less) task\nFile webroot/css/bootstrap.css.map created.\nFile webroot/css/bootstrap.css created: 131.45 kB → 131.5 kB\n\nRunning &quot;autoprefixer:core&quot; (autoprefixer) task\nFile webroot/css/bootstrap.css created.\nFile webroot/css/bootstrap.css.map created (source map).\n\nRunning &quot;usebanner:files&quot; (usebanner) task\n? grunt-banner completed successfully\n\nRunning &quot;cssmin:core&quot; (cssmin) task\nFile webroot/css/bootstrap.min.css created: 132.64 kB → 109.39 kB\n\nDone, without errors.\n</code></pre>\n<h3 id=\"everything-is-awesome\">Everything is awesome</h3>\n<p>We did it! In our <code>webroot/css</code> folder are the following:</p>\n<ul>\n<li><code>bootstrap.css</code>: Our customised Bootstrap CSS file.</li>\n<li><code>bootstrap.min.css</code>: Minimised version of our custom Bootstrap.</li>\n<li><code>bootstrap.css.map</code>: For debugging our CSS.</li>\n<li><code>customboot.less</code>: Our Less based customisations of Bootstrap.</li>\n</ul>\n<h3 id=\"customising\">Customising</h3>\n<h4 id=\"trimming-the-fat\">Trimming the fat</h4>\n<p>Taking our <code>customboot.less</code> file, we can now trim Bootstrap a little by simply commenting out parts that we aren&#39;t currently using.  For example, you might not be using the alerts or progress bars.  Rebuilding now results in a working Bootstrap file that&#39;s a little bit lighter.  If you start using those components, you can simply uncomment them and rebuild.</p>\n<pre><code class=\"language-less\">// @import &quot;alerts.less&quot;;\n// @import &quot;progress-bars.less&quot;;\n</code></pre>\n<p>Personally, I often like to use <a href=\"http://fortawesome.github.io/Font-Awesome/\">Font Awesome</a> with Bootstrap, meaning that Bootstrap&#39;s glyph icons won&#39;t get used.  So I&#39;ll comment it out <code>// @import &quot;glyphicons.less&quot;;</code>, saving myself ~10 kb of CSS and avoiding any chance of loading the icon font.</p>\n<h4 id=\"ch-ch-ch-changes\">Ch-ch-ch-changes</h4>\n<p>How about we change some colours and sizes?  Just peep inside <code>bower_components/bootstrap/less/variables.less</code> for the variables available and append your changes to the bottom of our <code>customboot.less</code> file.</p>\n<pre><code class=\"language-less\">// This will not look nice!\n@body-bg:        #efe;\n@font-size-base: 12px;\n@headings-color: red;\n@navbar-height: 100px;\n</code></pre>\n<h4 id=\"you-can-go-your-own-way\">You can go your own way</h4>\n<p>Since we&#39;re operating in the land of <a href=\"http://lesscss.org/\">Less</a>, you can always start using it to create your own CSS in addition to Bootstraps.  Or even create new CSS rules that are based off Bootstraps existing variables.  That way, if you change a core Bootstrap colour, it&#39;ll be reflected in your own rules that use it.</p>\n","date_published":"2014-07-25T13:00:00.000Z"},{"id":"blog\\publication\\2014-07-24.md","url":"https://misterdai.yougeezer.co.ukblog\\publication\\2014-07-24.md","title":"Contributed to Web Designer #225","content_html":"<p>If you happen upon an issue of <a href=\"http://www.webdesignermag.co.uk/\">Web Designer magazine</a> issue 225, why not grab a copy.  For one, it&#39;s always got some great content, but issue 225 contains a sprinkling of myself within it as I&#39;ve had two mini tutorials published from a super hero team up between myself and <a href=\"http://www.monkehworks.com/\">Matt Gifford</a>, who provided me with the opportunity in the first place.</p>\n<!--more-->\n<h3 id=\"say-hello-to-node-js\">Say Hello to Node.js</h3>\n<p>The main theme of the issue is building HTML5 based games, but if you checkout the bottom right hand corner of the front cover, you&#39;ll see that there&#39;s also a feature article on Node.js.  This is one I contributed to by writing two of the short tutorials.</p>\n<p><img alt=\"Photo of the article introduction\" class=\"center-block img-responsive img-thumbnail\" src=\"/images/blog/2014/07/24/article.jpg\"></p>\n<h3 id=\"reading-the-small-print\">Reading the small print</h3>\n<p>Unfortunately the magazine missed out on the opportunity of a sales boost from having my beautiful face gracing it&#39;s pages.  Instead you&#39;ll find my name tucked away on the contributors list on page 4.</p>\n<p><img alt=\"Photo of my name in the contributor listing\" class=\"center-block img-responsive img-thumbnail\" src=\"/images/blog/2014/07/24/contributors.jpg\"></p>\n<h3 id=\"get-yourself-an-issue-\">Get yourself an issue!</h3>\n<p>Don&#39;t expect any spoilers, if you want to see the complete article then go and grab yourself a copy of Web Designer Magazine issue 225.  Apart from taking a walk to your local shop who may sell a copy, there are a few other ways to get one:</p>\n<div class=\"btn-group btn-group-sm\">\n  <a class=\"btn btn-success\" href=\"https://www.imagineshop.co.uk/magazines/webdesigner/web-designer-issue-225.html\"><i class=\"fa fa-fw fa-book\"></i> Physical</a>\n  <a class=\"btn btn-info\" href=\"http://www.imaginesubs.co.uk/subscribe-to-web-designer\"><i class=\"fa fa-fw fa-truck\"></i> Subscribe</a>\n  <a class=\"btn btn-primary\" href=\"http://greatdigitalmags.com/view/webdesigner/3013/web-designer-issue-225\"><i class=\"fa fa-fw fa-tablet\"></i> Digital</a>\n</div>\n\n\n<h3 id=\"more-to-come-\">More to come?</h3>\n<p>Hopefully! I really enjoyed working with Matt on the article and the challenges involved.  I&#39;ve no idea what my chances are of getting a similar opportunity again when it comes to a magazine but I&#39;ll probably look at posting more on my blog and perhaps trying to submit some tutorials to some of the popular sites out there.</p>\n","date_published":"2014-07-24T13:00:00.000Z"},{"id":"blog\\speaking\\2014-06-20.md","url":"https://misterdai.yougeezer.co.ukblog\\speaking\\2014-06-20.md","title":"Video - All aboard the NodeJS Express","content_html":"<p>For my first ever go of being a speaker, I jumped in at the deep end.  Lots of people, popular subject, lots of cover within the time limit, loads of nerves and a sprinkling of technical issues.  Now you good people get to watch, as a deer caught in headlights presents his talk covering Node.js, NPM and Express at <a href=\"http://sotr.eu\">Scotch on the Rocks 2014</a>.</p>\n<!--more-->\n<h3 id=\"warning-\">Warning ;-)</h3>\n<p>Viewer discretion is advised:</p>\n<ul>\n<li>Contains a bloke being nervous about his 1st talk.</li>\n<li>May contain technical issues due to 4:3 cut-off of 16:9 projections.</li>\n<li>Does contain laptop refusing to display speaker notes + next slide from about 10-15 minutes onwards.</li>\n</ul>\n<h3 id=\"the-video\">The Video</h3>\n<div class=\"embed-responsive embed-responsive-16by9\">\n  <iframe class=\"embed-responsive-item\" src=\"//www.youtube.com/embed/_BKCt2E6cpI\" allowfullscreen frameborder=\"0\"></iframe>\n</div>\n\n<h3 id=\"thanks\">Thanks</h3>\n<p>Thanks to <a href=\"https://twitter.com/sotr\">@SOTR</a> (the Scotch on the Rocks team) and <a href=\"https://twitter.com/ukfast\">@ukfast</a> for recording my talk.</p>\n<p>Also, <a href=\"https://twitter.com/coldfumonkeh\">Matt Gifford</a> (<a href=\"http://www.monkehworks.com\">monkehWorks</a>) who was the conference staff member assigned to my talk. Simply because, at the time of writing, we&#39;ve got the closest to the 50 minute limit (1 minute 1 second under) ;-)</p>\n<h3 id=\"any-questions-\">Any questions?</h3>\n<p>If you&#39;ve any questions related to the talk, I&#39;m happy to answer them.  Feel free to comment here, on the video itself, <a href=\"https://twitter.com/misterdai\">Twitter</a> or via my contact page.</p>\n","date_published":"2014-06-20T13:00:00.000Z"},{"id":"blog\\speaking\\2014-06-10.md","url":"https://misterdai.yougeezer.co.ukblog\\speaking\\2014-06-10.md","title":"Scotch on the Rocks 2014 - As a Speaker","content_html":"<p>I recently gave my first talk at a conference.  It was covering Node.js, it&#39;s package manager npm and the framework Express.  The conference was &quot;Scotch on the Rocks 2014&quot;.  This post shares my experience of being a first time speaker, before going up to speak, during the talk and what happened afterwards. Be warned, it&#39;s a lengthy story...</p>\n<!--more-->\n<h3 id=\"how-it-came-about\">How it came about</h3>\n<h4 id=\"seed-planting\">Seed planting</h4>\n<p>Wait... before I go any further, let&#39;s go back... to Scotch on the Rocks 2011 (Apex International Hotel, Edinburgh, my 3rd Scotch) to the end of the second day.  I was standing around waiting for my work colleagues as we had to leave before the final sessions to catch our flight.  <a href=\"https://twitter.com/fymd\">Andy Allan</a>, the man who is SotR, came over to me for a quick chat, generally see if I had enjoyed the conference and questioned if I&#39;d ever thought about speaking.</p>\n<p>At that moment, the thought had been planted, it just took a few years to grow (plus now you know who to blame).  I&#39;ve never remembered to ask Andy why he asked, I&#39;d like to think it was the way I carried myself on the Guitar Hero night at that same conference (only joking, but I did rock).  For whatever reason, it was now there in my head.</p>\n<h4 id=\"a-year-without-scotch\">A year without Scotch</h4>\n<p>Unforunately there was no Scotch on the Rocks for 2012, the fantastic people behind it were simply too busy at the time.</p>\n<h4 id=\"battle-to-attend\">Battle to attend</h4>\n<p>Then came Scotch 2013 (my 4th).  Scotch was back on the schedule but it didn&#39;t look like I was going to be able to attend, I again toyed with submitting a talk but couldn&#39;t think of a topic I&#39;d like to present on.  Some had suggested my CFTracker project (something else that sprouted from previous SotR&#39;s), but I didn&#39;t feel comfortable with it since it wasn&#39;t very active anymore.  In the end I was very lucky and thankful for two amazing people who managed to sort out accommodation and a ticket as an attendee again.</p>\n<h3 id=\"the-submission\">The Submission</h3>\n<p>Scotch on the Rocks 2014 was announced and the call for speaker submissions was due to start.  That seed planted by Andy finally sprouted into life, partly due to thinking that without speaking I wouldn&#39;t get to attend.  At the time I had been getting into Node.js, using it to power a little side project called hubReports (monitoring github statistics).  I figured if I shared my experience with Node, especially getting my head around the differences from other server-side solutions, it&#39;d make a good basis for a presentation.</p>\n<h3 id=\"getting-accepted-\">Getting Accepted!</h3>\n<p>I got in!  Part of me had doubts that I would, due to being a first time speaker.  All I can think of is that I picked the right topic, title and didn&#39;t have a half bad summary to get selected.  </p>\n<h3 id=\"scotch-on-the-rocks-2014\">Scotch on the Rocks 2014</h3>\n<h4 id=\"the-waiting-game\">The waiting game</h4>\n<p>I&#39;m the kind of guy who has nerves of steel, up until the moment you should be nervous of is right around the corner...  Around two hours before I was due on I started feeling nervous.  I barely ate anything in the food put on for lunch, walked around aimlessly for a bit and then settled down in a corner of the bar with Kev McCabe.  After pottering around with my slides for a bit I ventured back to my hotel room with an hour left but getting more nervous by the minute.  I figured doing a run through in my room would help, except I didn&#39;t manage to get that far before stopping myself.</p>\n<p>First thing that helped was reminding myself that this wasn&#39;t an interview or a test, the people who were going to show up wanted to hear what I was going to say.  Secondly, I&#39;d given up a lot of my free time to constantly research what I was going to speak on so I convinced myself that the content was good enough.  Then with about half an hour left I strolled over to the CAB desk so the heroic <a href=\"https://twitter.com/rob_parkhill\">Rob Parkhill</a> could keep an eye on me and make sure I didn&#39;t do a runner</p>\n<blockquote class=\"twitter-tweet\" lang=\"en-gb\"><p><a href=\"https://twitter.com/misterdai\">@misterdai</a> no way. Where are you? In coming to good you down... Looking forward to your preso!</p>&mdash; Rob Parkhill (@rob_parkhill) <a href=\"https://twitter.com/rob_parkhill/statuses/474520256233615360\">June 5, 2014</a></blockquote>\n\n<h4 id=\"the-talk\">The Talk</h4>\n<p>The &#39;Show and Tell&#39; session came to an end and I walked over to the man that is, <a href=\"https://twitter.com/coldfumonkeh\">Matt Gifford</a>.  As well as speaking at the conference in the morning, he&#39;d been tasked with being my CAB member for my talk.  He got me geared up, on stage, plugged in, ready to rock and more relaxed since we&#39;re usually clowning around in GTAV every week ;-).  So it had begun...</p>\n<p>It felt like a slightly rocky start, getting used to being up on stage and everyone listening.  But the nerves started to settled and I felt like I was getting into it.  Until... my laptop display messed up.  Normally it would be displaying the current slide, next slide, timer (for pacing) and notes for the slide.  Except 10 to 15 minutes into my talk, all that vanished and I felt my stomach pitch.</p>\n<p>I didn&#39;t want to stop, waste some unknown amount of time trying to fix it or start asking for everyone&#39;s patience while I panic.  So I just kept going and somehow managed to get through it all.  Everyone I spoke to said I did a very good job, a lot of them couldn&#39;t tell I was nervous or a first timer.  Even fewer appeared to have any idea that I had my notes disappear on me.  Up on stage though, I felt pretty shaky, struggling to remember what was next, the link between slides and the points I was supposed to be making.  Didn&#39;t remember to get my water out before starting and felt pretty dry.</p>\n<p>Thankfully I made it through to the end, letting my code examples pad out the time until Matt gave me a 5 minute warning.  I finished up and switched to my &quot;Thanks for listening&quot; slide and got stunned by the applause!  My head was so wrapped up in presenting that I totally forgot that I&#39;d probably get one, as thanks for the information I just shared, and it totally shocked me that I even forgot to display my end slide.</p>\n<h4 id=\"questions\">Questions</h4>\n<p>Of course I had a few minutes available to ask for any questions and got a very sensible one about Express templating and how it worked.  Unfortunately part of the audience decided to leave, not that quietly, which caused a cascade effect of others leaving.  I was gutted that I didn&#39;t get more questions while on stage but at least I answered the one (had many more asked off stage thankfully).</p>\n<blockquote class=\"twitter-tweet\" lang=\"en\"><p>Dear attendees. If a speaker is answering a question please don&#39;t get up to leave and make a lot of noise. Bad form. <a href=\"https://twitter.com/search?q=%23sotr14&amp;src=hash\">#sotr14</a></p>&mdash; Matt Gifford (@coldfumonkeh) <a href=\"https://twitter.com/coldfumonkeh/statuses/474559535127212034\">June 5, 2014</a></blockquote>\n\n<h4 id=\"the-aftermath\">The aftermath</h4>\n<p>It felt like such a rush clambering down off the stage.  I really didn&#39;t know what to do with myself and my head was buzzing from believing that I did a pretty good job.  Amazing to see tweets in response to my talk and others commenting in person as I walked around in a daze ;-)</p>\n<blockquote class=\"twitter-tweet\" lang=\"en\"><p><a href=\"https://twitter.com/misterdai\">@misterdai</a> Well done on the talk. You came across really well :) also liked the NotBen refs!</p>&mdash; Sally Jenkinson (@sjenkinson) <a href=\"https://twitter.com/sjenkinson/statuses/474559514910670849\">June 5, 2014</a></blockquote>\n\n<blockquote class=\"twitter-tweet\" lang=\"en\"><p>Good taster of node.js from <a href=\"https://twitter.com/misterdai\">@misterdai</a> <a href=\"https://twitter.com/search?q=%23SOTR14&amp;src=hash\">#SOTR14</a> </p>&mdash; Adam Cameron (@dacCfml) <a href=\"https://twitter.com/dacCfml/statuses/474548905146077184\">June 5, 2014</a></blockquote>\n\n<blockquote class=\"twitter-tweet\" lang=\"en\"><p>You would not have known that was his first conference talk! <a href=\"https://twitter.com/misterdai\">@misterdai</a> just confidently explained Node.js at <a href=\"https://twitter.com/search?q=%23sotr14&amp;src=hash\">#sotr14</a></p>&mdash; Claire Brotherton (@abrightclearweb) <a href=\"https://twitter.com/abrightclearweb/statuses/474552926212734976\">June 5, 2014</a></blockquote>\n\n<h3 id=\"later-feedback\">Later feedback</h3>\n<p>There have been some blog posts from others at the conference, all good in my opinion so far :)</p>\n<blockquote>\n<p>I still must confess, that even with the enthusiastic words of David Boyer, I don’t have a use-case scenario for using node.js in my head yet – on a dev server, sure, essential – but haven’t got a project where it would work on a production server yet. One to keep in mind though.\n<small><a href=\"https://twitter.com/neokoenig\">Tom King</a> via <a href=\"http://www.oxalto.co.uk/2014/06/quick-report-from-sotr2014/\">his blog</a></small></p>\n<p>This was the presentation I was most looking forward to, and David delivered the goods. What surprised me was that it was his first time presenting, and his notes disappeared from screen 10min into the presentation. He held it together well (I did not notice a change in presentation quality at the 10min mark, for one thing), and he&#39;s convinced us to get Node.js installed (which we&#39;d need to do for Grunt.js anyhow) @ work and see what we can do with it. Nolte had it installed and running and doing stuff during the presentation itself.\n<small><a href=\"https://twitter.com/dacCfml\">Adam Cameron</a> via <a href=\"http://cfmlblog.adamcameron.me/2014/06/what-i-took-away-from-scotch-on-rocks.html\">his blog</a></small></p>\n</blockquote>\n<h3 id=\"what-would-i-do-differently-\">What would I do differently?</h3>\n<h4 id=\"preparation\">Preparation</h4>\n<p>When putting my presentation together, I started out constructing the slides as I went along.  This definitely didn&#39;t feel right for me (may work for others) and it felt like I wasted a lot of time and thought.  Eventually I decided to <code>cat brain &gt; dump.talk</code> the entire details of the talk from my head to a single file, then start splitting it apart and matching it up with slides.  I felt this approach worked really well.</p>\n<h4 id=\"laptop\">Laptop</h4>\n<p>My laptop isn&#39;t the best ;) but I could have spent more time trying to test / configure / fix it before.  It didn&#39;t want to mirror displays in an easy (and non-buggy) way and I managed to break my bluetooth dongle on my way to the conference. Which meant no wii-mote for controlling the slides.</p>\n<p>A printed version of my slides + notes as a backup would have been useful and a pdf copy so they&#39;re separate from the browser based presentation.</p>\n<h4 id=\"water-\">Water!</h4>\n<p>A top quality tip from <a href=\"https://twitter.com/aliaspooryorik\">John Whish</a>, who I met at a previous Scotch just before his own first ever conference talk.  I&#39;m guessing my nerves distracted me and I left it in my bag, didn&#39;t really want to rummage around for it half way through so struggled on with a very dry mouth and throat.</p>\n<blockquote class=\"twitter-tweet\" lang=\"en-gb\"><p><a href=\"https://twitter.com/misterdai\">@misterdai</a> <a href=\"https://twitter.com/coldfumonkeh\">@coldfumonkeh</a> my advice: backup everything, get water, say if you want questions only at the end (e.g. you have a lot to fit in).</p>&mdash; John Whish (@aliaspooryorik) <a href=\"https://twitter.com/aliaspooryorik/statuses/473839128996749312\">June 3, 2014</a></blockquote>\n\n<h4 id=\"code\">Code</h4>\n<blockquote class=\"twitter-tweet\" lang=\"en\"><p>Dear presenters at every dev conference ever:&#10;Your code examples need to be super high-contrast and MASSIVE, or they&#39;re worthless. <a href=\"https://twitter.com/search?q=%23sotr14&amp;src=hash\">#sotr14</a></p>&mdash; Laura Kishimoto (@chicgeek) <a href=\"https://twitter.com/chicgeek/statuses/474922634971721728\">June 6, 2014</a></blockquote>\n\n<p>I&#39;ve yet to find out if Laura attended my talk but I hope the text was large enough, I even had one comment that my terminal text was too big! Her point about high-contrast is probably valid to parts of my presentation.  Code within my slides weren&#39;t using the best theme and I could have also picked a better scheme for Brackets too.</p>\n<h4 id=\"live-coding\">Live coding</h4>\n<p>I felt like I failed a bit with my live coding.  Again, I&#39;ll lay most of the blame on the laptop, since it wouldn&#39;t mirror the displays I had to crane my neck to see the code on the large screens.  Plus, I&#39;d geared everything towards 16:9 and the stage screens were unfortunately 4:3, kept losing the edge off my slides and editor.</p>\n<p>Originally I had a node-webkit powered presentation kit but I chickened out from using it.  I put it together so I could avoid having to drop out of the presentation slides since it had the following features:</p>\n<ul>\n<li>Code-Editor: Edit code within a slide.</li>\n<li>Runnable Examples: Execute code from the editor.</li>\n<li>Multiple output: Tabs for Editor, Terminal (for console.log&#39;s) and iframe for web output.</li>\n</ul>\n<p>With some more polish, it&#39;d be a fantastic way to demo everything.</p>\n<h3 id=\"thanks-\">Thanks!</h3>\n<p>Numerous people helped me along the way with little comments and tips.  My awesome family &amp; friends, <a href=\"https://twitter.com/coldfumonkeh\">Matt Gifford</a> (especially <a href=\"http://www.monkehworks.com/taking-to-the-stage-talking-at-your-first-conference\">this post</a> of his), <a href=\"https://twitter.com/rob_parkhill\">Rob Parkhill</a>, <a href=\"https://twitter.com/fymd\">Andy Allan</a> (seed planter), <a href=\"https://twitter.com/Lagaffe\">Guust Nieuwenhuis</a> and numerous others.</p>\n<h3 id=\"will-i-do-it-again-\">Will I do it again?</h3>\n<p>Heck yeah!  Except for the nerves, which I managed and will be better next time, I really enjoyed the whole experience.  The only thing that would stop me speaking would be cost and possibly time away from home.  I&#39;ve a zero budget for this sort of thing and normally restrict myself to &quot;Scotch on the Rocks&quot; only, because I love it and I can usually get my employer to help.  Anything I can get to, and back from, on the day would be doable, or conferences who cover travel+hotel (I&#39;ll eat cheap :P).</p>\n<p>Bottom line, I&#39;ve got the bug and it wants me to present again :)</p>\n<script async src=\"//platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n","date_published":"2014-06-10T13:00:00.000Z"},{"id":"blog\\article\\2014-02-15.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2014-02-15.md","title":"DocPad","content_html":"<p>As I&#39;ve mentioned <a href=\"/posts/1963/\">previously on my blog</a>, I&#39;ve jumped ship from using <a href=\"http://wordpress.com\">Wordpress.com</a> to a <a href=\"http://docpad.org/\">DocPad</a> produced static site that is hosted on <a href=\"https://github.com\">GitHub</a> using their <a href=\"http://pages.github.com/\">&quot;pages&quot; feature</a>.  In this post I&#39;ll walk through the basic steps I took to get up and running with DocPad.</p>\n<!--more-->\n<h3 id=\"installing-docpad\">Installing DocPad</h3>\n<p>You&#39;ll need to have <a href=\"http://nodejs.org/\">Node.js</a> and <a href=\"https://www.npmjs.org/\">NPM</a> installed before you go any further.  Once you&#39;ve sorted that out, we&#39;ll continue.</p>\n<p>First, you&#39;ll need to open up a command prompt and type the following command.</p>\n<pre><code class=\"language-bash\">npm install -g docpad\n</code></pre>\n<p><strong>Note</strong>: If you run into any permission problems you may need to slap a &quot;sudo &quot; infront of it.</p>\n<p>This installs docpad as a global command that&#39;ll now be available where ever you type it.  From here you&#39;ll need to create a directory to house your docpad development area and then get docpad up and running.</p>\n<pre><code class=\"language-bash\">mkdir geekonomics\ncd geekonomics\ndocpad run\n</code></pre>\n<h3 id=\"in-the-dark-dark-folder-some-skeletons-lived\">In the dark dark folder, some skeletons lived</h3>\n<p>At this point, docpad will provide you a list of skeletons you can base your site upon.  These include the HTML5 Boilerplate, Twitter Bootstrap, various flavours of them and a few others as well.  For the sake of finding our way around docpad, let&#39;s make like a jellyfish and go with &quot;No Skeleton&quot;.</p>\n<p>Docpad will now go about grabbing all the Node.js modules your new site will use and create the basic folders.  When it has finished, it&#39;ll load up a load web server and tell you the address (usually <a href=\"http://localhost:9778\">http://localhost:9778</a>).  Don&#39;t expect to find much there, yet...</p>\n<h3 id=\"not-found\">Not Found</h3>\n<p>We picked the &quot;No Skeleton&quot; option, so docpad has given us a blank canvas to work with.  If you go to the site as it stands, you&#39;ll just get a &quot;Not Found&quot; message.</p>\n<h3 id=\"bits-n-bobs\">Bits n&#39; Bobs</h3>\n<p>Taking a look at the folder we&#39;ve run docpad within, you&#39;ll see that it&#39;s created a few folders and files.  These are pretty important going forward so I&#39;ll briefly explain each of them.</p>\n<ul>\n<li><strong>node_modules</strong>: If you haven&#39;t used Node.js before, this is simply where all the installed modules for this site are kept.  Nothing to really concern yourself with at the moment.</li>\n<li><strong>src</strong>: This is where all the action will be happening.<ul>\n<li><strong>documents</strong>: From what I understand, any file within this folder (or subfolders thereof) will be specially processed.  We&#39;ll get into that soon enough.</li>\n<li><strong>files</strong>: Simply put, all docpad is going to do with these files is copy them to the output folder.</li>\n<li><strong>layouts</strong>: Collection of files that&#39;ll provide layout for files within &quot;<strong>documents</strong>&quot;</li>\n</ul>\n</li>\n<li><strong>out</strong>: You probably won&#39;t see this yet, but it&#39;ll be created when you start creating your site.  It holds the output of docpad, the finished site.</li>\n<li><strong>docpad.coffee</strong>: The sites docpad settings.  It&#39;s written in <a href=\"http://coffeescript.org/\">CoffeeScript</a> which is designed to make JavaScript a little more presentable and nicer to write.  You could always <a href=\"http://js2coffee.org/\">convert between CoffeeScript and JavaScript</a> if you want to avoid using it.  Docpad will accept JavaScript, JSON, CoffeeScript and CSON based configuration files.</li>\n<li><strong>package.json</strong>: This file contains information used by NPM to track the modules that the docpad site needs, information about your code and any other modules you want to use.</li>\n<li><strong>README.md</strong>: A standard readme file based in markdown, for you to use.</li>\n</ul>\n<h3 id=\"baby-steps\">Baby steps</h3>\n<p>Let&#39;s get started.  Fire up an editor of your choice, create a file <code>src/documents/index.html</code> and get creative with some HTML content within it.  Once you&#39;ve saved the file, checkout your command prompt that should still have docpad running.  You&#39;ll see some activity where it spotted the file you created and regenerated the site.  Confirm this by refreshing your browser <a href=\"http://localhost:9778\">http://localhost:9778</a>.</p>\n<h3 id=\"template-engine-plugins\">Template engine plugins</h3>\n<p>Before we go any further, I&#39;d like to mention template engines.  Docpad supports a diverse range of template engines via plugins, which are easy to install and use.  For this post I&#39;ll initially be using one that adds support for <a href=\"https://github.com/sstephenson/eco/\">embedded CoffeeScript</a>.  You&#39;ll first need to stop docpad (<code>Ctrl+C</code>) and then run the following command to install the plugin.</p>\n<pre><code class=\"language-bash\">docpad install eco\n</code></pre>\n<p>Now rename <code>src/documents/index.html</code> to <code>index.html.eco</code> and edit the contents to include something like:</p>\n<pre><code class=\"language-markup\">&lt;p&gt;It&#39;s all fun and games.&lt;/p&gt;\n&lt;p&gt;Generated on: &lt;%= new Date().toString() %&gt;&lt;/p&gt;\n</code></pre>\n<p>Fire docpad back up with <code>docpad run</code> and go to your browser and refresh.  You should now see our same old index.html page with a date outputted.  Docpad saw that your file ended with <code>.eco</code> and processed it with the embedded CoffeeScript plugin.  It then chopped the <code>.eco</code> off the name when it created the final <code>index.html</code> file within the <code>out</code> directory.  Clever ;-)</p>\n<p>You could of course leave the file as <code>index.html</code> if you&#39;ve no need of any dynamic content during generation.  I only did this as an excuse to desribe the template engine before we moved onto...</p>\n<h3 id=\"document-metadata-and-layouts\">Document metadata and layouts</h3>\n<p>Remember how I mentioned that <code>src/documents</code> was a special place.  Well every (text based) file that lives in that folder can have metadata associated with it.  We do this at the top of the file (like our <code>src/documents/index.html.eco</code>) between two lines of <code>---</code> and writing some <a href=\"http://www.yaml.org/\">YAML</a> or you could use <a href=\"https://github.com/bevry/cson\">CSON</a> if you indicate it with <code>--- cson</code> at the top.</p>\n<pre><code class=\"language-markup\">---\ntitle: &quot;Welcome to the jungle!&quot;\nlayout: &quot;default&quot;\n---\n&lt;p&gt;It&#39;s all fun and games.&lt;/p&gt;\n&lt;p&gt;Generated on: &lt;%= new Date().toString() %&gt;\n</code></pre>\n<p>Now when docpad generates the page, it&#39;ll internally carry the data you&#39;ve specified... and throw an error.  Why!?  Because we&#39;ve used a special metadata item of <code>layout</code> and set it to <code>&quot;default&quot;</code>.  This tells docpad that we want to wrap the output of this file within a layout file.  We&#39;d better go and create one then as <code>src/layouts/default.html.eco</code>.  Make sure you add that <code>.eco</code> to the file name and throw in the follow as the contents:</p>\n<pre><code class=\"language-markup\">&lt;html&gt;\n&lt;head&gt;\n  &lt;title&gt;&lt;%= @document.title %&gt; | My Website&lt;/title&gt;\n&lt;/head&gt;\n&lt;body&gt;\n  &lt;h1&gt;&lt;%= @document.title %&gt;&lt;/h1&gt;\n  &lt;%- @content %&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n</code></pre>\n<p>We&#39;re getting somewhere now!  Refresh and you&#39;ll see that your content has been injected into the layout file we&#39;ve created.  Now we could have numerous pages that use this layout, which should save us a lot of time.  If you&#39;ve other layouts you&#39;d like to use, simple create them within the layouts folder and specify them in the metadata of the document.  It&#39;s even possible to have nested layouts.</p>\n<p><code>src/documents/pages/about.html</code></p>\n<pre><code class=\"language-markup\">---\ntitle: &quot;About me&quot;\nlayout: &quot;page&quot;\n---\n&lt;h2&gt;About me&lt;/h2&gt;\n&lt;p&gt;Some interesting facts about myself...&lt;/p&gt;\n</code></pre>\n<p><code>src/layouts/page.html.eco</code></p>\n<pre><code class=\"language-markup\">---\nlayout: &quot;default&quot;\n---\n&lt;p&gt;Page: &lt;%= document.title %&gt;&lt;/p&gt;\n&lt;div class=&quot;content&quot;&gt;\n  &lt;%- @content %&gt;\n&lt;/div&gt;\n</code></pre>\n<p>In the above example, the about page would be injected into the page layout before it&#39;s then injected into the default layout.  You could use this to provide a similar layout for a set area of your site (e.g. pages, posts, projects...) compared to other areas of your site.</p>\n<h3 id=\"getting-out-of-dodge-wordpress-\">Getting out of dodge (wordpress)</h3>\n<p>There are a few methods available to get your posts out of wordpress.  However, I decided to make my life harder and do it manually.  I won&#39;t go into the process I put myself through in detail but it involved the following steps:</p>\n<ul>\n<li>Log into Wordpress.com dashboard for the blog</li>\n<li>Use the &quot;Export&quot; feature to download all posts and pages.</li>\n<li>Save the XML file provided.</li>\n<li>Created script to interate over the XML file, containing the blog posts.</li>\n<li>Used pandoc to convert posts to markdown.</li>\n<li>Spent a while fixing issues with HTML encoding, wordpress shortcodes, code samples and more.</li>\n</ul>\n<p>In the end I had a folder full of markdown files named after their ID: /posts/*.html.markdown</p>\n","date_published":"2014-02-15T13:00:00.000Z"},{"id":"blog\\gaming\\2014-02-12.md","url":"https://misterdai.yougeezer.co.ukblog\\gaming\\2014-02-12.md","title":"XBox Avatars","content_html":"<p>I get quite a few hits from people coming here looking at an <a href=\"/posts/592/\">old post about XBox avatar images</a>.  I decided to update it a little by adding a simple form that&#39;ll let you type in your gamertag to display the images and provide the URL&#39;s.</p>\n<!--more-->\n<p><form class=\"form-horizontal\" role=\"form\" id=\"post-gamertag-form\">\n  <div class=\"form-group has-success has-feedback\">\n    <label class=\"control-label col-sm-3\" for=\"post-gamertag\">Enter your XBox GamerTag</label>\n    <div class=\"col-sm-9\">\n      <input type=\"text\" class=\"form-control\" id=\"post-gamertag\" value=\"misterdai\"><span class=\"fa fa-check form-control-feedback\"></span>\n      <p class=\"help-block\">Note: Unmatched Gamertags will return empty images.</p>\n    </div>\n  </div>\n</form></p>\n<p><h3>Gamerpics</h3></p>\n<p><div class=\"text-center row\">\n  <div class=\"col-sm-3\">\n    <h4>Small (32x32)</h4>\n    <input class=\"form-control\" id=\"post-gamerpic-small-href\" value=\"http://avatar.xboxlive.com/avatar/MisterDai/avatarpic-s.png\">\n    <img src=\"http://avatar.xboxlive.com/avatar/MisterDai/avatarpic-s.png\" height=\"32\" width=\"32\" alt=\"XBox Avatar Gamerpic - Small\" class=\"img-thumbnail\" id=\"post-gamerpic-small\">\n  </div>\n  <div class=\"col-sm-4\">\n      <h4>Large (64x64)</h4>\n      <input class=\"form-control\" id=\"post-gamerpic-large-href\" value=\"http://avatar.xboxlive.com/avatar/MisterDai/avatarpic-s.png\">\n        <img src=\"http://avatar.xboxlive.com/avatar/MisterDai/avatarpic-l.png\" height=\"64\" width=\"64\" alt=\"XBox Avatar Gamerpic - Large\" class=\"img-thumbnail\" id=\"post-gamerpic-large\">\n  </div>\n  <div class=\"col-sm-5\">\n      <h4>Body (300x150)</h4>\n      <input class=\"form-control\" id=\"post-gamerpic-body-href\" value=\"http://avatar.xboxlive.com/avatar/MisterDai/avatarpic-s.png\">\n      <img src=\"http://avatar.xboxlive.com/avatar/MisterDai/avatar-body.png\" height=\"300\" width=\"150\" alt=\"XBox Avatar Gamerpic - Body\" class=\"img-thumbnail\" id=\"post-gamerpic-body\">\n  </div>\n</div></p>\n<script src=\"/attachments/blog/2014-02-12/xbox.js\"></script>\n","date_published":"2014-02-12T13:00:00.000Z"},{"id":"blog\\reports\\2014-02-07.md","url":"https://misterdai.yougeezer.co.ukblog\\reports\\2014-02-07.md","title":"JavaScript hubReport: #1","content_html":"<p>This post looks at the top 10 JavaScript projects on GitHub that were created in the last 30 days.  I&#39;m using my <a href=\"http://hubreports.yougeezer.co.uk\">hubReports</a> project for the information and then looked into each entry to learn a little more about them.  I&#39;ve also linked each entry to its GitHub page and hubReports statistics page.  This should be the start of a series of posts that&#39;ll I&#39;ll endeavour to put out monthly.</p>\n<!--more-->\n<h3 id=\"javascript-on-github-top-10-new-projects-for-the-last-30-days\">JavaScript on GitHub, Top 10 new projects for the last 30 days</h3>\n<h4 id=\"1st-maxogden-cool-ascii-faces\">1st: maxogden/cool-ascii-faces</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/maxogden/cool-ascii-faces\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/maxogden/cool-ascii-faces\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>Putting a smile on my face and my screen at the same time.  This is a CLI, Node and Browser module for returning an ascii character based &quot;face&quot;.  That&#39;s all there is to it :-).  I love how it has taken the number one spot and the fact it has had <a href=\"https://github.com/maxogden/cool-ascii-faces/pulls?direction=desc&amp;page=1&amp;sort=created&amp;state=closed\">pull requests</a>.</p>\n<h4 id=\"2nd-chjj-termcoin\">2nd: chjj/termcoin</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/chjj/termcoin\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/chjj/termcoins\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>A bitcoin (BTC) wallet for your terminal using Node.js.  It uses bitcoind for the backend but is compatible with other cryptocurrency RPC servers, so it can also operate as your litecoin, dogecoin and other wallets.</p>\n<h4 id=\"3rd-maxogden-taco\">3rd: maxogden/taco</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/maxogden/taco\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/maxogden/taco\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p><a href=\"http://hubreports.yougeezer.co.uk/user/maxogden\">Max Ogden</a> with another entry in the charts.  This time it&#39;s for a taco, his attempt at creating a &quot;taco themed&quot; PaaS for Node.js servers.  He mentions that it&#39;s still early days (alpha quality), so if you do try it out, be careful and be sure to help him iron those bugs out.</p>\n<p>The goal is to automate / configure everything to avoid the need to SSH in and configure stuff yourself.  Checkout the repo page for more details and his <a href=\"https://github.com/maxogden/taco#features\">feature wishlist</a> if you&#39;re interested in helping out.</p>\n<h4 id=\"4th-seanhaufler-banned-bluebook\">4th: seanhaufler/banned-bluebook</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/seanhaufler/banned-bluebook\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/seanhaufler/banned-bluebook\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>A <a href=\"http://haufler.org/2014/01/19/i-hope-i-dont-get-kicked-out-of-yale-for-this/\">possibly controversial</a> entry from <a href=\"http://haufler.org/\">Sean Haufler</a>.  It&#39;s the source code for his Chrome Extension, which is designed to enhance the Yale Bluebook site with the ability to sort courses by average rating and workload.  This is after Yale decided to block a website that did the exact same thing.  See his <a href=\"http://haufler.org/2014/01/19/i-hope-i-dont-get-kicked-out-of-yale-for-this/\">blog post</a> for more details.</p>\n<h4 id=\"5th-darthdeus-lighttable-ruby\">5th: darthdeus/LightTable-Ruby</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/darthdeus/LightTable-Ruby\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/darthdeus/LightTable-Ruby\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>LightTable is a JavaScript (I think...) based IDE and this is a plugin for it that adds support for Ruby.  <a href=\"http://blog.jakubarnold.cz/\">Jakub Arnold</a> states that it&#39;s simple at the moment but indicates that it&#39;ll grow more powerful as he takes it further.</p>\n<p><strong>note</strong> from this point on, the order won&#39;t match that on <a href=\"http://hubreports.yougeezer.co.uk/repos/stars_new_month/JavaScript\">hubReports</a> due to certain issues.</p>\n<h4 id=\"6th-substack-attractor\">6th: substack/attractor</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/substack/attractor\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/substack/attractor\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>This project appears to focus on binding data between your frontend and backend modules, using HTML attributes.  Initially we&#39;re shown data-binding similar to what you&#39;d experience in AngularJs, applying a HTML attribute to an input box and HTML elsewhere, type in the box and the data magically updates in the respective places.  We&#39;re then shown an example of &quot;live-updating&quot;, having a Node.js web app keep the browser side bind updated with any database changes of the server-side data item.</p>\n<h4 id=\"7th-substack-git-http-backend\">7th: substack/git-http-backend</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/substack/git-http-backend\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/substack/git-http-backend\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>Another one from the amazing <a href=\"http://hubreports.yougeezer.co.uk/user/substack\">James Halliday</a> (a.k.a. SubStack). This is a Node.js powered backend to serve a git repository over http.  Create a repo or use an existing one and then fire this project up.  You&#39;ve then created a http server you can (at the very least) push to and clone from.  It also makes mention of supporting your own git-{receive,upload}-pack implementations or it can make use of system versions.</p>\n<h4 id=\"8th-inear-devtools-shortcuts\">8th: inear/devtools-shortcuts</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/inear/devtools-shortcuts\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/inear/devtools-shortcuts\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>A handy extension to Chrome&#39;s DevTools.  It adds a shortcut tab to the elements sidebar-pane which will display a list of DOM elements that have been marked by having the HTML attributes inspect=true, inspect or data-inspect set.  I&#39;ve yet to try it out myself but many a time I&#39;ve disliked having to dig through the DOM to find certain elements, it&#39;s nice to have a way to highlight them via an attribute.</p>\n<h4 id=\"9th-bevacqua-suchjs\">9th: bevacqua/suchjs</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/bevacqua/suchjs\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/bevacqua/suchjs\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>This is a client side JavaScript library for browsers in the vain of jQuery.  But not just any browsers, &quot;Evergreen Browsers&quot;.  What are they?  <a href=\"http://tomdale.net/\">Tom Dale</a> has a great <a href=\"http://tomdale.net/2013/05/evergreen-browsers/\">blog post detailing it</a> which is definitely worth a read, but to quickly summarise it is a browser that updates itself without prompting the user (e.g. like Chrome updates).  So for a project like this, it can provide essential jQuery-like methods using a lot less code as it won&#39;t worry about older browsers that require manual updates (read: linger around too long).</p>\n<h4 id=\"10th-cuducos-whiskyton\">10th: cuducos/whiskyton</h4>\n<p><a href=\"http://hubreports.yougeezer.co.uk/repo/cuducos/whiskyton\">hubReport</a>{:.btn .btn-sm .btn-primary} <a href=\"https://github.com/cuducos/whiskyton\">GitHub</a>{:.btn .btn-sm .btn-info}</p>\n<p>Not sure if this entry should have made it into the charts, but GitHub decided it was 85% JavaScript based.  The server side of it is written in Python though.  It&#39;s a web application designed to help you find whiskys you&#39;d hopefully like via an open database it accesses.  You can also try out a <a href=\"http://whiskyton.herokuapp.com/\">live version</a> of the web app if you&#39;re tempted to have a tipple.</p>\n","date_published":"2014-02-07T13:00:00.000Z"},{"id":"blog\\article\\2014-02-06.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2014-02-06.md","title":"From Wordpress.com to DocPad","content_html":"<p>I&#39;ve moved away from WordPress.com for hosting of my blog.  Due to a combination of wanting more control over my site (and not having to pay for some of that control) plus the chance to try out some of these static site generators that are available for Node.js</p>\n<!--more-->\n<h3 id=\"wordpress-com-exodus\">WordPress.com exodus</h3>\n<p>My first step in migration was to grab an export from WordPress.  Easily enough to achive through the dashboard and selecting the options to export.  This produced an XML file with all my pages, posts and comments.  My only issue with the resulting XML was WordPress&#39;s source for each of my posts.  Each was HTML based, still including their shortcode tags (not much of a problem) but without any paragraph tags.</p>\n<h3 id=\"docpad\">DocPad</h3>\n<p>After toying around with some static site generates and investigating other potentially related projects like Ghost, I settled on <a href=\"http://docpad.org/\">DocPad</a>.  It appeared to be very popular in comparison to other similar projects and I found the documentation very useful.</p>\n<h3 id=\"what-i-liked\">What I liked</h3>\n<h4 id=\"control\">Control</h4>\n<p>I ended up feeling much more in control of my site than when I&#39;ve used a CMS / Blogging platform.  While  I do miss having a front-end to create content easily, it&#39;s nice having such a flexible system and simplified hosting requirements.</p>\n<h4 id=\"speed-on-the-server-\">Speed (on the server)</h4>\n<p>It&#39;s all static :) Don&#39;t need to worry about any effort trying to boost performance or stressing over a database.</p>\n<h3 id=\"annoyances\">Annoyances</h3>\n<h4 id=\"markdown\">Markdown</h4>\n<p>This one isn&#39;t really the fault of DocPad, more of an issue with the Markdown parsers available.  I really like Markdown, but wanted just a little extra control.  There&#39;s a few other flavours of Markdown available, like Maruku and the &quot;Extra&quot; versions.  Of which, I liked the idea of being able to specify attributes for the generated HTML the most.</p>\n<pre><code>![Fake image](image.png){:.img-thumbnail}\n&lt;img src=&quot;image.png&quot; alt=&quot;Fake image&quot; class=&quot;img-thumbnail&quot;&gt;\n</code></pre><p>Plus inline HTML was a must.  Unfortunately for me, I couldn&#39;t find a decent parser for Node.js that supported this extra syntax and allowed inline HTML.  Markdown-js was the best I stumbled across but didn&#39;t support the inline HTML.  In the end I modified the library to prevent it escape HTML characters (except within code examples).  Then I replaced the &quot;Marked&quot; module used by a docpad plugin to process markdown to HTML.  Worked in the end ;-)</p>\n<h4 id=\"rss\">RSS</h4>\n<p>There&#39;s an RSS plugin available.  I would have liked to use it but it didn&#39;t seem flexible enough to allow me to only use the initial part of a blog post in the feed, instead of the whole article.  Instead I went with an XML template that creates the feed itself, allow me the extra flexibility when constructing the RSS feed.</p>\n<h4 id=\"performance\">Performance</h4>\n<p>With just over 100 posts, DocPad takes a long time to regenerate on my slightly old laptop.  Not especially the fault of DocPad but an annoyance for me when updating my site.  I&#39;m still finding my way around DocPad, so I may have contributed to the generation time in some way.</p>\n","date_published":"2014-02-06T21:30:00.000Z"},{"id":"blog\\project\\2014-01-26.md","url":"https://misterdai.yougeezer.co.ukblog\\project\\2014-01-26.md","title":"hubReports: Project review","content_html":"<p><a href=\"http://hubreports.yougeezer.co.uk\">hubReports</a> is a side project of mine.  It&#39;s a site that gathers data from GitHub on a daily basis and then presents it via the website.  I went live with the latest interation of it on November 1st 2013 and thought it was time to review how I think it did and where to go next.</p>\n<!--more-->\n<h3 id=\"the-launch\">The Launch</h3>\n<p>The project had previously existed under a different domain but with the hubreports name still and a slightly different focus.  After rewriting the project, adjusting its target, I felt ready to go public.</p>\n<p>First week page views (all stats mentioned are from Google Analytics) total 1,172 followed by 1,444 the next.  Not a bad start but that was with a lot of tweeting, Google plus posts and a blog post.  The big factor of the launch was being featured in the &quot;StatusCode&quot; weekly newsletter, <a href=\"http://statuscode.org/archive/46.html\">issue #46</a>, from <a href=\"https://twitter.com/peterc\">Peter Cooper</a> of <a href=\"http://javascriptweekly.com/\">JavaScript Weekly</a>.  Off the back of that I hit 6,161 for that week and a second week of 5,287.</p>\n<h3 id=\"initial-response\">Initial Response</h3>\n<p>I didn&#39;t receive much in the way of feedback except for a few comments from people on Twitter.  It seemed to be liked as there were plenty of tweets that simply shared the site, which also helped pull in more visitors.  The lack of more in-depth feedback did make me wonder which parts of the site were working well and which needed the most attention.</p>\n<h3 id=\"back-down-to-earth\">Back down to Earth</h3>\n<p>This year so far, the site gets around 300 to 200 page views a week.  Not amazingly busy but considering this whole project was based on teaching myself new stuff and better techniques, I&#39;m reasonably happy with that number.</p>\n<h3 id=\"what-went-wrong-\">What went wrong?</h3>\n<h4 id=\"angularjs-and-seo\">AngularJS and SEO</h4>\n<p>Early in the project I decided to use AngularJS.  There were a few reasons behind this, including some planned features being easier to implement and trying to keep the bandwidth usage to an absolute minimum.  Mostly because of my hosting budget (zero).  Unfortunately, AngularJS based sites aren&#39;t easily indexable by search engines as they require JavaScript.  There are a few techniques I&#39;ve seen that provide server rendered versions or data to search engines, but I haven&#39;t looked into those yet and don&#39;t know if any would be out of reach for my available resources.</p>\n<p>Not being easy to index for search engines makes the site very difficult to find.  The majority of visitors are refered from the Statuscode newletters, blog posts and tweets.</p>\n<h4 id=\"github-weekly\">GitHub weekly</h4>\n<p>No hard feelings towards GitHub, couldn&#39;t have done hubReports without them, but they went and created a weekly newsletter for trending repositories.  That&#39;s going to cut into my expected audience a little but probably wouldn&#39;t have made much of an impact.</p>\n<h4 id=\"displaying-data\">Displaying data</h4>\n<p>I have all this data, but I&#39;m not entirely sure what the best method for display it is.  I&#39;ve also certain features planned (allowing language / repo / user comparisons) but without any feedback I&#39;ve held back on implementing them as I&#39;m unsure on the best way to display the data.  Purely based on my worry on how the rest of the existing site is being received.</p>\n<h4 id=\"the-missing-newsletters\">The missing newsletters</h4>\n<p>There was a &quot;News generation&quot; feature planned, I haven&#39;t had chance to work on it enough.  It was to be used for the basis of weekly newsletters for each &quot;top / specially selected&quot; language that hubReports monitors.  Having those newsletters available, I believe, would increase the regular audience of the site.</p>\n<h4 id=\"data-data-data-\">Data, data, data...</h4>\n<p>hubReports gathers all of its data from the GitHub API.  While having the advantage of making my life easier, there have been the odd bugs with the API that&#39;ll cause headaches in my data (missing repositories / users) or failure of a collection for that day.  I&#39;d much prefer to be working with the data from the <a href=\"http://www.githubarchive.org/\">GitHub Archive</a>.  But that isn&#39;t quite on the cards from my initial investigation.  Mostly due to the fact that it&#39;s a lot of data to process and I haven&#39;t the available resources to constantly process the feed for statistics, without impacting the hubReports site itself.</p>\n<h3 id=\"what-went-well\">What went well</h3>\n<h4 id=\"angularjs\">AngularJS</h4>\n<p>Even though it made my life difficult with search engines, it made my life easier when it came to putting the site together.</p>\n<h4 id=\"learning-experience\">Learning experience</h4>\n<p>Throwing this project together allowed me the chance to work with: Node.js, MongoDB, OpenShift hosting, CDN&#39;s, AngularJS, Grunt, Express and a few others.  While I&#39;ve toyed around with some of this stuff already, it was nice to have a set purpose to aim for and apply them to.</p>\n<h3 id=\"the-world-of-tomorrow\">The world of tomorrow</h3>\n<p>Where will hubReports go from here?  I&#39;ve decided to focus on a few areas that I felt let the project down:</p>\n<ul>\n<li><strong>Comparisons</strong>: I&#39;d like to provide a way of selecting another language / repository / user, while viewing one and providing an easy way to compare their statistics.  This would be more interesting if I throw a dynamic graph in there, so the compared statistics can be seen over time.</li>\n<li><strong>News generation</strong>: For the goal of creating newsletters, I need (+want) more content in them, than just having tables of trending repositories and a few graphs.</li>\n<li><strong>Increase Search engine friendlyness</strong>: Some time definitely needs to be spent making the site more indexable.  If for whatever reason I find it out of reach for the resources I have available, then so be it.</li>\n<li><strong>Data retention</strong>: I <em>must</em> make this a priority.  The database is hosted on the free tier of OpenShift and I&#39;ll eventually hit it with the entire site probably grinding to a halt of forever serving out of date data.  My initial target will be repositories / users who haven&#39;t been seen by hubReports for a set period of time.  That&#39;ll buy myself a decent amount of extra time.  If that turns out to be a simple enough job, I may also look at how to deal with data retention of statistics.  Possibly going with a RRD like solution to prevent data growth by averaging out stats over time (the older data gets, the lower resolution it is held at).</li>\n</ul>\n<h3 id=\"thoughts-\">Thoughts?</h3>\n<p>Any comments on any of this is more than welcome.  But if you think the whole project is pointless, it may not be worth saying so as I value the site primarily as a learning experience, so it wouldn&#39;t be entirely constructive if you did ;-)</p>\n","date_published":"2014-01-26T21:30:00.000Z"},{"id":"blog\\speaking\\2013-12-18.md","url":"https://misterdai.yougeezer.co.ukblog\\speaking\\2013-12-18.md","title":"Speaking at Scotch on the Rocks 2014","content_html":"<p>Let me just state that again as you may need to double check it as much as I did. I’m speaking at <a href=\"http://sotr.eu\">Scotch on the Rocks 2014</a>, taking place in Edinburgh on the 5th and 6th of June 2014.\n<!--more--></p>\n<h3 id=\"the-conference\">The conference</h3>\n<p><a href=\"/images/blog/2013/12/18/logo_change_grey.png\"><img src=\"/images/blog/2013/12/18/logo_change_grey.tn245.png\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>Scotch on the Rocks is a conference held in Edinburgh, Scotland.  It’ll be covering topics in the following areas:</p>\n<ul>\n<li><strong>Front End</strong> (CSS, JavaScript, HTML5, Optimisation)</li>\n<li><strong>Back End</strong> (CFML, Ruby, Groovy, node.js)</li>\n<li><strong>People &amp; Processes</strong> (Agile, Continuous Improvement, Building\nteams</li>\n</ul>\n<p>Held at the <a href=\"http://www3.hilton.com/en/hotels/united-kingdom/hilton-edinburgh-grosvenor-hotel-EDNGRHN/index.html\">Hilton Edinburgh Grosvenor</a> on June 5th &amp; 6th 2014.  It’s a fantastic conference that’s been around since 2005 (want <a href=\"http://sotr.eu/history.html\">more history?</a>), originally focused on ColdFusion (a.k.a. CFML) it has expanded to cover other languages, development techniques and other web development related topics.   The awesome learning experience aside, it also has a brilliant social atmosphere with plenty going on outside the main conference hours.</p>\n<h3 id=\"from-serial-attendee-to-speaker-\">From serial attendee to speaker*</h3>\n<p><a href=\"/images/blog/2013/12/18/p1260670.jpg\"><img src=\"/images/blog/2013/12/18/p1260670.tn300.jpg\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>It’s a privilege to be speaking at SotR14. I’ve managed to attend the conference on four previous occasions (2009, 2010, 2011, 2013) and thoroughly enjoyed it every time (which should be obvious from the photo). The speakers have always been fantastic, the organisers know how to put on a great show, I always come back with a head bursting with ideas and found the other attendees an amazing bunch. Having learnt so much from attending, this year I thought I’d try my hand at speaking instead.</p>\n<h3 id=\"my-session\">My Session</h3>\n<p><a href=\"/images/blog/2013/12/18/nodejs.png\"><img src=\"/images/blog/2013/12/18/nodejs.tn300.png\" alt=\"alt\" title=\".img-thumbnail.center-block\"></a></p>\n<p>I’ll be presenting my talk titled “All aboard the NodeJS Express”.  It will start with an introduction to Node.js, followed by its amazing package management tool (NPM) and then showing how to bring in Express to create a basic site. Why am I qualified to talk about this? I have a project called <a href=\"http://hubreports.yougeezer.co.uk\">hubReports</a>, which is built using Node.js and Express (with a sprinkling of MongoDB and AngularJS), collecting information from GitHub on a daily basis to produce language, repository and user charts. Alongside that I’ve used Node.js for various other tasks, inside and outside of my day job.</p>\n<h3 id=\"-other-speakers-are-available\">*Other speakers are available</h3>\n<p>It’s scary enough being in the same line up as the mighty <a href=\"http://sotr.eu/speakers.html#bruce\">Bruce Lawson</a> (Opera), let alone some of the other speakers (I won’t mention names as some have yet to be announced).  I will say that they have a fantastic line up of speakers covering a nice range of topics.  For myself, as a first time speaker at this kind of event, it’s a little bit intimidating looking at the caliber of the line up but I’ll not worry myself until I know who I’m sharing a timeslot with ;-)</p>\n<h3 id=\"see-you-there-\">See you there?</h3>\n<p>If you’re attending SotR14 and tempted by my session, feel free to mention any areas of my topic that you’re most interested in. Hopefully I’ll be able to either include it, expand on it or brush up and chat about it afterwards. :-)</p>\n","date_published":"2013-12-18T12:53:25.000Z"},{"id":"blog\\project\\2013-11-11.md","url":"https://misterdai.yougeezer.co.ukblog\\project\\2013-11-11.md","title":"Properly introducing... hubReports","content_html":"<p>I’ve finally released a version of my github report site &quot;<a href=\"http://hubreports.yougeezer.co.uk\">hubReports</a>&quot; that I’m happy with. This post covers how this little side project came into being, what it grew into and where it’s going.\n<!--more--></p>\n<h3 id=\"early-version\">Early version</h3>\n<p>Back in November 2012 I was playing around with the github API to try and monitor new CFML based projects for my open source update posts. I liked the idea of tracking some of the statistics (stars / forks) available for each repositories and the idea of “charts”, for example: Top 20 Starred repositories overall. This spawned a little side project, resulting in reports like this:</p>\n<p><a href=\"/images/blog/2013/11/11/hubreports-old.png\"><img src=\"/images/blog/2013/11/11/hubreports-old.tn298.png\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>Originally it was a manually executed job, written in ColdFusion, run on a weekly basis. It produced a set of static HTML reports with trends shown as sparklines for each aspect. Eventually I had it monitoring 5 selected languages.</p>\n<h3 id=\"the-alpha\">The alpha</h3>\n<p>From there I started rewriting it with the idea of running it daily. I also took the opportunity to learn something new and threw NodeJS, MongoDB and AngularJS into the mix. Things went well and I had a few early alpha versions but the hosting I was using had some issues that prevented me taking it much further.</p>\n<p><a href=\"/images/blog/2013/11/11/hubreports-alpha.png\"><img src=\"/images/blog/2013/11/11/hubreports-alpha.tn283.png\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>After that, I went idle for a while. I took some time to learn more about NodeJS and saw some changes planned for the github API that would be of use to me. Then came the current iteration of the project…</p>\n<h3 id=\"hubreports-\">hubReports!</h3>\n<p><a href=\"/images/blog/2013/11/11/hubreports-home.png\"><img src=\"/images/blog/2013/11/11/hubreports-home.tn196.png\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p><a href=\"http://hubreports.yougeezer.co.uk\">http://hubreports.yougeezer.co.uk</a></p>\n<ul>\n<li>Runs a data collection task against github on a daily basis.</li>\n<li>Attempts to cover all languages that github considers “programming”.</li>\n<li>Every language has basic statistics tracked and made available.</li>\n<li>Based on those statistics, a set of top languages is determined (plus some just picked by myself :P).</li>\n<li>Each “top language” is delved into further, looking at repositories and users.</li>\n<li>Top 15 charts based on various aspects, are collected.</li>\n<li>Each entry (repo or user) in those charts are also tracked.</li>\n</ul>\n<p>This does mean that you might not find yourself on the hubReports site as I only monitor those who appear in the charts.  I haven’t got access to enough API calls and storage to monitor everything ;-)</p>\n<h3 id=\"future\">Future</h3>\n<h4 id=\"upcoming-features\">Upcoming features</h4>\n<p>There are still some features I’d love to add to the site and currently working on. They include stuff like:</p>\n<ul>\n<li>Language comparisons: Select two (or maybe a few more) languages and compare their statistics as they stood that day or since they’ve been tracked.</li>\n<li>Improved “Charts”: The top language / repo / user charts need some more attention. I’d like to add something like a heat map or an “amount of change” value / indicator. This would be handy for seeing how an item may be climbing up faster than others in the charts.</li>\n<li>Public Gists statistics: Kind of a bug at the moment, a users public gists should be monitored but isn’t since the count is only available in the “beta” part of the github API. I’m still deciding if I’ll take the risk and use the beta or stick with their main API, waiting to see what they release down the line.</li>\n<li>Achievements: Each language, user and repository that’s monitored will have achievements calculated for it, like personal best records. An example would be an area showing the top chart position they’ve ever achieved and how long they reigned or their maximum stars / forks.</li>\n<li>Weekly Language Newsletters: After the achievements system is smoothly rolled out, I’d like to package that information up along with other stuff into a weekly email newsletter, for each of the “Top / chosen languages”. These would be opt-in email lists that’d receive the auto-generated newsletter, possibly with some additional content from someone with knowledge of the language in question. There’d probably also be a global one, not tied to a single language.</li>\n</ul>\n<h4 id=\"budget-currently-zero-for-now-\">Budget - Currently Zero! (for now…)</h4>\n<p>Apart from the my spare time I’ve managed to avoid having to pay out anything. The site is running on OpenShift, which provide 3 “gears” for free. 1 instance runs the MongoDB for storing all the information collected and the other 2 host the NodeJS based application. It’s an awesome service and I’m so grateful that it’s available for trying out little projects like these. There are two factors to note. If the site gets too popular, it may struggle to cope. My OpenShift setup runs on a single gear currently and set to scale up to 2 if things get busy. After that point, it’s all down to optimising the code further or working out how to cover the cost of scaling further. The other issue is data retention. At some point down the line, MongoDB instance will hit its allowance and stop accepting any more data. From there on, I’ve some tricks to compress the data down, remove non-changing statistics where I can but they’ll only carry me onto a certain point. After that, certain repositories and users will have to be removed if they haven’t been seen in the “charts” for a long enough period. Finally, older data would have to be expired or costs will be involved. Why am I rattling on about this? Just so people know that the site could go through some teething issues or even disappear if it can’t scale up to the task. Not due to my lack of trying ;)</p>\n<h3 id=\"feedback\">Feedback</h3>\n<p>Go on! Give me some feedback!  I’d love to hear what you think.  The whole project was spawned out of a little need of mine, plus a desire to try out NodeJS, MongoDB and AngularJS.  But if anyone finds it useful, or thinks it could be with a few additions or changes, let me know. You can leave comments on this blog post, use my contact form or fill out the survey after visiting the site itself.</p>\n<ul>\n<li><a href=\"http://hubreports.yougeezer.co.uk\">hubReports</a></li>\n<li><a href=\"http://twitter.com/hubreports\">@hubReports on Twitter</a></li>\n<li><a href=\"https://docs.google.com/forms/d/1Lga3GLRP7nsdNR2_QWxaZHfsk7F1nexsL6bwPkTJW3U/viewform\">Survey for the site</a></li>\n</ul>\n","date_published":"2013-11-11T12:50:12.000Z"},{"id":"blog\\article\\2013-06-14.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2013-06-14.md","title":"My Adobe ColdFusion wishlist","content_html":"<p>Here’s my wish list for any future versions of Adobe ColdFusion.  It’s partially inspired from what Adobe stated at their SotR13 keynote.  Some of it may have already been covered by their roadmap and some parts are wishes for improvements to existing features.  I’ve not thought much about the new mobile features that Adobe are aiming for, simply because I’d like to see this stuff in action first and don’t really know how much usage I’d make of it in my day job.\n<!--more--></p>\n<h3 id=\"deployment-testing-ci\">Deployment / Testing / CI</h3>\n<p>Adobe always seemed to try and sell ColdFusion for “Rapid Development”.  That’s great but if you want to boost that further, make it easier to do the development tasks that us developers should be doing.  Help us with solutions (guides, software, scripts etc…) to improve deployments (from dev to staging and production), do unit testing and CI. <a href=\"http://henke.ws/\">Mike Henke</a> has a &quot;<a href=\"https://github.com/mhenke/Cloudy-With-A-Chance-Of-Tests\">Cloudy with a chance of tests</a>&quot; project that helps developers get started with this sort of thing.  But what if Adobe worked with developers to make this more standard and an optional part of the “developer” install?</p>\n<h3 id=\"modular\">Modular</h3>\n<p>Having spent a bit of time in the world of NodeJS, I love how nice it feels to only bring in a module for some functionality when you need it.  I’d think this would probably improve performance in some areas as well as possibly allow for easier deprecation and removal of old features.</p>\n<h3 id=\"deprecation\">Deprecation</h3>\n<p>I can understand that this is always a tricky one to approach.  If ACF was more modular in nature and allowed developers to create their own modules that could operate as normally named tags / functions, we’d have a nicer solution for deprecation.  Take &quot;<code>ParameterExists()</code>&quot; as an example, if it’s removed from a new version of ACF and a customer wants to upgrade but still needs the tag (lol), they could easily hire a developer to create a module for it.  You could even allow overwriting of existing function, with your module code reimplementing old behaviour on top of the new version of the function. I’m sure some would abuse this to create something horrible, but for the more sensible developers / customers, it’d allow the rubbish to be removed from the engine.</p>\n<h3 id=\"package-management\">Package Management</h3>\n<p>Kind of leading on from the Modular nature above.  A package management tool would work wonders for ColdFusion.  Especially if it came with an open standard for projects to support for easy installation or inclusion into an existing project.  <a href=\"http://fusiongrokker.com/\">Adam Tuttle</a>’s <a href=\"https://github.com/CFCommunity/ramen\">Ramen</a> looks good but something official would be even better, especially if it was web and command line based.</p>\n<h3 id=\"cfscript-support\">CFScript support</h3>\n<p>I love me some CFScript.  Tags are great for my view templates but script feels much nicer when it comes to the grunt work.  Pretty sure that Adobe have stated several times that they’ll achieve parity with the tags but it always seems to get pushed back to CFNext+1.</p>\n<h3 id=\"new-functions-based-on-community-usage\">New functions based on community usage</h3>\n<p>There are probably a lot of things that CFML projects always reimplement.  If Adobe went through some of the major projects, found out what these were and included built in solutions, they’d make for some happier developers and improve development time.  Plus there are certain things that projects have to go digging into Java or abusing bits of ColdFusion to get at.  If it’s something simple or some kind of information, it’d be better for everything if it was exposed officially instead of being left to go digging for.</p>\n<h3 id=\"better-security\">Better security</h3>\n<p>At SotR13, Adobe did talk about the importance of security and I hope they really do focus on this.</p>\n<h3 id=\"work-with-hosting-providers\">Work with hosting providers</h3>\n<p>These are the people who have the experience with deploying ColdFusion for multiple customers, trying to maintain all those instances and making sure they’re secure.  If Adobe put more effort into working with these providers, it might provide insight into changes that’d make everyone’s life easier and more secure when it comes to deployment.</p>\n<h3 id=\"web-contexts-or-similar\">Web contexts or similar</h3>\n<p>This is one of the things I really like about Railo and I’m not expecting Adobe to implement the idea in the exact same way but it’d be nice to have the ability to separate out settings / administration at a lower level than just instance wide.</p>\n<h3 id=\"monitoring\">Monitoring</h3>\n<p><strong>Warning: </strong>This bit will get a little rant-ish due to CFTracker ;)</p>\n<p>Better monitoring and instance inspection!  Some people out there (points towards the internet) find CFTracker a useful tool for monitoring their Adobe CF servers.  While that makes me happy, it also boggles my mind to think that a poor developer with a full time job, wife and 3 kids could manage to create something useful that Adobe haven’t thought about feature stealing from. I don’t expect them to try and include something at the level of FusionReactor/Analytics, SeeFusion or this new Morpheus4Railo thingybob.  Those products have money, teams and time behind them.  But my little side project… come on, seriously?</p>\n<p>P.S. Adobe, if that’s you reading this, I’m happy to have money thrown at me to help you out in this area.  K, thanks, bye. P.P.S. If not, any other company? ;)</p>\n","date_published":"2013-06-14T12:41:09.000Z"},{"id":"blog\\conference\\2013-06-12.md","url":"https://misterdai.yougeezer.co.ukblog\\conference\\2013-06-12.md","title":"The Ben Nadel Mask of SotR13","content_html":"<p>Eventually I’ll write up a summary post on my thoughts of Scotch on the Rocks 2013, but until then I wanted to share this magical moment. It all began when I realised that <a href=\"http://www.bennadel.com\">Ben Nadel</a> wouldn’t be making an appearance at SotR13.  If you don’t know who he is, apart from being an awesome developer and prolific blogger, he has a tradition of taking photos with people and doing a thumbs up pose.  These pictures are then posted as part of his blog header, randomly being displayed.</p>\n<!--more-->\n<p><a href=\"/images/blog/2013/06/12/bennadelblog.png\"><img src=\"/images/blog/2013/06/12/bennadelblog.tn300.png\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>No Ben for 2013 meant no photo opportunities!  I did <a href=\"https://twitter.com/misterdai/statuses/337595155995578368\">jokingly suggest a cardboard cut\nout</a> but it didn’t get picked up on.  So, come the final day before SotR13, I quickly found a <a href=\"http://www.flickr.com/photos/deesadler/4855655904/\">decent picture of Ben</a> facing straight forward and printed it out.  Then during my 8 hour train journey to Edinburgh, I carefully crafted the mask out of a “Contractor” neck lanyard loop, some thin cardboard and the excess sticky paper from around some Moo CFTracker stickers I had.</p>\n<p>I honestly had no idea how well people would take this daft idea as I usually only meet them at the conferences and sometimes haven’t had much chance to socialise.  Gave Ben Nadel the heads up (accidental pun!) on the mask, just to be sure he was okay with things and then waited for a good time to strike…</p>\n<h3 id=\"first-strike\">First strike</h3>\n<p>That moment was near the end of the first day.  With some time in hand before Bruce Lawson’s session started, I sat down behind <a href=\"https://twitter.com/CFJamesAllen\">James Allen</a> (big Ben Nadel fan :P), put the mask on and tapped him on the shoulder.  Awesome reaction and it lead to the first picture…</p>\n<p><a href=\"/images/blog/2013/06/12/guust.jpg\"><img src=\"/images/blog/2013/06/12/guust.tn300.jpg\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>Then quickly, before it made it up on Twitter, Guust and I went into the FuzzyOrange room. Guust, camera ready, walked up to <a href=\"https://twitter.com/fymd\">Andy Allan</a> and started saying that he thought Ben Nadel couldn’t make it.  My cue to sneak up and grab Andy for a classic Ben Nadel pose…</p>\n<p><a href=\"/images/blog/2013/06/12/andy.jpg\"><img src=\"/images/blog/2013/06/12/andy.tn300.jpg\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<h3 id=\"the-free-bar\">The free bar</h3>\n<p>I’d have been bonkers not to take the mask to the free bar.  So in I strolled, focusing on grabbing a drink and finding people I know.  After some fooling around between ourselves, things had to escalate ;)  Just as the free bar was closing, <a href=\"https://twitter.com/coldfumonkeh\">Matt Gifford</a> announced a special guest who’d be willing to pose for pictures, Ben Nadel (myself behind the mask).</p>\n<p><a href=\"/images/blog/2013/06/12/free.jpg\"><img src=\"/images/blog/2013/06/12/free.tn300.jpg\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>It was such a good laugh.  Loads of people came up for a photo, with the fantastic <a href=\"https://twitter.com/CFJamesAllen\">James Allen</a> as official “Not Ben” photographer.  From there we progress to the main hotel bar, fooling around with the mask, others having a go at wearing it and posing with more people.  You can see all the pictures in the:</p>\n<p><strong><a href=\"https://plus.google.com/u/0/photos/106428886425456416826/albums/5887933439328840337\">The Wacky Adventures of Ben Nadel</a></strong></p>\n<h3 id=\"the-final-night\">The final night</h3>\n<p>The end of the last day of SotR13.  Some people had left but there were still quite a few of us staying for another night.  Yet more opportunities to use the Not Ben Nadel Mask.  It all started out similar to the previous night, more pictures but mostly with anyone we missed.  Then a totally random moment occurred that made us step everything up a gear.  A father and his little boy came over, with the Dad asking if his boy could try on the mask, so we let him…</p>\n<p><a href=\"/images/blog/2013/06/12/little.jpg\"><img src=\"/images/blog/2013/06/12/little.tn262.jpg\" alt=\"\" title=\".img-thumbnail.center-block\"></a></p>\n<p>The Mum of the family kept asking “But who is it?…” with the Dad appearing to not be worried. At this point I was laughing so much I was crying and had to steal away the camera to show some of the others. This spurred us on to photo bombing of the mask into pictures (foreground and far background), recreating the lift scene from the Gangnam Style music video and taking to the street for some extra madness.</p>\n<h3 id=\"shake\">Shake</h3>\n<p>It came to a point where James and myself were drained from the whole experience.  Laughed out, running low on inspiration and starting to run out of time.  We kept talking about trying a Harlem Shake but didn’t think we could convince enough people as it’d need a decent section of the bar.  In the end it started to come together. Opening sequence cast:</p>\n<ul>\n<li>David Boyer (<a href=\"http://twitter.com/misterdai\">@misterdai</a>) as Ben Nadel (<a href=\"http://twitter.com/BenNadel\">@BenNadel</a>)</li>\n<li>Guust Nieuwenhuis (<a href=\"http://twitter.com/lagaffe\">@lagaffe</a>)</li>\n<li>Joe Roberts (<a href=\"http://twitter.com/zefer\">@zefer</a>)</li>\n<li>Matt Bourke (<a href=\"http://twitter.com/gummatt\">@gummatt</a>)</li>\n<li>Rob Parkhill (<a href=\"http://twitter.com/rob_parkhill\">@rob_parkhill</a>)</li>\n<li>James Allen (<a href=\"http://twitter.com/CFJamesAllen\">@CFJamesAllen</a>)</li>\n</ul>\n<p>Closing shake cast then included the additions of:</p>\n<ul>\n<li>Rob-Brooks Bilson (<a href=\"http://twitter.com/styggiti\">@styggiti</a>)</li>\n<li>Mark Drew (<a href=\"http://twitter.com/MarkDrew\">@MarkDrew</a>)</li>\n<li>Darren Walker (<a href=\"http://twitter.com/bayornet\">@bayornet</a>)</li>\n<li>Pierre-Olivier Chassay (<a href=\"http://twitter.com/moonpo\">@moonpo</a>)</li>\n</ul>\n<p>All together producing one incredible Scotch on the Rocks 2013 final moment…</p>\n<div class=\"embed-responsive embed-responsive-16by9\">\n  <iframe class=\"embed-responsive-item\" src=\"https://www.youtube.com/embed/tsAbPTI0N8g?rel=0\" allowfullscreen=\"\"></iframe>\n</div>\n\n<h3 id=\"update\">Update</h3>\n<p>Eventually this was followed up with this lovely video :)</p>\n<div class=\"embed-responsive embed-responsive-16by9\">\n  <iframe class=\"embed-responsive-item\" src=\"https://www.youtube.com/embed/5unwjje-oUI?rel=0\" allowfullscreen=\"\"></iframe>\n</div>\n","date_published":"2013-06-12T11:25:10.000Z"},{"id":"blog\\article\\2013-05-22.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2013-05-22.md","title":"CF9: onRequestEnd Vs. CFDocument","content_html":"<p>An odd thing happened to me on the way to the end of my request… I bumped into CFDocument, caught up on old times, but without realising I managed to end up back tracking a few steps, to a place I had already travelled through.  Here is my story of a weird behaviour between CFDocument and onRequestEnd().\n<!--more--></p>\n<h3 id=\"premise\">Premise</h3>\n<p>Our opening scene contains a simple Application.cfc file.  It’s using onRequest to capture the output from the requested file and then onRequestEnd to embed it in a layout file.  Everything goes to plan and requesting index.cfm throws it’s content into layout-html.cfm.  The world’s a happy place and we all move on with our lifes…  until CFDocument comes along. It’s decided that we need a PDF version of the page, so we simply switch to another layout file, pretty similar to the last apart from a CFDocument tag wrapping around the whole thing.</p>\n<h3 id=\"the-twist\">The Twist</h3>\n<p>Everything starts out normal, until you get to CFDocument being executed.  That’s where the oddity begins by firing onRequestEnd a second time.  Here’s a walk through of what happens:</p>\n<ol>\n<li>Request received.</li>\n<li><p>onRequest fired.</p>\n<ol>\n<li>index.cfm included</li>\n<li>Output captured</li>\n</ol>\n</li>\n<li><p>onRequestEnd fired.</p>\n<ol>\n<li>Count execution</li>\n<li>Log to file</li>\n<li>Include layout.cfm file.<ol>\n<li>CFDocument PDF.</li>\n<li>Rules of normality break down.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li><p>onRequestEnd fired (again?).</p>\n<ol>\n<li>Count execution (now 2).</li>\n<li>Log to file.</li>\n<li>Include layout.cfm file.<ol>\n<li>CFDocument PDF, doesn’t appear to do anything with this\nsecond invocation.</li>\n<li>Thankfully, CFDocument doesn’t flag onRequestEnd to execute\nagain or we’d be stuck in a loop.</li>\n</ol>\n</li>\n</ol>\n</li>\n<li><p>Request ends.</p>\n</li>\n</ol>\n<p>Strangely enough, you won’t get any errors.  The 2nd CFDocument doesn’t appear to do anything and thankfully won’t attempt to run onRequestEnd again, avoiding a loop.</p>\n<h3 id=\"the-code\">The code</h3>\n<p>Our Application.cfc file, as mentioned above has been written to capture the output from onRequest and use onRequestEnd to apply it onto a layout file.  Some logging code has added to onRequestEnd to highlight what’s going on.</p>\n<pre><code class=\"language-markup\">&lt;cfset this.name = &#39;AFunnyThingHappenOnTheWay...&#39; /&gt;\n\n&lt;cffunction name=&quot;onRequest&quot; returntype=&quot;void&quot;&gt;\n  &lt;cfargument name=&quot;thisPage&quot; required=&quot;true&quot; type=&quot;string&quot; /&gt;\n  &lt;cfsavecontent variable=&quot;request.content&quot;&gt;\n    &lt;cfinclude template=&quot;#arguments.thisPage#&quot; /&gt;\n  &lt;/cfsavecontent&gt;\n&lt;/cffunction&gt;\n\n&lt;cffunction name=&quot;onRequestEnd&quot; returntype=&quot;void&quot;&gt;\n  &lt;cfset var msg = &#39;&#39; /&gt;\n  &lt;cfif Not StructKeyExists(request, &#39;onRequestEndCount&#39;)&gt;\n    &lt;cfset msg = &#39;&lt;hr&gt;&#39; &amp; Chr(10) /&gt;\n    &lt;cfset request.onRequestEndCount = 1 /&gt;\n  &lt;cfelse&gt;\n    &lt;cfset request.onRequestEndCount++ /&gt;\n  &lt;/cfif&gt;\n  &lt;cfset msg &amp;= &#39;onRequestEnd() Fired: &#39; &amp; Now() &amp; &#39;&lt;br&gt;&#39; &amp; Chr(10) /&gt;\n  &lt;cfset msg &amp;= &#39;Count in single request = #request.onRequestEndCount#&lt;br&gt;&#39; /&gt;\n  &lt;cffile action=&quot;append&quot; file=&quot;#ExpandPath(&#39;./log.html&#39;)#&quot; output=&quot;#msg#&quot; /&gt;\n  &lt;cfcontent reset=&quot;true&quot; /&gt;&lt;cfinclude template=&quot;layout.cfm&quot; /&gt;\n&lt;/cffunction&gt;\n</code></pre>\n<p>An awesome index.cfm file…</p>\n<pre><code class=\"language-markup\">&lt;p&gt;This content is super fantastico!&lt;/p&gt;\n&lt;p&gt;&lt;cfoutput&gt;#Now()#&lt;/cfoutput&gt;&lt;/p&gt;\n</code></pre>\n<p>And our layout file using CFDocument.</p>\n<pre><code class=\"language-markup\">&lt;cfset msg = &#39;layout.cfm executed: &#39; &amp; Now() &amp; &#39;&lt;br&gt;&#39; &amp; Chr(10) /&gt;\n&lt;cffile action=&quot;append&quot; file=&quot;#ExpandPath(&#39;./log.html&#39;)#&quot; output=&quot;#msg#&quot; /&gt;\n&lt;cfdocument format=&quot;pdf&quot;&gt;\n&lt;!doctype html&gt;\n&lt;html&gt;\n&lt;body&gt;\n  &lt;h1&gt;Layout&lt;/h1&gt;\n  &lt;h2&gt;Content&lt;/h2&gt;\n  &lt;cfoutput&gt;#request.content#&lt;/cfoutput&gt;\n&lt;/body&gt;\n&lt;/html&gt;\n&lt;/cfdocument&gt;\n</code></pre>\n<p>Put it all together and what do you get? onRequestEnd being fired twice. Here’s what you’ll probably see in log.html.</p>\n<pre><code class=\"language-markup\">&lt;hr&gt;\nonRequestEnd() Fired: {ts &#39;2013-05-22 12:37:09&#39;}&lt;br&gt;\nCount in single request = 1&lt;br&gt;\nlayout.cfm executed: {ts &#39;2013-05-22 12:37:09&#39;}&lt;br&gt;\n\nonRequestEnd() Fired: {ts &#39;2013-05-22 12:37:09&#39;}&lt;br&gt;\nCount in single request = 2&lt;br&gt;\nlayout.cfm executed: {ts &#39;2013-05-22 12:37:09&#39;}&lt;br&gt;\n</code></pre>\n<p>So having CFDocument execute within onRequestEnd will fire onRequestEnd a second time. This doesn’t happen in CF8, haven’t tested CF10 as I haven’t a version handy at the moment. I believe this is probably related to the change in onRequestEnd behaviour in CF9. Where it’ll fire <a href=\"http://www.bennadel.com/blog/2050-Changes-In-CFLocation-OnRequestEnd-Behavior-In-ColdFusion-9-s-Application-cfc.htm\">even after a CFLocation</a>.  Haven’t stumbled across any bug entries for this so far, but will log one for it if I’m certain no one has beaten me to it.</p>\n","date_published":"2013-05-22T11:40:28.000Z"},{"id":"blog\\article\\2013-05-21.md","url":"https://misterdai.yougeezer.co.ukblog\\article\\2013-05-21.md","title":"SQL Server: Creating XML","content_html":"<p>Today’s little task was to grab some data from a database and create an XML file from it. So I decided to play around with the XML features in SQL Server (I used 2008 for this).\n<!--more--></p>\n<div class=\"alert alert-info\">\n  <strong>Question</strong>: If you&#39;d like to see more posts on SQL Server, related to XML or other topics, please let me know in the comments section after the post.\n</div>\n\n<h3 id=\"one-for-all-and-all-for-xml-\">One for all and all “FOR XML”</h3>\n<p>The <a href=\"http://msdn.microsoft.com/en-us/library/ms178107(v=sql.100\">Microsoft documentation</a>.aspx) told me that the “FOR XML” clause was what I’d need for the task. It comes in four different flavours, each with its own unique talents:</p>\n<ul>\n<li>RAW</li>\n<li>AUTO</li>\n<li>EXPLICIT</li>\n<li>PATH</li>\n</ul>\n<p>While I won’t delve into each other them, I’m sure the documentation would better explain, I’ll just focus on the ones I found useful. The first was <code>PATH</code>.</p>\n<h3 id=\"following-the-path\">Following the PATH</h3>\n<p>Being described as “a simpler way to mix elements and attributes”, it seemed like a good place to start as any. Tacking it onto the end of a query produce a simple XML structure, a <code>row</code> element per row returned each with child elements per column.</p>\n<pre><code class=\"language-sql\">SELECT  id, name\nFROM    users\nFOR XML PATH\n</code></pre>\n<p>Giving you the XML of…</p>\n<pre><code class=\"language-markup\">&lt;row&gt;\n  &lt;id&gt;1&lt;/id&gt;\n  &lt;name&gt;Bob&lt;/name&gt;\n&lt;/row&gt;\n&lt;row&gt;\n  &lt;id&gt;2&lt;/id&gt;\n  &lt;name&gt;Jonesy&lt;/name&gt;\n&lt;/row&gt;\n</code></pre>\n<h3 id=\"wrapping-and-attributes\">Wrapping and attributes</h3>\n<p>That worked out quite well but it’d be nice to have the “id” element as an attribute on the <code>row</code> tag. I’d also like to wrap a root element around everything.</p>\n<pre><code class=\"language-sql\">SELECT  id AS &#39;@id&#39;,\n        name\nFROM    users\nFOR XML PATH, ROOT(&#39;Rows&#39;)\n</code></pre>\n<pre><code class=\"language-markup\">&lt;Rows&gt;\n  &lt;row id=&quot;1&quot;&gt;\n    &lt;name&gt;Bob&lt;/name&gt;\n  &lt;/row&gt;\n  &lt;row id=&quot;2&quot;&gt;\n    &lt;name&gt;Jonesy&lt;/name&gt;\n  &lt;/row&gt;\n&lt;/Rows&gt;\n</code></pre>\n<h3 id=\"when-is-a-row-not-a-row-\">When is a row not a row?</h3>\n<p>What you’d like it to be named something else. You may have a specific XML structure that you have to comply with, so having each item wrapped in a <code>row</code> tag may not be ideal. Thankfully it’s simple to change by just adding the element name to the <code>PATH</code> as a parameter.</p>\n<pre><code class=\"language-sql\">SELECT  id AS &#39;@id&#39;,\n        name\nFROM    users\nFOR XML PATH(&#39;User&#39;), ROOT(&#39;Group&#39;)\n</code></pre>\n<pre><code class=\"language-markup\">&lt;Group&gt;\n  &lt;User id=&quot;1&quot;&gt;\n    &lt;name&gt;Bob&lt;/name&gt;\n  &lt;/User&gt;\n  &lt;User id=&quot;2&quot;&gt;\n    &lt;name&gt;Jonesy&lt;/name&gt;\n  &lt;/User&gt;\n&lt;/Group&gt;\n</code></pre>\n<h3 id=\"getting-to-the-root-of-the-problem\">Getting to the root of the problem</h3>\n<p>(“Yes, I can’t help myself with silly title names… sorry”) We’ve now got a root element for the group of users, but what group is it? It’d be useful to add an XML attribute to the <code>Group</code> tag but from what I could tell, that wasn’t possible via the <code>ROOT</code> option. So how about using a sub-query?</p>\n<pre><code class=\"language-sql\">SELECT\n  1 AS &#39;@id&#39;,\n  (SELECT  id AS &#39;@id&#39;,\n            name\n    FROM    users\n    FOR XML PATH(&#39;User&#39;)\n  )\nFOR XML PATH(&#39;Group&#39;)\n</code></pre>\n<pre><code class=\"language-markup\">&lt;Group id=&quot;1&quot;&gt;&amp;lt;User id=&quot;1&quot;&amp;gt;&amp;lt;name&amp;gt;Bob&amp;lt;...\n</code></pre>\n<p>Wait… what? Well it turns out that when running my first examples in SQL Management Studio Express that it’d happily treat it as an XML datatype.  But when using the returned data for anything else, it ends up as a varchar or similar string type.  To work around this, I needed to use an additional clause of TYPE on the end of the FOR XML bit.</p>\n<h3 id=\"example-sql\">Example SQL</h3>\n<p>The following shows an example of creating an XML document.  One of the main differences is my use of FOR RAW on the outer query.  This allows me to easily set the name space attributes for the root element.</p>\n<pre><code class=\"language-sql\">SELECT\n  -- Root element attributes\n  &#39;http://www.w3.org/2001/XMLSchema-instance&#39; AS &#39;xmlns:xsi&#39;,\n  &#39;http://www.w3.org/2001/XMLSchema&#39; AS &#39;xmlns:xsd&#39;,\n  (\n    SELECT\n      -- Creating a default element\n      (\n        SELECT  0 AS ID,\n                &#39;&#39; AS Name\n        FOR     XML PATH(&#39;Item&#39;),\n                ELEMENTS,\n                TYPE\n      ),\n      (\n        SELECT  id AS ID,\n                title AS Name\n        FROM    items\n        ORDER   BY id\n        FOR     XML PATH(&#39;Item&#39;),\n                ELEMENTS,\n                TYPE\n      )\n    FOR     XML PATH(&#39;Items&#39;),\n            TYPE\n  )\nFOR     XML RAW(&#39;Information&#39;)\n</code></pre>\n<p>Below is what’s returned</p>\n<pre><code class=\"language-markup\">&lt;Information xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;\n  &lt;Items&gt;\n    &lt;Item&gt;\n      &lt;ID&gt;0&lt;/ID&gt;\n      &lt;Name /&gt;\n    &lt;/Item&gt;\n    &lt;Item&gt;\n      &lt;ID&gt;1&lt;/ID&gt;\n      &lt;Name&gt;Item number A&lt;/Name&gt;\n    &lt;/Item&gt;\n    &lt;Item&gt;\n      &lt;ID&gt;2&lt;/ID&gt;\n      &lt;Name&gt;Item number B&lt;/Name&gt;\n    &lt;/Item&gt;\n    &lt;Item&gt;\n      &lt;ID&gt;3&lt;/ID&gt;\n      &lt;Name&gt;Item number C&lt;/Name&gt;\n    &lt;/Item&gt;\n    &lt;Item&gt;\n      &lt;ID&gt;4&lt;/ID&gt;\n      &lt;Name&gt;Item number D&lt;/Name&gt;\n    &lt;/Item&gt;\n    &lt;Item&gt;\n      &lt;ID&gt;5&lt;/ID&gt;\n      &lt;Name&gt;Item number E&lt;/Name&gt;\n    &lt;/Item&gt;\n  &lt;/Items&gt;\n&lt;/Information&gt;\n</code></pre>\n","date_published":"2013-05-21T12:47:45.000Z"}],"home_page_url":"https://misterdai.yougeezer.co.uk","feed_url":"https://misterdai.yougeezer.co.ukfeed/blog.json","author":{"name":"David Boyer"}}