<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>remy sharp's b:log</title>
	
	<link>http://remysharp.com</link>
	<description>About [code] and all that jazz</description>
	<lastBuildDate>Mon, 20 May 2013 19:30:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/remysharp" /><feedburner:info uri="remysharp" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>50.844973</geo:lat><geo:long>-0.143970</geo:long><item>
		<title>My Workflow v2: Mobile, DevTools &amp; LiveReload</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/GmUy_c6AX2o/</link>
		<comments>http://remysharp.com/2013/05/16/my-workflow-v2-mobile-devtools-livereload/#comments</comments>
		<pubDate>Thu, 16 May 2013 15:42:03 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[devtools]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1250</guid>
		<description><![CDATA[Since I&#8217;m sat at Mobilism 2013 I think it&#8217;s worth sharing my recent mobile (mainly CSS) workflow. It&#8217;s not rocket science, but it&#8217;s a nice follow on from my workflow with devtools I shared a few months back. It simply boils down to using LiveReload on the page, using DevTools with the &#8220;Save As&#8221; functionality [...]


Related posts:<ol><li><a href='http://remysharp.com/2012/12/21/my-workflow-never-having-to-leave-devtools/' rel='bookmark' title='Permanent Link: My Workflow: Never having to leave DevTools'>My Workflow: Never having to leave DevTools</a></li><li><a href='http://remysharp.com/2012/04/25/mobile-battery-performance/' rel='bookmark' title='Permanent Link: Mobile Battery Performance'>Mobile Battery Performance</a></li><li><a href='http://remysharp.com/2007/12/16/t-mobile-allow-free-wifi-google-maps/' rel='bookmark' title='Permanent Link: T-Mobile allow free Wifi Google Maps'>T-Mobile allow free Wifi Google Maps</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Since I&#8217;m sat at <a href="http://mobilism.nl/2013">Mobilism 2013</a> I think it&#8217;s worth sharing my recent mobile (mainly CSS) workflow. It&#8217;s not rocket science, but it&#8217;s a nice follow on from <a href="http://remysharp.com/2012/12/21/my-workflow-never-having-to-leave-devtools/">my workflow with devtools</a> I shared a few months back.</p>

<iframe width="1280" height="720" src="http://www.youtube.com/embed/tIabBQatvD8?rel=0" frameborder="0" allowfullscreen></iframe>

<p>It simply boils down to using <a href="http://livereload.com/">LiveReload</a> on the page, using DevTools with the &#8220;Save As&#8221; functionality on the CSS, then simply make the change on the desktop using DevTools, which automatically saves to file, which causes LiveReload to trigger a reload on all devices (perhaps frustratingly on the desktop too), but also the remote devices &#8211; mobile or otherwise &#8211; to refresh allowing me a quick glance to make sure the styles look right.</p>

<p>Simple.</p>

<h2 id="whatItShouldBe-heading">What it should be</h2>

<p>There is an ideal workflow, and I believe this is the way it&#8217;s supposed to work (but maybe the browser isn&#8217;t quite there just yet, but it feels like it&#8217;s just around the corner).</p>

<p>You connect your mobile browser (Android Chrome in this case), run <code>adb</code> (and I think I saw a browser extension that makes this easy during some of the Google IO 2013 videos), open Chrome (Canary works) and navigate to <code>chrome://inspect</code> and you&#8217;ll be able to launch the devtools for that page.</p>

<p>From <em>those</em> devtools I imagine I should be able to edit and save to disk and it would remove the requirement for LiveReload (though this doesn&#8217;t solve working with iOS).  Pretty cool.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2012/12/21/my-workflow-never-having-to-leave-devtools/' rel='bookmark' title='Permanent Link: My Workflow: Never having to leave DevTools'>My Workflow: Never having to leave DevTools</a></li><li><a href='http://remysharp.com/2012/04/25/mobile-battery-performance/' rel='bookmark' title='Permanent Link: Mobile Battery Performance'>Mobile Battery Performance</a></li><li><a href='http://remysharp.com/2007/12/16/t-mobile-allow-free-wifi-google-maps/' rel='bookmark' title='Permanent Link: T-Mobile allow free Wifi Google Maps'>T-Mobile allow free Wifi Google Maps</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=GmUy_c6AX2o:Szrvep9dbR8:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=GmUy_c6AX2o:Szrvep9dbR8:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/GmUy_c6AX2o" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2013/05/16/my-workflow-v2-mobile-devtools-livereload/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2013/05/16/my-workflow-v2-mobile-devtools-livereload/</feedburner:origLink></item>
		<item>
		<title>tracegl for JavaScript debugging</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/S5liNciSTK8/</link>
		<comments>http://remysharp.com/2013/05/13/tracegl-for-javascript-debugging/#comments</comments>
		<pubDate>Mon, 13 May 2013 09:00:14 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[node]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1236</guid>
		<description><![CDATA[In preparing for my new Node workshop (tickets go on sale Wednesday 10am &#8211; set alarm!) my tool of choice used to be node-inspector but development has gone idle (for a year to date) and it&#8217;s showing it&#8217;s age. However, recently I came across tracegl I was intrigued as it looked to add to my [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/' rel='bookmark' title='Permanent Link: JS Bin for Collaborative JavaScript Debugging'>JS Bin for Collaborative JavaScript Debugging</a></li><li><a href='http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/' rel='bookmark' title='Permanent Link: Full Frontal 2012 launches soon!'>Full Frontal 2012 launches soon!</a></li><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>In preparing for my new Node workshop (tickets go <a href="https://leftlogic.stagehq.com/events/2287">on sale Wednesday 10am</a> &#8211; set alarm!) my tool of choice <em>used</em> to be <a href="https://github.com/dannycoates/node-inspector">node-inspector</a> but development has gone idle (for a year to date) and it&#8217;s showing it&#8217;s age. However, recently I came across <a href="http://trace.gl">tracegl</a> I was intrigued as it looked to add to my debugging tools for Node.</p>

<p>tracegl was so much more than I realised: it captures full JavaScript state a <em>all</em> points of my application&#8217;s execution &#8211; <strong>both</strong> on the server side, but also the client side.</p>

<!-- more -->

<h2 id="debuggingARealBugWithTracegl-heading">Debugging a real bug with tracegl</h2>

<p><a href="http://twitter.com/rikarends">Rik Arends</a> includes an introductory video on the <a href="http://trace.gl">site</a>, and the script is €12 &#8211; which frankly is a steal for what it provides me. If you&#8217;re join <a href="https://leftlogic.stagehq.com/events/2287">my Node workshop</a> &#8211; I&#8217;m proving a licensed copy for everyone (because I think it should be part of your core stack).</p>

<p>I&#8217;ve included a short video of how I&#8217;ve used tracegl to debug my server side application. A few important things to note are: the trace is historical &#8211; and not blocking execution, which is what I&#8217;d normally do if I had to debug: I&#8217;d carefully replicate the issue, then either add a conditional breakpoint or <code>debugger</code> statement &#8211; but with tracegl, the bug can occur, and if tracegl is running, I can just look back at the state of the problem.</p>

<iframe width="640" height="360" src="http://www.youtube.com/embed/TW6uMJtbVrk?rel=0" frameborder="0" allowfullscreen></iframe>

<h2 id="learningMore-heading">Learning more</h2>

<p>I&#8217;m running a new crash course in Node on July, and similar the past it&#8217;s known to have sold out in a week. Tickets go on sale on Wednesday at 10am (UK) and will be <a href="https://leftlogic.stagehq.com/events/2287">available here</a>.</p>

<p>I&#8217;ll be using this tool and many others to give you a fully packed day of knowledge on how to use Node, how to develop sites and real-time applications, and what tools I use for debugging, publishing and deployment.</p>

<p>So <a href="https://leftlogic.stagehq.com/events/2287">grab a ticket</a> if you want my hands on, &#8220;knowledge smash &amp; grab&#8221; course (or check out <a href="http://leftlogic.com/training#node1day">more details here</a>).</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/' rel='bookmark' title='Permanent Link: JS Bin for Collaborative JavaScript Debugging'>JS Bin for Collaborative JavaScript Debugging</a></li><li><a href='http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/' rel='bookmark' title='Permanent Link: Full Frontal 2012 launches soon!'>Full Frontal 2012 launches soon!</a></li><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=S5liNciSTK8:D3XOP6BZo0I:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=S5liNciSTK8:D3XOP6BZo0I:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/S5liNciSTK8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2013/05/13/tracegl-for-javascript-debugging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2013/05/13/tracegl-for-javascript-debugging/</feedburner:origLink></item>
		<item>
		<title>I know jQuery. Now what?</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/sCLTu4fYXsY/</link>
		<comments>http://remysharp.com/2013/04/19/i-know-jquery-now-what/#comments</comments>
		<pubDate>Fri, 19 Apr 2013 11:30:27 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1222</guid>
		<description><![CDATA[I gave this talk: I know jQuery. What now? at jQuery UK 2013, but instead of my usual approach of post-it explosion on my desk, I wrote a post first, and created the slides from the post. So here is my (fairly unedited) quasi-ramble on how I used jQuery, and how I&#8217;m looking at where [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/07/08/jquery-multibinding-events/' rel='bookmark' title='Permanent Link: jQuery multibinding events'>jQuery multibinding events</a></li><li><a href='http://remysharp.com/2008/02/12/jquery-api-browser/' rel='bookmark' title='Permanent Link: jQuery API Browser'>jQuery API Browser</a></li><li><a href='http://remysharp.com/2008/03/21/how-to-tell-if-jquery-is-out-of-date/' rel='bookmark' title='Permanent Link: How to tell if jQuery is out of date'>How to tell if jQuery is out of date</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I gave this talk: <a href="https://speakerdeck.com/rem/i-know-jquery-now-what">I know jQuery. What now?</a> at jQuery UK 2013, but instead of my usual approach of post-it explosion on my desk, I wrote a post first, and created the slides from the post.  So here is my (fairly unedited) quasi-ramble on how I used jQuery, and how I&#8217;m looking at where I&#8217;m using native browser technology.</p>

<p><a href="https://speakerdeck.com/rem/i-know-jquery-now-what"><img src="http://remysharp.com/images/i-know-jquery.jpg" style="max-width: 100%; display: block;"></a></p>

<p><span id="more-1222"></span></p>

<h2 id="7YearsAgo-heading">7 years ago&#8230;</h2>

<p>17-Jun 2006, I publish my first (ever) real <a href="http://web.archive.org/web/20061018170852/http://leftlogic.com/info/articles/auto-selecting_navigation">blog post</a>: taking regular JavaScript and simplifying to jQuery syntax. It turned 14 lines of JavaScript in to 3 lines of jQuery (pre jQuery 1.0).</p>

<p>Most importantly, it went from some fiddly DOM navigation to a simple CSS expression, and added a class once done. The original JavaScript was also quite brittle, so it meant you either had the same markup.</p>

<p>I introduced jQuery to the team of developers I worked with back in mid-2000s and even the designers could see the appeal (since they generally understood CSS selectors (and hence how jQuery for Designers was born)).</p>

<h3 id="dOMNavigatingWasSuddenlyEasy-heading">DOM navigating was suddenly easy</h3>

<p>Back then the DOM was hard to navigate.  You could be sure that if it worked in Firefox 1.5, it wouldn&#8217;t work in IE6.</p>

<p>The ease in which jQuery could be learnt was the appeal to me. All the DOM navigation was done using CSS expression using some insane black box magic that John Resig had come up &#8211; saving my limited brain power, and once I had those DOM nodes, I could do what I wanted to them (usually some combinations of showing, hiding, fading and so on).</p>

<h3 id="grokingAjax-heading">Groking ajax</h3>

<p>jQuery also abstracted ajax for me. The term had only just been coined earlier in 2005, but documentation was not wide, nor trivial to understand (remember the lower power computing power of my brain).</p>

<p>It was the first time I really had to deal with the XMLHttpRequest object, and when seeing it for the first time, understanding the <code>onreadystatechange</code> event and the combination of <code>this.status</code> and <code>this.readyState</code> wasn&#8217;t overtly clear! jQuery (and other libraries) also tucked away the mess that was XHR in IE via ActiveX&#8230;</p>

<pre><code>function getXmlHttpRequest() {
  var xhr;
  if (window.XMLHttpRequest) {
    xhr = new XMLHttpRequest();
  } else {
    try {
      xhr = new ActiveXObject("Msxml2.XMLHTTP");
    } catch (e) {
      try {
        xhr = new ActiveXObject("Microsoft.XMLHTTP");
      } catch (e) {
        xhr = false;
      }
    }
  }
  return xhr;
}

// disclaimer: John's jQuery version is a lot more elegant!
</code></pre>

<p>Once I could see that using the ajax utility inside of jQuery to suck in a URL&#8217;s HTML (which was typically the way we <em>wanted</em> to do ajax), then ajax suddenly clicked.</p>

<p>jQuery quickly became my standard utility for many years. It was my Swiss Army Knife, as it were, to steal <a href="http://events.jquery.org/2013/uk/schedule.html#adam">Adam&#8217;s talk title</a>!</p>

<h2 id="backToTheFutureToday-heading">Back to the future: today</h2>

<p>Let&#8217;s fast forward back to today. What&#8217;s happened over those years?</p>

<p>For starters, my default starting position is no longer &#8220;include jQuery by default&#8221;.  I understand more JavaScript and how <em>things</em> work.</p>

<p>I have my own criteria for when to include jQuery, and when not to include jQuery. But if I don&#8217;t include jQuery, then what?</p>

<p>In those 7 years, quite a bit has happened. Probably one of the most important steps forward was the introduction of <code>querySelectorAll</code>.</p>

<p>Being able to give a native function of a browser a CSS expression, and <strong>it</strong> doing the work to navigate the DOM is a huge (literally) part of jQuery. Basic support was in Chrome from the outset, and in IE8 and Firefox 3.5 around mid-2009.</p>

<p>Andrew Lunny (of PhoneGap &amp; Adobe) has the brilliant simplicity on the bling function:</p>

<pre><code>var $ = document.querySelectorAll.bind(document);
Element.prototype.on = Element.prototype.addEventListener;

$('#somelink')[0].on('touchstart', handleTouch);
</code></pre>

<p>Beautifully simple.</p>

<p>I&#8217;ve taken this idea a <a href="https://github.com/remy/min.js">little further</a> and used it on a few specific projects, adding support for chaining, looping and simplifying the syntax. Comes in at &lt;200 bytes gzipped. But the point is that today we have features natively available, and I&#8217;m trying to consider my audience before dropping in jQuery by default.</p>

<h2 id="whenIAlwaysUseJquery-heading">When I always use jQuery</h2>

<p>Before I look at how I can go without jQuery, naked, let me just share <em>when</em> I drop jQuery in to a project. There&#8217;s usually a few of very specific criteria that either has me <em>start</em> with jQuery or switch from a bespoke solution in favour of jQuery.</p>

<p>Before I do, I should point out when I absolutely don&#8217;t use jQuery: If I&#8217;m trying to replicate a browser bug, I never use a library. If you&#8217;re trying to corner a bug, so that you can file an issue, you want your case as minimal as possible (unless of course you&#8217;re filing a bug on jQuery!).</p>

<h3 id="1WhenTheProjectHasToWorkInNonCuttingMustardBrowsers-heading">1. When the project has to work in non-cutting-mustard browsers</h3>

<p>The BBC have been quite vocal in what they define as &#8220;<a href="http://responsivenews.co.uk/post/18948466399/cutting-the-mustard">cutting the mustard</a>&#8220;, and now I think about it, that&#8217;s my benchmark for when to include jQuery by default.</p>

<p>If I know I have to work with browsers that don&#8217;t cut the mustard, and they&#8217;re part of the core audience, then I&#8217;ll start with jQuery in my initial code.</p>

<p>What is cutting the mustard?</p>

<p>It&#8217;s almost as simple as: does this browser have <code>querySelectorAll</code>?</p>

<p>The BBC use the following test for cutting the mustard:</p>

<pre><code>if ('querySelector' in document &amp;&amp; 
    'localStorage' in window &amp;&amp; 
    'addEventListener' in window) {
    // bootstrap the JavaScript application
}
</code></pre>

<p>I know off the top of my head IE8 doesn&#8217;t support <code>addEventListener</code> (<a href="https://gist.github.com/eirikbacker/2864711">but there is a polyfill</a>), so if that&#8217;s an important browser to the project, then I know that I don&#8217;t want to start the project hoop jumping for IE8.</p>

<p>This isn&#8217;t to say those projects that I start without jQuery won&#8217;t support IE8, it&#8217;s more that you want to start simple, and keep development simple from the outset. If I start a project with a bag of hacks &#8211; I know it&#8217;s going to be a hassle.</p>

<p>I also class this as &#8220;when complexity outweighs ease&#8221;.</p>

<h3 id="2WhenItsQuickAndDirty-heading">2. When it&#8217;s quick and dirty</h3>

<p>If I&#8217;m creating a proof of concept, testing an idea out, and generally hacking and creating a JS Bin, I&#8217;m usually adding jQuery by default.  It saves me thinking.</p>

<h2 id="jqueryFree-heading">jQuery-free</h2>

<p>You might be thinking &#8220;so, does Remy use jQuery, and if he doesn&#8217;t then does he just re-implement it all?&#8221;. </p>

<p>I certainly don&#8217;t want to re-invent the wheel. If I find that developing without jQuery only leads me to re-creating a lot of jQuery&#8217;s functionality from scratch, then I&#8217;m clearly wasting my own time.</p>

<p>No, there&#8217;s a lot of patterns where I will build my application code without a library and rely on native browser technology to do the job. And if there&#8217;s a small part of that functionality missing, I might turn to <a href="http://remysharp.com/2010/10/08/what-is-a-polyfill/">polyfills</a> &#8211; but only after careful review that it makes sense.</p>

<p>So how do I live without jQuery, and how good is the support?</p>

<h2 id="documentready-heading">document.ready</h2>

<p>Even when I use jQuery, if I (or my company) have control of the project, I very, very rarely use <code>document.ready</code> (or the shortened version <code>$(function)</code>).</p>

<p>This is because I put all my JavaScript below my DOM, before the <code>&lt;/body&gt;</code> tag. This way I always know the DOM is going to be compiled by this point.</p>

<p>Hopefully it&#8217;s common knowledge by now, but JavaScript blocks rendering. Put your JavaScript above the content, and your server stalls, and you get a blank page. I&#8217;ve used this example many times before, but twitter&#8217;s &#8220;badge&#8221; (a <em>long</em> time ago) used to be put inline to your HTML. Their site would often go down, and as my blog (also carrying the twitter badge) would hang with a blank page &#8211; giving the appearance that <em>my</em> site was down.</p>

<h2 id="attrvalueAndAttrhref-heading">.attr(&#8216;value&#8217;) and .attr(&#8216;href&#8217;)</h2>

<p>It makes me sad when I see jQuery to retrieve a value from an input element:</p>

<pre><code>$('input').on('change', function () {
  var value = $(this).attr('value');

  alert('The new value is' + value);
});
</code></pre>

<p>Why? Because you can get to the value using <code>this.value</code>. More importantly &#8211; you should think about <em>how</em> you&#8217;re using a JavaScript library. Don&#8217;t unnecessarily invoke jQuery if you don&#8217;t need to.</p>

<p>In fact, this isn&#8217;t a jQuery thing &#8211; it&#8217;s a best practise thing. The code should simply read:</p>

<pre><code>$('input').on('change', function () {


  alert('The new value is' + this.value);
});
</code></pre>

<p>It&#8217;s also common to use jQuery to get the href of an anchor: <code>$(this).attr('href')</code>, but you can also easily get this from knowing the DOM: <code>this.href</code>. However, note that <code>this.href</code> is different, it&#8217;s the absolute url, as we&#8217;re talking about the DOM API, and not the element. If you want the attribute value (as it&#8217;s suggested in the jQuery version), you want <code>this.getAttribute('href')</code>.</p>

<p>Then there&#8217;s setting the class on an element, you don&#8217;t need jQuery for that either if you&#8217;re just adding a class.</p>

<p>I&#8217;ve seen this before:</p>

<pre><code>  &lt;script src="http://code.jquery.com/jquery.min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    $('body').addClass('hasJS');
  &lt;/script&gt;
</code></pre>

<p>But why not:</p>

<pre><code>&lt;/head&gt;
&lt;body&gt;
  &lt;script&gt;
    document.body.className = 'hasJS';
  &lt;/script&gt;
</code></pre>

<p>Probably the most important change in the version below, is there&#8217;s no jQuery being included first <em>just</em> to set a class name on the body to determine whether JavaScript is available.</p>

<p>If the body might have a class already, just append (jQuery has to read the className property too): <code>document.body.className += ' hasJS'</code>.</p>

<p>And this is where we start to run in to issues with class names and tracking what classes they have and don&#8217;t have. But browsers have this functionality natively too.</p>

<h2 id="classlistForAddRemoveToggle-heading">classList for add, remove &amp; toggle</h2>

<p>HTML5&#8242;s <code>classList</code> support is in all the latest production browsers (note <em>not</em> in IE9 &#8211; but this is a case where I might choose to polyfill).</p>

<p>Instead of:</p>

<pre><code>$('body').addClass('hasJS');

// or

document.body.className += ' hasJS';
</code></pre>

<p>We can do:</p>

<pre><code>document.body.classList.add('hasJS');
</code></pre>

<p>Isn&#8217;t that pretty? </p>

<p>What about removing:</p>

<pre><code>$('body').removeClass('hasJS');

// or some crazy ass regular express
</code></pre>

<p>Or we can do:</p>

<pre><code>document.body.classList.remove('hasJS');
</code></pre>

<p>But more impressive is the native toggle support:</p>

<pre><code>document.body.classList.toggle('hasJS');

// and

document.body.classList.contains('hasJS');
</code></pre>

<p>To set multiple classes, you add more arguments:</p>

<pre><code>document.body.classList.add('hasJS', 'ready');
</code></pre>

<p>What does suck though, is the weird issues &#8211; like don&#8217;t use a empty string:</p>

<pre><code>document.body.classList.contains('');
// SyntaxError: DOM Exception 12
</code></pre>

<p>That&#8217;s pretty rubbish. But! On the upside, I know the problem areas and I avoid them. Pretty much what we&#8217;ve grown up on working with browsers anyway.</p>

<h2 id="storingData-heading">Storing data</h2>

<p>jQuery implemented arbitrary data storage against elements in 1.2.3 and then object storing in 1.4 &#8211; so a little while ago.</p>

<p>HTML5 has native data storage against elements, but there&#8217;s a fundamental difference between jQuery and native support: object storage won&#8217;t work in HTML5 dataset.</p>

<p>But if you&#8217;re storing strings or JSON, then native support is perfect:</p>

<pre><code>element.dataset.user = JSON.stringify(user);
element.dataset.score = score;
</code></pre>

<p>Support is good, but sadly no native support in IE10 (though you can add a polyfill and it&#8217;ll work perfectly again &#8211; but that&#8217;s a consideration when using dataset).</p>

<h2 id="ajax-heading">Ajax</h2>

<p>Like I said before, jQuery helped me grok ajax fully. But now ajax is pretty easy. Sure, I don&#8217;t have all the extra options, but more often than not, I&#8217;m doing an XHR <code>GET</code> or <code>POST</code> using JSON.</p>

<pre><code>function request(type, url, opts, callback) {
  var xhr = new XMLHttpRequest(),
      fd;

  if (typeof opts === 'function') {
    callback = opts;
    opts = null;
  }

  xhr.open(type, url);

  if (type === 'POST' &amp;&amp; opts) {
    fd = new FormData();

    for (var key in opts) {
      fd.append(key, JSON.stringify(opts[key]));
    }
  }

  xhr.onload = function () {
    callback(JSON.parse(xhr.response));
  };

  xhr.send(opts ? fd : null);
}

var get = request.bind(this, 'GET');
var post = request.bind(this, 'POST');
</code></pre>

<p>It&#8217;s short and simple. XHR is not hard and it&#8217;s well documented nowadays. But more importantly, having an understanding of how it really works and what XHR can do, gives us more.</p>

<p>What about progress events? What about <em>upload</em> progress events? What about posting upstream as an ArrayBuffer? What about CORS and the <code>xml-requested-with</code> header?</p>

<p>You&#8217;ll need direct access to the XHR object for this (I know you can get this from jQuery), but you should get familiar with the XHR object and it&#8217;s capabilities, because things like file uploads via drag and drop is insanely easy with native functionality today.</p>

<h2 id="finallyForms-heading">Finally forms!</h2>

<p>The jQuery form validation plugin was a stable plugin from the early days of jQuery, and frankly made working with forms so much easier.</p>

<p>But regardless of your client side validation &#8211; you must always run server side validation &#8211; this remains true regardless of how you validate.</p>

<p>But what if you could throw away lines and lines of JavaScript and plugins to validate an email address like this:</p>

<pre><code>&lt;input type="email"&gt;
</code></pre>

<p>Want to make it a required field?</p>

<pre><code>&lt;input type="email" required&gt;
</code></pre>

<p>Want to allow only specific characters for a user?</p>

<pre><code>&lt;input pattern="[a-z0-9]"&gt;
</code></pre>

<p>Bosh. It even comes with assistive technology support &#8211; i.e. the keyboard will adapt to suit email address characters.</p>

<p>Since these types fall back to <code>text</code>, and you <em>have</em> to have server side validation, I <em>highly</em> encourage you to rip out all your JavaScript validation and swap in native HTML5 form validation.</p>

<h2 id="jqueryAnimationsVSCSSAnimationsVSJavascriptAnimations-heading">jQuery animations VS. CSS animations VS. JavaScript animations</h2>

<p>It&#8217;s not really a contest. CSS wins. Animating using CSS is being processed on the GPU. Animating in JavaScript has the additional layer of computation in the simple fact there&#8217;s JavaScript.</p>

<p>Even then, if I&#8217;m writing the code myself, I&#8217;m going to choose to use <code>requestAnimationFrame</code> over <code>setInterval</code> based animations.</p>

<p>Jake Archibald has some excellent slides showing the issue here, whereby <code>setInterval</code> won&#8217;t be smooth and will quickly start to drop frames:</p>

<p><img src="http://remysharp.com/images/setInterval.jpg" alt="setInterval" title="" /></p>

<p><img src="http://remysharp.com/images/raf.jpg" alt="rAF" title="" /></p>

<p>What&#8217;s more, CSS animations go through the same scheduler as <code>requestAnimationFrame</code>, which is what we want to use.</p>

<p>So if your browser support allows for it, use CSS animations. Sure, it&#8217;s not as easy as <code>$foo.animate('slow', { x: '+=10px' })</code> but it&#8217;s going to be cleaner and smoother. It should be a well known fact that touching the DOM is expensive. So if you&#8217;re animating the x position of an element by updating the <code>el.style.left</code> attribute, you&#8217;re going back and forth for the animation.</p>

<p>However, if you can simply do <code>foo.classList.add('animate')</code>, the CSS class <code>animate</code> will transition the <code>left</code> position of the element. And you have control if that&#8217;s just the left property, or if you take advantage of hardware acceleration by using <code>translateX</code> with <code>translateZ(0)</code>.</p>

<p>But what about my animation end callback I hear you all cry?!  That&#8217;s available too. Though it&#8217;s a little icky:</p>

<pre><code>el.addEventListener("webkitTransitionEnd", transitionEnded);
el.addEventListener("transitionend", transitionEnded);
</code></pre>

<ul>
<li>Note the the lowercase &#8216;e&#8217; on &#8216;end&#8217;&#8230;</li>
</ul>

<p>A few kind people on twitter did also point me to a <a href="https://github.com/benbarnett/jQuery-Animate-Enhanced">sort-of-polyfill for jQuery</a>, that enhances the <code>.animate</code> function if CSS animations are available. </p>

<p>There&#8217;s also a separate plugin called <a href="http://ricostacruz.com/jquery.transit/">Transit</a> which gives you JavaScript based control over creating CSS animations.  A really nice aspect (for me) is the chaining support. Since it relies exclusively on CSS animations, it requires IE10 and above. </p>

<p>Which begs me to ask: why does this plugin require jQuery specifically?</p>

<h2 id="asideJqueryPluginsJustBecause-heading">Aside: jQuery plugins &#8211; just because.</h2>

<p><a href="https://twitter.com/rem/status/324838998327578625">Me</a>:</p>

<blockquote>
  <p>I don&#8217;t know why, but I really want to hurt the people who write jQuery plugins that don&#8217;t really need jQuery. /seeks-anger-management</p>
</blockquote>

<p><a href="https://twitter.com/kylebarrow/status/324839642677510144">Reply</a>:</p>

<blockquote>
  <p>@rem Me too, I suspect there&#8217;s a support group for that. Probably rather large.</p>
</blockquote>

<p>I was working on a project recently, and knew of the fitText.js project. I went to drop it in, but then spotted that it <strong>needed</strong> jQuery.</p>

<p>Hmm. Why?</p>

<p>It uses the following jQuery methods:</p>

<ol>
<li><code>.extend</code></li>
<li><code>.each</code></li>
<li><code>.width</code></li>
<li><code>.css</code></li>
<li><code>.on</code> (and not with much thought to performance)</li>
</ol>

<p>The plugin is this:</p>

<pre><code>  $.fn.fitText = function( kompressor, options ) {

    // Setup options
    var compressor = kompressor || 1,
        settings = $.extend({
          'minFontSize' : Number.NEGATIVE_INFINITY,
          'maxFontSize' : Number.POSITIVE_INFINITY
        }, options);

    return this.each(function(){

      // Store the object
      var $this = $(this);

      // Resizer() resizes items based on the object width divided by the compressor * 10
      var resizer = function () {
        $this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
      };

      // Call once to set.
      resizer();

      // Call on resize. Opera debounces their resize by default.
      $(window).on('resize orientationchange', resizer);

    });

  };
</code></pre>

<p><code>.extend</code> is being used against an object that only has two options, so I would rewrite to read:</p>

<pre><code>  if (options === undefined) options = {}; 
  if (options.minFontSize === undefined) options.minFontSize = Number.NEGATIVE_INFINITY;
  if (options.maxFontSize === undefined) options.maxFontSize = Number.POSITIVE_INFINITY;
</code></pre>

<p><code>return this.each</code> used to loop over the nodes. Let&#8217;s assume we want this code to work stand alone, then our <code>fitText</code> function would receive the list of nodes (since we wouldn&#8217;t be chaining):</p>

<pre><code>  var length = nodes.length,
      i = 0;

  // would like to use [].forEach.call, but no IE8 support
  for (; i &lt; length; i++) {
    (function (node) {
      // where we used `this`, we now use `node`
      // ...
    })(nodes[i]);
  }
</code></pre>

<p><code>$this.width()</code> gets the width of the container for the resizing of the text. So we need to get the computed styles and grab the width:</p>

<pre><code>  // Resizer() resizes items based on the object width divided by the compressor * 10
  var resizer = function () {
    var width = node.clientWidth;

    // ...
  };
</code></pre>

<p>It&#8217;s really important to note that swapping <code>.width()</code> for <code>.clientWidth</code> will not work in all plugins. It just happen to be the right swap for this particular problem that I was solving (which repeats my point: use the right tool for the job).</p>

<p><code>$this.css</code> is used as a setter, so that&#8217;s just a case of setting the style:</p>

<pre><code>  node.style.fontSize = Math.max(...);
</code></pre>

<p><code>$(window).on('resize', resizer)</code> is a case of attaching the event handler (note that you&#8217;d want <code>addEvent</code> too for IE8 support):</p>

<pre><code>  window.addEventListener('resize', resizer, false);
</code></pre>

<p>In fact, I&#8217;d go <a href="http://jsbin.com/eberan/9/edit">further</a> and store the resizers in an array, and on resize, loop through the array executing the resizer functions.</p>

<p>Sure, it&#8217;s a little more work, but it would also easy to upgrade this change to patch in jQuery plugin support as an upgrade, rather than making it a prerequisite.</p>

<p>Rant will be soon over: it also irks me when I see a polyfill requires jQuery &#8211; but I know the counter argument to that is that jQuery has extremely high penetration so it&#8217;s possibly able to justify the dependency.</p>

<h1 id="closing-heading">Closing</h1>

<p>My aim was to show you that whilst jQuery has giving me such as huge helping hand over the years (particularly those years of poor interoperability), that native browser support is a long way to doing a lot of the common workflows I have when writing JavaScript to &#8220;do stuff&#8221; to the DOM.</p>

<p>Forget about X feature doesn&#8217;t work in Y browser &#8211; approach it from the point of view of: what am I trying to solve? What&#8217;s the best tool for the job? What&#8217;s my audience?</p>

<p>I still believe in progressive enhancement, but I don&#8217;t believe in bending over backwards to support an imaginary user base (because we don&#8217;t have data to say what browsers our users are using).</p>

<p>Google (last I read) support latest minus 1. I try to start from the same baseline support too.</p>

<p>I&#8217;ll continue to use jQuery the way that suits me, and I&#8217;ll continue to evangelise that front end devs learn what the browsers they work with are capable of.</p>

<p>With that then, I close, and I hope this has been helpful to you.</p>

<p>Maybe some of you knew all this already (though I would question why you&#8217;re attending/reading this!), hopefully I&#8217;ve shown some of you that there&#8217;s a world beyond jQuery and that you can start using it today in some of your projects.</p>

<p>Maybe some of you are new to jQuery &#8211; I hope that you go on to look further in to what JavaScript and the DOM are capable of.</p>

<p>But for the majority of you: I&#8217;m singing to the choir. You&#8217;re already invested. You already believe in standards, doing it right, learning and bettering yourself.  It&#8217;s those people who <em>aren&#8217;t</em> getting this information that <strong>you</strong> need to help.</p>

<p><strong>You</strong> need to share your experiences with the others around you. You&#8217;re the expert now, and it&#8217;s up to you to help those around you, to help them come up to your standards and beyond.</p>

<p>Conferences will be looking for new speakers, new experts: you are that person. </p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/07/08/jquery-multibinding-events/' rel='bookmark' title='Permanent Link: jQuery multibinding events'>jQuery multibinding events</a></li><li><a href='http://remysharp.com/2008/02/12/jquery-api-browser/' rel='bookmark' title='Permanent Link: jQuery API Browser'>jQuery API Browser</a></li><li><a href='http://remysharp.com/2008/03/21/how-to-tell-if-jquery-is-out-of-date/' rel='bookmark' title='Permanent Link: How to tell if jQuery is out of date'>How to tell if jQuery is out of date</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=sCLTu4fYXsY:hBg62ZZOow0:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=sCLTu4fYXsY:hBg62ZZOow0:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/sCLTu4fYXsY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2013/04/19/i-know-jquery-now-what/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2013/04/19/i-know-jquery-now-what/</feedburner:origLink></item>
		<item>
		<title>Creating popups without HTML files</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/f-OSazONOvg/</link>
		<comments>http://remysharp.com/2013/04/02/creating-popups-without-html-files/#comments</comments>
		<pubDate>Tue, 02 Apr 2013 12:00:27 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[bookmarklet]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[popup]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=940</guid>
		<description><![CDATA[I&#8217;ll start this post by saying: I very very rarely ever need a popup window, and in fact usually just include an inline overlay. But sometimes the situation comes up when I need a popup &#8211; this was one of those times. One thing that always bugged me about dynamic popup windows when compared to [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/02/16/jsonp-request-in-adobe-air/' rel='bookmark' title='Permanent Link: JSONP request in Adobe Air'>JSONP request in Adobe Air</a></li><li><a href='http://remysharp.com/2008/04/01/wiki-to-html-using-javascript/' rel='bookmark' title='Permanent Link: Wiki to HTML using JavaScript'>Wiki to HTML using JavaScript</a></li><li><a href='http://remysharp.com/2007/10/08/what-is-jsonp/' rel='bookmark' title='Permanent Link: What is JSONP?'>What is JSONP?</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll start this post by saying: I very very rarely ever need a popup window, and in fact usually just include an inline overlay. But sometimes the situation comes up when I need a popup &#8211; this was one of those times.</p>

<p>One thing that always bugged me about dynamic popup windows when compared to dynamic iframes: you need a separate <code>.html</code> file to use as the target of the popup. I&#8217;ve documented this process because it might help someone else. I&#8217;m not saying you <em>should</em> use these methods, method 2 is particularly distasteful &#8211; I&#8217;m just sayin&#8217;: <em>you can</em>!</p>

<p>Here&#8217;s two methods where you don&#8217;t need a separate file.</p>

<p><span id="more-940"></span></p>

<h2 id="whyDoYouWantADynamicallyGeneratedPopup-heading">Why do you want a dynamically generated popup?</h2>

<p>For me there was a very specific situation, but one I&#8217;ve come up against in the past is bookmarklets (and userscripts). If you have a bookmarklet, it&#8217;s likely that the single JavaScript file (or inline code) will include the entire application. If you need a popup, then you need a static HTML file, which then also means you need to host said file.</p>

<p>If you can generate the popup target file on the fly, the code can remain entirely inside your JavaScript file and it has zero dependencies.</p>

<p>I&#8217;m just documenting what I did in case there&#8217;s any other folk trying to pull off the same trick.</p>

<h2 id="method1UsingADataUrl-heading">Method 1: using a data url</h2>

<p>The data url, a beautiful thing:</p>

<blockquote>
  <p>The data URI scheme is a URI scheme that provides a way to include data in-line in web pages as if they were external resources</p>
</blockquote>

<p><a href="http://en.wikipedia.org/wiki/Data_URL">Source: Wikipedia</a></p>

<p>One common use of the data url is inline images in HTML or CSS files, usually looking something like:</p>

<pre><code>data:image/png;base64,iVBORw0KG......
</code></pre>

<p>You can also use this same technique for <a href="data:text/html,&lt;title&gt;Hello%20Data%20URL&lt;%2Ftitle&gt;&lt;p&gt;File-less%20HTML%20page!&lt;%2Fp&gt;">HTML files too</a>:</p>

<pre><code>data:text/html,&lt;title&gt;Hello Data URL&lt;/title&gt;&lt;p&gt;File-less HTML page!&lt;/p&gt;
</code></pre>

<p>With that, it means we can dynamically generate a popup window without a <code>.html</code> file clogging up our mojo:</p>

<pre><code>window.open('data:text/html,&lt;title&gt;Hello Data URL&lt;/title&gt;&lt;p&gt;File-less HTML page!&lt;/p&gt;', 'Hello World', 'width=400,height=200');
</code></pre>

<p>This <a href="http://jsbin.com/etizam/1/edit">works</a> perfectly if all you want is a dynamic popup (that&#8217;s supported in IE8 and others).</p>

<p>However, if you want that popup to talk to the parent window that generated the popup in the first instance (which in my case was true), you&#8217;re outta luck since <strong>the data url origin does not match the origin of the domain that created the popup</strong>, which basically equals <em>no dice</em>. So that&#8217;s how I got the craziness you&#8217;re about to see.</p>

<h2 id="method2UsingTheParentPageAsThePopupChild-heading">Method 2: using the parent page as the popup child</h2>

<p>Um, what? This solution uses the HTML file that creates the popup as the <em>target</em> of the popup. Once open, the popup nukes the DOM and rewrites it with it&#8217;s own.</p>

<p>It&#8217;s not a pretty solution, but works in some cases (mine in particular) and has the distinct advantage that the popup resides on the same domain as the parent, and thus allowed to talk directly to it.</p>

<p>I should add that this method works for scripts that have been hardcoded in to the user&#8217;s page. A plugin or a browser userscript would match this particular situation.</p>

<p>A couple of additional caveats in an already crazy sounding solution are:</p>

<ol>
<li>You need some kind of identifier on the url to indicate this is the <em>popup version</em></li>
<li>Any JavaScript that&#8217;s executed before your script is encountered will be executed. If you can make sure your script is first, you can prevent the successive scripts from running.</li>
</ol>

<p>One single script is included as the first script include on this page with the following code (<a href="http://jsbin.com/etizam/2/quiet">and demo</a>):</p>

<pre><code>if (window.location.hash.indexOf('#popup') === -1) {
  window.open(window.location + '#popup', 'Popup', 'width=300,height=300');
} else {
  // we are the popup
  initPopupClient();
}

function initPopupClient() {
  // here we're overwriting the contents of the HTML element
  // causing any successive scripts to be removed - thus if
  // we can be first, it's a good thing.
  document.documentElement.innerHTML = [
    '&lt;title&gt;Popup tool&lt;/title&gt;',
    '&lt;style&gt;* { font-family: comic sans; }&lt;/style&gt;',
    '&lt;p&gt;Welcome to our dynamically generated popup&lt;/p&gt;'
  ].join('');

  // now trigger any function on our parent window
  window.opener.alert('Hello from the popup');

  // or send it messages nicely
  window.opener.postMessage('This is less invasive I guess!');
}
</code></pre>

<h3 id="trashingTheOriginalDOM-heading">Trashing the original DOM.</h3>

<p>Since we&#8217;re using the parent page as the popup source, we need to remove the DOM entirely and replace it with ours. By overwriting the contents of the HTML element we succeed in doing that:</p>

<pre><code>document.documentElement.innerHTML = ...some new markup...
</code></pre>

<p>Here&#8217;s a simple <a href="http://jsbin.com/ahomut/1/quiet">example</a> that only shows one sentence and doesn&#8217;t include the alert (view the source to see what you were <em>supposed</em> to get).</p>

<h3 id="referringToTheParentWindow-heading">Referring to the parent window</h3>

<p>We do this in the regular way of accessing the <code>opener</code> property. This allows us direct access to any method, and if you&#8217;re going to be nice, you&#8217;ll just use the <code>postMessage</code> allowing the parent to just listen for message events:</p>

<pre><code>window.opener.postMessage(JSON.stringify(someData));
</code></pre>

<h1 id="disclaimer-heading">Disclaimer</h1>

<p>Both these techniques are pretty extreme and you should consider you have good reason to actually use them. For my particular problem (which should be detailed in my next post) it was a necessary evil. Make sure you really don&#8217;t want that hosted <code>.html</code> file! The only reason I came to this conclusion (of crazy hoop jumping) was because of my requirements for <a href="http://remote-tilt.com">remote-tilt.com</a>&#8216;s polyfill script.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/02/16/jsonp-request-in-adobe-air/' rel='bookmark' title='Permanent Link: JSONP request in Adobe Air'>JSONP request in Adobe Air</a></li><li><a href='http://remysharp.com/2008/04/01/wiki-to-html-using-javascript/' rel='bookmark' title='Permanent Link: Wiki to HTML using JavaScript'>Wiki to HTML using JavaScript</a></li><li><a href='http://remysharp.com/2007/10/08/what-is-jsonp/' rel='bookmark' title='Permanent Link: What is JSONP?'>What is JSONP?</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=f-OSazONOvg:eIxaLgsSEIw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=f-OSazONOvg:eIxaLgsSEIw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/f-OSazONOvg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2013/04/02/creating-popups-without-html-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2013/04/02/creating-popups-without-html-files/</feedburner:origLink></item>
		<item>
		<title>I’d like to send you to the Bacon conference</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/QQ-qCPN-cUk/</link>
		<comments>http://remysharp.com/2013/03/22/id-like-to-send-you-to-the-bacon-conference/#comments</comments>
		<pubDate>Fri, 22 Mar 2013 15:06:13 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[conference]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1201</guid>
		<description><![CDATA[The folks at Mint Digital made this video (below) to convince me to send my devs to Bacon &#8211; the developer conference. Unfortunately none of us can make it. I&#8217;ll admit that I&#8217;d really like to go along, so this kind of sucks. But! Instead, as a nice thing&#8482;, I&#8217;d like to send one of [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>The folks at Mint Digital made this video (below) to convince me to send my devs to <a href="http://devslovebacon.com/">Bacon</a> &#8211; the developer conference. Unfortunately none of us can make it. I&#8217;ll admit that I&#8217;d really like to go along, so this kind of sucks.</p>

<p>But! Instead, as a nice thing&trade;, I&#8217;d like to send one of you.</p>

<p><span id="more-1201"></span></p>

<div class="update">And the <a href="http://goo.gl/2Hjhw">randomly selected</a> person is&hellip;<a href="http://twitter.com/rsolomou">Rich Solomou</a> (submitted by email by Rich Boakes). I&#8217;ll be in touch, and get that ticket for you &#8211; congratulations, and thanks everyone for participating!</div>

<iframe width="640" height="360" src="http://www.youtube.com/embed/kp2tvQoQYog?rel=0" frameborder="0" allowfullscreen></iframe>

<p>I&#8217;d like to send someone who&#8217;s new to the web industry and wouldn&#8217;t normally be able to afford this kind of conference.</p>

<p>I&#8217;ll foot the bill for your ticket (Tom&#8217;s discount will go towards it too) but you&#8217;ll need to arrange your own travel and any necessary lodgings.</p>

<p>I&#8217;ll pick someone at random on <strong>Wednesday 27th at 12pm</strong>.</p>

<p>So please volunteer yourself, or even volunteer someone you know that you think is deserving. I will be on the look out for things like your blog, any git repo &#8211; that all counts towards whether you make it in the hat. Pop a comment below (or <a href="http://leftlogic.com/contact?subject=Re: Bacon">contact me directly</a>) with your name and why you should go, and I&#8217;ll start adding names to my hat to later pull one lucky candidate of out.</p>

<p>And you never know, you might even discover your next big client or employer at the conference!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=QQ-qCPN-cUk:gd4nafx76VA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=QQ-qCPN-cUk:gd4nafx76VA:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/QQ-qCPN-cUk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2013/03/22/id-like-to-send-you-to-the-bacon-conference/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2013/03/22/id-like-to-send-you-to-the-bacon-conference/</feedburner:origLink></item>
		<item>
		<title>Quick &amp; Dirty Forking</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/qIDD33QgXm4/</link>
		<comments>http://remysharp.com/2013/03/18/quick-dirty-forking/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 12:00:24 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1195</guid>
		<description><![CDATA[I&#8217;ve often come across a github hosted repo that was purely client side, but didn&#8217;t have a hosted demo. Maybe a simple JavaScript library, or a CSS effect, but no url that I could see it in action. I&#8217;m left with the decision do I clone the project locally and fire up my own server, [...]


Related posts:<ol><li><a href='http://remysharp.com/2010/02/14/slicehost-nodejs-websockets/' rel='bookmark' title='Permanent Link: Slicehost, Node.js &#038; WebSockets'>Slicehost, Node.js &#038; WebSockets</a></li><li><a href='http://remysharp.com/2010/10/12/nodejs-rapid-development-nodemon/' rel='bookmark' title='Permanent Link: node.js rapid development: nodemon'>node.js rapid development: nodemon</a></li><li><a href='http://remysharp.com/2011/10/18/a-public-mit-license-resource/' rel='bookmark' title='Permanent Link: A Public MIT License Resource'>A Public MIT License Resource</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve often come across a github hosted repo that was purely client side, but didn&#8217;t have a hosted demo. Maybe a simple JavaScript library, or a CSS effect, but no url that I could see it in action.</p>

<p>I&#8217;m left with the decision do I clone the project locally and fire up my own server, look at it, then shortly after delete it as I was only planning to browse&#8230;or something else?</p>

<p>How about &#8220;quick preview&#8221;? So I <a href="https://github.com/remy/5minutefork">built</a> that in a few hours last month: <a href="http://5minfork.com">5minfork.com</a>.</p>

<p><small>Sure, I know this isn&#8217;t really a fork, but 5 minute clone didn&#8217;t have the same ring to it!</small></p>

<p><span id="more-1195"></span></p>

<h2 id="theIdea-heading">The idea</h2>

<p>The concept is simple, but requires a non-blocking server if I wanted to make the service public &#8211; which I&#8217;ll explain why in a moment:</p>

<ol>
<li>It needed to be simple to go from github repo url to this preview system.</li>
<li>The previewed fork needed to be served from the root of the hostname, because it&#8217;s likely the resources in the repo would run off absolute paths.</li>
<li>I wanted the previews to automatically clean themselves up, so I didn&#8217;t end up chomping loads of disk space.</li>
<li>Cloning a project should not take down the server!</li>
</ol>

<p>I knew this should be simple with <a href="http://nodejs.org">Node.js</a> mostly because I needed to send off the clone process in the background (to the main application) and only once it&#8217;s returned, do I serve up the forked content.</p>

<h2 id="theWayItWorks-heading">The way it works</h2>

<p>Using the <a href="https://github.com/senchalabs/connect">connect</a> library I have my own custom router that does most of the work.</p>

<p>Then clones are spawned out to a separate process, and once completed, a unique hash is created as a new subdomain for the server with it&#8217;s own router pointing to the new clone. After 5 minutes of idle time, the clone is automatically removed and cleaned up.</p>

<h2 id="repoRouter-heading">Repo router</h2>

<p>When you request anything off the default root of the server, it assumes (unless the resource is found in the <code>public</code> directory) that you&#8217;re referring to a github repo, ie. <code>https://github.com/remy/5minfork</code></p>

<p>The problem was that usernames and repos are case sensitive, but urls aren&#8217;t. So when you redirect to the subdomain (which I wanted to be <code>remy-5minfork</code>), it wouldn&#8217;t work, because subdomain switch to lowercase, and now it doesn&#8217;t know the difference between <code>5MINFORK</code> and <code>5minfork</code>. So to get around this, a hash is made for the path, stored in a JavaScript object in the server, and immediately <a href="https://github.com/remy/5minutefork/blob/master/index.js#L71">redirected</a> to <code>http://&lt;hash&gt;.5minfork.com</code>.</p>

<p>This subdomain then <a href="https://github.com/remy/5minutefork/blob/master/index.js#L20">looks up</a> the original github repo url, and kicks off the fork process.</p>

<h2 id="forkingActuallyCloning-heading">Forking (actually cloning&#8230;)</h2>

<p>I apologise for my interchangeable use of fork &amp; clone &#8211; blame github (apparently). </p>

<p>My exceptionally short <a href="https://github.com/remy/5minutefork/blob/master/lib/fmf.js">fmf.js</a> script works out the github repo url, and spawns a <a href="https://github.com/remy/5minutefork/blob/master/lib/fmf.js#L51">fork</a>.  Once all the spawn&#8217;s data has ended, it triggers the callback, that tells my server the fork was <a href="https://github.com/remy/5minutefork/blob/master/index.js#L39">successful</a>.</p>

<h2 id="dynamicRouter-heading">Dynamic router</h2>

<p>This is the &#8220;clever bit&#8221; (given how short the code is, don&#8217;t expect to be wowed).</p>

<p>A <a href="https://github.com/remy/5minutefork/blob/master/index.js#L41">new router is created</a> for this specific fork, and stored against the hashed url (so we know when we hit <code>http://abc321.5minfork.com</code> it has a bunch of info associated with it).</p>

<p>Then with that new router, it <a href="https://github.com/remy/5minutefork/blob/master/index.js#L56">passes</a> the <em>original</em> <code>request</code> and <code>response</code> objects, which then handle the entire http request &#8211; thus being able to serve up the static previewed repo.</p>

<p>The new router is made up of the <a href="http://www.senchalabs.org/connect/static.html">static</a> router, and the <a href="http://www.senchalabs.org/connect/directory.html">directory</a> router (specifically because most repos without a preview, don&#8217;t have an index.html page).</p>

<h2 id="theFinalBits-heading">The final bits</h2>

<p>You might think I was using the vhosts connect module, but I&#8217;m not, a simple bit of middleware is parsing the host out of the request header and making up the <code>req.subdomain</code> property, which I use to match up to the hash that links to the repo data.</p>

<p>A simple timer fires every 10 seconds to see when the repo was last accessed, and if that difference is more than 5 minutes, it blows away the directory.</p>

<p>Like I said, quick and dirty. </p>

<p>Of course all the code is up <a href="https://github.com/remy/5minutefork">on github</a>. Hopefully this write up or the tool itself is useful to you, I know I&#8217;ve already started using it. Now all I need is a little browser plugin to add a preview icon next on the github repo page, so it&#8217;s even faster to get the 5 minute fork!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2010/02/14/slicehost-nodejs-websockets/' rel='bookmark' title='Permanent Link: Slicehost, Node.js &#038; WebSockets'>Slicehost, Node.js &#038; WebSockets</a></li><li><a href='http://remysharp.com/2010/10/12/nodejs-rapid-development-nodemon/' rel='bookmark' title='Permanent Link: node.js rapid development: nodemon'>node.js rapid development: nodemon</a></li><li><a href='http://remysharp.com/2011/10/18/a-public-mit-license-resource/' rel='bookmark' title='Permanent Link: A Public MIT License Resource'>A Public MIT License Resource</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=qIDD33QgXm4:P7kOswkowFk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=qIDD33QgXm4:P7kOswkowFk:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/qIDD33QgXm4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2013/03/18/quick-dirty-forking/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2013/03/18/quick-dirty-forking/</feedburner:origLink></item>
		<item>
		<title>CORS isn’t just for XHR</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/Vko7XWKzg7Q/</link>
		<comments>http://remysharp.com/2013/01/14/cors-isnt-just-for-xhr/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 11:00:50 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[cors]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1155</guid>
		<description><![CDATA[Cross Origin Resource Sharing (CORS) is what allows XHR (i.e. Ajax) requests to go cross domain. It&#8217;s a simple header response to the XHR request that says &#8220;yes, you can complete your request&#8221;, looking like this (if we allowed any client to place an XHR request against our service): Access-Control-Allow-Origin: * Should you be adding [...]


Related posts:<ol><li><a href='http://remysharp.com/2011/04/21/getting-cors-working/' rel='bookmark' title='Permanent Link: Getting CORS Working'>Getting CORS Working</a></li><li><a href='http://remysharp.com/2010/08/24/dynamic-favicons/' rel='bookmark' title='Permanent Link: Dynamic favicons'>Dynamic favicons</a></li><li><a href='http://remysharp.com/2009/02/16/jsonp-request-in-adobe-air/' rel='bookmark' title='Permanent Link: JSONP request in Adobe Air'>JSONP request in Adobe Air</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Cross Origin Resource Sharing (CORS) is what allows XHR (i.e. Ajax) requests to go cross domain. It&#8217;s a simple header response to the XHR request that says &#8220;yes, you can complete your request&#8221;, looking like this (if we allowed any client to place an XHR request against our service):</p>

<pre><code>Access-Control-Allow-Origin: *
</code></pre>

<p>Should you be adding this header to your existing API services? <strong><a href="http://annevankesteren.nl/2012/12/cors-101">Yes</a></strong>. </p>

<p>If you want more details on how it works check out this <a href="http://www.html5rocks.com/en/tutorials/cors/">HTML5 Rocks article</a> and make sure to watch out for <a href="http://remysharp.com/2011/04/21/getting-cors-working/">preflight issues</a>.</p>

<p>But this post isn&#8217;t about CORS for XHR, it&#8217;s about CORS for images. CORS for images is important for remixing content and sites such as <a href="http://flickr.com/photos/remysharp">Flickr</a>, <a href="http://instagram.com/remysharp">Instagram</a>, <a href="http://imgur.com/r/lolcats">Imgur</a> and the like.</p>

<h2 id="whatUseIsCORSForImages-heading">What use is CORS for images?</h2>

<p>(As far as I know) there&#8217;s one major use case: when you&#8217;re creating a dynamic canvas image and <em>you want to export it</em>. The canvas element has a method called <code>toDataURL</code> which gives you a base64 string representing the content of the canvas.</p>

<p>Perhaps you&#8217;re creating a collage of your flickr photos and want to print that collage out. More specifically, in my case, I&#8217;ve been taking a photo a day for 3 years, and I wanted to print the entire collection out on a material canvas. I use the canvas API to generate my image, but I can&#8217;t export it.</p>

<p>That&#8217;s to say, if you use canvas API method <code>drawImage</code> to paint a flickr photo (perhaps even <em>your own</em>) on to a canvas element, you can&#8217;t use <code>getImageData</code> to further manipulate the pictures, nor can you use <code>toDataURL</code> because the url your script executed on is not the same origin* as the flickr photo.</p>

<p><small>* <em>origin</em>, which is made up of the protocol, host and port number.</small></p>

<p>The solution to allowing us to export our canvas creations is to enable CORS from the source origin. Simply adding the <code>Access-Control-Allow-Origin</code> header when an image requests origin rights.</p>

<p>So in my case, where I wanted to generate a file to be sent to the printers, I moved my code to using Node.js (which I&#8217;ll post about in detail another day). Couldn&#8217;t do the export in the browser &#8211; but <em>I should have been able to</em>.</p>

<h2 id="howToRequestImagesWithCORS-heading">How to request images with CORS</h2>

<p>You have to set the <a href="http://www.w3.org/html/wg/drafts/html/master/infrastructure.html#cors-settings-attribute">crossOrigin</a> attribute, which can be set via HTML attributes or via JavaScript.</p>

<p>A blank value (as an HTML attribute) has the default value of <code>anonymous</code> &#8211; which is likely what you want. Alternatively you can set this to <code>use-credentials</code> which sets the credentials request header &#8211; which the server can use to decide whether you have rights to the content.</p>

<p>When the CORS headers are sent back from the server for an image, and that image is used on a canvas, the <em>origin-clean</em> flag is true, and we are able to remix the content as we please. </p>

<p>Below you can see a simple working example. The script reads the image element, draws and scales it to a new canvas, then creates a circular version of the picture, and it&#8217;s then exported to a new <em>real</em> image element, and finally the original image is replaced with the <em>cirlified</em> image. The source image is hosted on http://rem.io (the <code>&lt;img&gt;</code> element with the <code>crossOrigin</code> attribute at the top of the HTML) but the image remixing is happening on http://jsbin.com (as an embed on this site via an iframe).  This is all possible with CORS support.</p>

<p><a class="jsbin-embed" href="http://jsbin.com/ijimay/2/embed?live,html">canvas resizer</a><script src="http://static.jsbin.com/js/embed.js"></script></p>

<h2 id="goForth-heading">Go forth!</h2>

<p>So if you happen to work at a company, or know someone that works at a company that hosts user images &#8211; please please add CORS support to your images (if an origin header is sent in the request). </p>

<div class="update">There&#8217;s some <a href="https://plus.google.com/u/0/116910304844117268718/posts/96bSWSQ9zLY">good discussion going on</a> over at Google+ whereby Matle Ubl disagrees that you should slap on a whitelist star rule. Worth reading too.</div>

<p>Go, go make that change, now!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2011/04/21/getting-cors-working/' rel='bookmark' title='Permanent Link: Getting CORS Working'>Getting CORS Working</a></li><li><a href='http://remysharp.com/2010/08/24/dynamic-favicons/' rel='bookmark' title='Permanent Link: Dynamic favicons'>Dynamic favicons</a></li><li><a href='http://remysharp.com/2009/02/16/jsonp-request-in-adobe-air/' rel='bookmark' title='Permanent Link: JSONP request in Adobe Air'>JSONP request in Adobe Air</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=Vko7XWKzg7Q:WzYnJvdJwuk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=Vko7XWKzg7Q:WzYnJvdJwuk:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/Vko7XWKzg7Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2013/01/14/cors-isnt-just-for-xhr/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2013/01/14/cors-isnt-just-for-xhr/</feedburner:origLink></item>
		<item>
		<title>My 2012</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/OoxmjKd-Dek/</link>
		<comments>http://remysharp.com/2012/12/31/my-2012/#comments</comments>
		<pubDate>Mon, 31 Dec 2012 14:57:26 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[newyear]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1137</guid>
		<description><![CDATA[This will be my 5th year review post &#8211; so I&#8217;m definitely in my tradition shoes now. At the end of each year, I round up what I&#8217;ve been up to personally and professionally and try to set my sights on the upcoming year. This post is primarily for me so I can look back [...]


Related posts:<ol><li><a href='http://remysharp.com/2011/12/31/my-2011/' rel='bookmark' title='Permanent Link: My 2011'>My 2011</a></li><li><a href='http://remysharp.com/2011/10/17/ellis-tennyson-sharp/' rel='bookmark' title='Permanent Link: Ellis Tennyson Sharp'>Ellis Tennyson Sharp</a></li><li><a href='http://remysharp.com/2010/12/31/2010-the-year-ill-never-forget/' rel='bookmark' title='Permanent Link: 2010: The Year I&#8217;ll Never Forget'>2010: The Year I&#8217;ll Never Forget</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>This will be my <a href="http://remysharp.com/tag/newyear/">5th year</a> review post &#8211; so I&#8217;m definitely in my tradition shoes now. At the end of each year, I round up what I&#8217;ve been up to personally and professionally and try to set my sights on the upcoming year. This post is primarily for me so I can look back in years to come so I won&#8217;t appologise if it&#8217;s overly me-me-me!</p>

<h2 id="professional-heading">Professional</h2>

<p>I run my own consultancy/agency/what-have-you, called <a href="http://leftlogic.com">Left Logic</a>. My aim is to specialise in JavaScript based development, and as the years have gone on, that aim is starting to fruition. All our current client endeavours are either client-side JavaScript or server-side Node.js based JavaScript.</p>

<p>More importantly, I&#8217;m growing my company (more on that in a moment) so if you&#8217;re a business that needs our help: <a href="http://leftlogic.com/contact">get in touch</a>.</p>

<h3 id="business-heading">Business</h3>

<p><img src="http://remysharp.com/images/logo-512.png" alt="Left Logic logo" title="Left Logic logo" style="float: right; margin-left: 10px; margin-bottom: 10px; height: 120px;">From when I started my business back in September 2006, I told myself the sweet spot I was aiming for was 6 people (including myself). For the first 5 years employee head count remained at 1 &#8211; just me. Although I&#8217;ve contracted <a href="http://twitter.com/binarytales">Jon Linklater Johnson</a> for the best past of 3 years &#8211; so let&#8217;s say 1.75 people.</p>

<p>This September, <a href="http://twitter.com/julieanne">Julie</a> joined Left Logic full time (though she spent the last 3 years organising and running <a href="http://full-frontal.org">Full Frontal</a> and running accounts). She&#8217;s now our full time events organiser and company logistics person.</p>

<p>Then quickly after <a href="http://phuu.net/about.html">Tom Ashworth</a> joined Left Logic as a full time developer. A talented young developer from Cardiff Uni already having an impact on some of the work Left Logic produces (both client work and open source projects). I&#8217;m very excited to have him join Jon, Julie and myself at Left Logic.</p>

<p>As my company grows, I&#8217;m also <a href="http://leftlogic.com/contact">looking for more client projects</a> to challenge our work. Left Logic will of course <em>always</em> continue to contribute to open source projects (like <a href="http://jsbin.com">JS Bin</a>).</p>

<h3 id="speaking-heading">Speaking</h3>

<p>I spoke at 12 events this year, across England, Germany, Italy, Netherlands, Norway and the United States. I&#8217;ve been actively trying to keep my travelling down to no more than once a month &#8211; to keep near family (and also bringing Julie &amp; Ellis with me to events in some situations). I do love being out at events and being in different lands, but my family comes first which is why I can see myself further dwindling down the amount of travelling I do each month.</p>

<p>A few highlights for me included having the honour of being invited to <a href="http://2012.jsconf.us/">speak at jsconf.us</a>. Another jsconf highlight was having my proposal for a <a href="http://www.youtube.com/watch?v=y4lBEZTThvg">talk on iframes</a> being accepted by jsconf.eu. I (again) had the honour of speaking at the first jsconf.eu &#8211; and returning was an amazing experience where I tried very hard to attend as many talks as I could whilst still enjoying time chatting to friends, old and new.</p>

<p>All the other events were excellent, but one new event (to me) stood out that I whole heartedly recommend: <a href="http://2012.fromthefront.it/">From the Front</a>. An Italian conference in the beautiful Bologna, very much at the indie end of the scale, but run with so much heart it was hard not to walk away wanting to start hacking on project and hug everyone around you.</p>

<h3 id="projects-heading">Projects</h3>

<p><img src="http://jsbin.com/images/logo.png" alt="Dave, the JS Bin bot" title="My name is Dave" style="float: right; margin-left: 10px; margin-bottom: 10px; height: 150px; border: 1px solid #ccc;">The biggest project I worked on this year was the third iteration of JS Bin. The entire code base was converted from PHP to Node.js almost entirely to support the idea of &#8220;code casting&#8221; that I had back in 2008 when I <a href="http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/">first release</a> JS Bin. </p>

<p>The biggest contribution to JS Bin 3 came from <a href="http://aroncarroll.com/">Aron Carroll</a> &#8211; a talented developer based in Brighton who volunteered his time (for nearly 3 months) to write the new back end to JS Bin.</p>

<p>Now JS Bin includes (amongst others) code casting (where /watch is included on the url and viewer can see all your code <em>as</em> you code) and <a href="http://www.youtube.com/watch?v=eDFGrqjjyLk">remote rendering</a>.</p>

<p><a href="http://2012.full-frontal.org">Full Frontal 2012</a> was another huge success, and for me personally, the best year yet. We sold out in 2.5 hours this year &#8211; so there&#8217;s certainly demand to keep it going, and with discussion of demand over the years, <em>this</em> year I decided that I&#8217;d release video.</p>

<p><img src="http://remysharp.com/images/ff-2012.jpg" alt="Full Frontal 2012" title="" /></p>

<p>In the usual indie way, I decided to <a href="http://www.youtube.com/watch?v=dnfu1TFDDmg">edit the videos myself</a> which took at lot of time to start, but once in the rhythm wasn&#8217;t too bad. But for all my fighting with Final Cut Pro, I&#8217;m incredibly proud to have released the <a href="http://www.youtube.com/playlist?list=PLXmT1r4krsTrXThZIxcnzogf_YLOHRUZv&amp;feature=view_all">full conference freely on youtube</a>.</p>

<p>There&#8217;s also a couple of projects that I&#8217;ve alluded to and not released properly yet (but I&#8217;ll get on to doing so in 2013): <a href="http://www.youtube.com/watch?v=vsmJq7tU_2o">PhoneGapBin</a> (which <em>will</em> be renamed) and my <a href="https://twitter.com/rem/status/285715164655935488">365 canvas project</a> &#8211; which creates a full canvas of images for print using JavaScript.</p>

<h2 id="personal-heading">Personal</h2>

<p><img src="http://remysharp.com/images/ellis-1.jpg" style="float: left; margin-right: 10px; margin-bottom: 10px; height: 250px; border: 1px solid #ccc;">This year has been amazing watching <a href="http://remysharp.com/ellis">Ellis</a> grow and have his first birthday. Equally Tia&#8217;s second birthday was unexpectedly hard and she&#8217;s dearly missed by all.</p>

<p>I&#8217;ve been lucky enough to travel and see friends around the world and get up to all kinds of mischief (I&#8217;m looking at you <a href="http://twitter.com/joemccann">Joe</a> &amp; <a href="http://twitter.com/brianleroux">Brian</a>). </p>

<p>I consider myself lucky. I&#8217;m a man in my mid 30s and ordinarily not having chances to make new friendships in his later years, but the web industry has pushed me in to new places and forged brand new friendships out of nowhere. I&#8217;m hugely honoured, and consider this a big hug to tell you your friendship is appreciated.</p>

<p>When Ellis was born, I bought a Canon 550D and good lens (1.4 / 50mm) and continued our 365 project (a photo every day of the year) &#8211; and now I&#8217;ve got 3 years of photos to my name. My brother also asked me to <a href="http://www.flickr.com/photos/remysharp/8002601030/in/set-72157631573091383">photograph his wedding</a> (although I&#8217;m still an amateur, I&#8217;m pretty proud of the job I did). Below is a canvas sample of my 2012 365 project (though we&#8217;re planning to print the full 3 years on a single canvas):</p>

<p><img src="http://remysharp.com/images/canvas-2012.jpg" alt="365 2012 project" title="" /></p>

<p>One final highlight for me was that <a href="http://www.netmagazine.com/interviews/remy-sharp-learning-breaking-stuff">.net interviewed</a> me earlier on in the year. I remember back in 2007 thinking the .net magazine was a place I wanted to see my name printed. I&#8217;ve written articles for them in the past, but it was a nice little coup to be asked to be interviewed. The interview also includes a bit of back history and my approach to work &#8211; which was nice to share.</p>

<h2 id="2013-heading">2013</h2>

<p>What will it bring? Even more time with my family is most important to me &#8211; so staying near Julie &amp; Ellis is my first priority.</p>

<p>I&#8217;d like to blog a little more often (somehow I&#8217;ve got about 4 blog posts halfway written &#8211; just need to finish them up).</p>

<p>I&#8217;ll continue my 365 project, but in 2013 I&#8217;m going to also start using my SLR for photos and try to experiment more (different angles, pin hole photograph, light painting and more).</p>

<p>I also have a few talks coming up where I&#8217;m trying to share something personal and how I use technology. So not a &#8220;new tech&#8221; talk so much, but trying to aim to inspire (I hope!).</p>

<p>Either way &#8211; happy new year &#8211; and I wish you all the success you deserve. See you soon dearest reader (unless it&#8217;s me reading, in which case, see you next time you&#8217;re near a mirror&#8230;).</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2011/12/31/my-2011/' rel='bookmark' title='Permanent Link: My 2011'>My 2011</a></li><li><a href='http://remysharp.com/2011/10/17/ellis-tennyson-sharp/' rel='bookmark' title='Permanent Link: Ellis Tennyson Sharp'>Ellis Tennyson Sharp</a></li><li><a href='http://remysharp.com/2010/12/31/2010-the-year-ill-never-forget/' rel='bookmark' title='Permanent Link: 2010: The Year I&#8217;ll Never Forget'>2010: The Year I&#8217;ll Never Forget</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=OoxmjKd-Dek:6gnGpCrwcuE:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=OoxmjKd-Dek:6gnGpCrwcuE:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/OoxmjKd-Dek" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/12/31/my-2012/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/12/31/my-2012/</feedburner:origLink></item>
		<item>
		<title>My Workflow: Never having to leave DevTools</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/mkghvXkgcgY/</link>
		<comments>http://remysharp.com/2012/12/21/my-workflow-never-having-to-leave-devtools/#comments</comments>
		<pubDate>Fri, 21 Dec 2012 12:35:22 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[devtools]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1116</guid>
		<description><![CDATA[At this time of year (Christmas) there&#8217;s a lot of tip-like articles that emerge, so I wanted to share what I felt like was the single greatest technical win I have come across in the last few months: using Chrome DevTools for full web dev workflow &#8211; so I recorded a quick 4 minute screencast [...]


Related posts:<ol><li><a href='http://remysharp.com/2013/05/16/my-workflow-v2-mobile-devtools-livereload/' rel='bookmark' title='Permanent Link: My Workflow v2: Mobile, DevTools &#038; LiveReload'>My Workflow v2: Mobile, DevTools &#038; LiveReload</a></li><li><a href='http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/' rel='bookmark' title='Permanent Link: JS Bin for Collaborative JavaScript Debugging'>JS Bin for Collaborative JavaScript Debugging</a></li><li><a href='http://remysharp.com/2010/10/12/nodejs-rapid-development-nodemon/' rel='bookmark' title='Permanent Link: node.js rapid development: nodemon'>node.js rapid development: nodemon</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>At this time of year (Christmas) there&#8217;s a lot of tip-like articles that emerge, so I wanted to share what I felt like was the single greatest technical win I have come across in the last few months: using Chrome DevTools for <em>full</em> web dev workflow &#8211; so I recorded a quick 4 minute screencast (and even wrote up a few extra bits &#8211; because I felt generous this Christmas!).</p>

<p>Actually, truth be told, it&#8217;s not the entire workflow (I can&#8217;t create new files for instance) &#8211; but where I&#8217;m up to is: navigating my entire project, making changes and seeing the live impact of that change, testing new ideas and most importantly &#8211; actually saving those changes to disk without leaving DevTools.</p>

<iframe width="612" height="344" src="http://www.youtube.com/embed/ura4ee4fjZs?rel=0" frameborder="0" allowfullscreen></iframe>

<p>Although I&#8217;m using Canary in the screencast, this functionality is available today in Chrome stable.</p>

<h2 id="saving-heading">Saving</h2>

<p>For a long while now, you could edit the &#8220;sources&#8221; to the web page, and hitting save <code>cmd-s</code> and it would update the current state of the JavaScript engine &#8211; which is powerful as hell alone. </p>

<p>But in a recent release to DevTools, a feature that previous required an extension, when you save, DevTools will ask you <em>where</em> you want to save the file to. In my case, I&#8217;m working on client side apps &#8211; which means just a static directory of JavaScript files. That means I can overwrite the existing file (js or css), and when I continue hitting save, it now overwrites that file on disk. </p>

<p>For me, this seemingly simple addition, means I can do a large amount of coding, testing and debugging directly inside the browser &#8211; which reduces the workflow loops.</p>

<p>It&#8217;s also worth adding that, whilst you haven&#8217;t refreshed, you can also get a complete list of all the modifications &#8211; right click on the source: local modifications. From there you can see the time of edits but also see diffs of those changes and revert them (though I believe you should be able to revert individual changes &#8211; i.e. <em>just</em> the first change through a patch, I didn&#8217;t have any success with this and suspect it&#8217;s just a bug in Chrome that I came across).</p>

<h2 id="codeWithLiveState-heading">Code with live state</h2>

<p>Another big win for me (which I didn&#8217;t include in the video) is that whilst I&#8217;m working inside the sources panel, and experiementing I can quickly and easily inspect the state of variables.</p>

<p><img src="http://remysharp.com/images/devtools-conditional.png" style="float:right;margin-left: 5px; margin-bottom: 5px; width: 50%;">I&#8217;ll add a breakpoint, or a conditional breakpoint (right click on the line) &#8211; the code pauses, and hit <code>esc</code> to bring up a console and test code and check variable state or check entire lines of code to see if the result is what I&#8217;m expecting.</p>

<h2 id="spaceAndStretchingYourLegs-heading">Space and stretching your legs</h2>

<p>Finally, a couple of extra bits that make my workflow more comfortable for me. I always bump the font up on the DevTools (simple <code>cmd-+</code>) &#8211; maybe because I don&#8217;t like to strain my eyes, maybe because I&#8217;m getting old!</p>

<p>I dock DevTools to the right (in most cases) &#8211; which used to be under settings (the bottom right cog) but in Canary has moved to click-hold the bottom left &#8220;popout&#8221; icon.</p>

<p><img src="http://remysharp.com/images/devtools-hide-breaks.png" style="float:right;margin-left: 5px; margin-bottom: 5px; width: 230px;">
Then lastly I tend to hide the source navigator (the list of files) and the debugger (the right hand side) using the little collapse icon.</p>

<h2 id="whatIdLikeToSeeNext-heading">What I&#8217;d like to see next</h2>

<p>No doubt there&#8217;s someone I can direct these to, but equally I wanted to share my thoughts here because either maybe you know they&#8217;re coming, or there&#8217;s other features you&#8217;d like to see too:</p>

<ul>
<li>Ability to edit the &#8220;program&#8221; file, including the HTML, CSS &amp; JavaScript <a href="https://code.google.com/p/chromium/issues/detail?id=167289">#167289</a></li>
<li>A comment toggle keyboard shortcut (I keep hitting what I think it is, and instead pausing code execution) <a href="https://code.google.com/p/chromium/issues/detail?id=167284">#167284</a></li>
<li>Much clearer feedback when saving wasn&#8217;t linked to a file on the hard disk (sometimes I&#8217;ve hit save and it&#8217;ll save in V8&#8242;s engine, but not actually to disk, because I hadn&#8217;t linked it up yet) <a href="https://code.google.com/p/chromium/issues/detail?id=167285">#167285</a></li>
<li>Autocomplete whilst editing source (perhaps looking up from the autocomplete in the console) <a href="https://code.google.com/p/chromium/issues/detail?id=167290">#167290</a></li>
<li>Toggle word wrap on sources <a href="https://code.google.com/p/chromium/issues/detail?id=167287">#167287</a></li>
</ul>

<p>I&#8217;m sure there&#8217;s more I&#8217;d like to see the more my workflow moves inside of DevTools. I certainly hope this is as useful to you as it was to me when I discovered &#8220;save as&#8221;!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2013/05/16/my-workflow-v2-mobile-devtools-livereload/' rel='bookmark' title='Permanent Link: My Workflow v2: Mobile, DevTools &#038; LiveReload'>My Workflow v2: Mobile, DevTools &#038; LiveReload</a></li><li><a href='http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/' rel='bookmark' title='Permanent Link: JS Bin for Collaborative JavaScript Debugging'>JS Bin for Collaborative JavaScript Debugging</a></li><li><a href='http://remysharp.com/2010/10/12/nodejs-rapid-development-nodemon/' rel='bookmark' title='Permanent Link: node.js rapid development: nodemon'>node.js rapid development: nodemon</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=mkghvXkgcgY:DLDCM6Rmsnc:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=mkghvXkgcgY:DLDCM6Rmsnc:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/mkghvXkgcgY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/12/21/my-workflow-never-having-to-leave-devtools/feed/</wfw:commentRss>
		<slash:comments>34</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/12/21/my-workflow-never-having-to-leave-devtools/</feedburner:origLink></item>
		<item>
		<title>Contributing to the web community</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/wJ8AWwD5WnU/</link>
		<comments>http://remysharp.com/2012/12/18/contributing-to-the-web-community/#comments</comments>
		<pubDate>Tue, 18 Dec 2012 10:41:44 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[blogging]]></category>
		<category><![CDATA[community]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1111</guid>
		<description><![CDATA[Comments like these make me want to never contribute to this community. via @adamyeates on Twitter There was an article that upset a few (or one in particular) designer/UX/foo evanglists. I&#8217;m not pointing out this particular instance of pissing battles because if you&#8217;ve been on the web and following activitiy in the front end web [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/01/22/8-questions-after-ie-pissed-the-community-off/' rel='bookmark' title='Permanent Link: 8 questions after IE pissed the community off'>8 questions after IE pissed the community off</a></li></ol>]]></description>
			<content:encoded><![CDATA[<blockquote>
  <p>Comments like these make me want to never contribute to this community.</p>
</blockquote>

<p><a href="https://twitter.com/adamyeats/status/280628891033403393">via @adamyeates on Twitter</a></p>

<p>There was an article that upset a few (or one in particular) designer/UX/foo evanglists. I&#8217;m not pointing out this particular instance of pissing battles because if you&#8217;ve been on the web and following activitiy in the front end web community you&#8217;ve probably seen your fair share of pissing battles already.</p>

<p>And it&#8217;s not Adam in particular that I&#8217;m pointing out, but his sentiment (I&#8217;ve posted this with Adam&#8217;s permission first &#8211; I didn&#8217;t want to make it like I&#8217;m singling him out).</p>

<p>Adam, to me, is an excellent example of the newest generation of Web Worker. It&#8217;s possible you, &#8216;you&#8217; reading this article, are also in that early stage in your career. Or you want become more involved like I did a few years back. Which is why this particular tweet has forced my fingertips to my keyboard to blog about this. </p>

<p>I&#8217;ve met my fair share of people who want to blog/get involved/speak (more or at all) but tell me that they don&#8217;t feel like they have anything to share. Or that there are smarter people out there &#8211; what could they possible contribute. But it&#8217;s Adam&#8217;s tweet is the last thing you want to see. What about all those people who think the same thing but don&#8217;t say it. </p>

<p>What I&#8217;d like to say to those of you thinking about contributing something-anything: do it. Blindly if needs be.</p>

<p>To me there&#8217;s two main types of blog posts: technical and opinion. Either one of these are good for you to start with. You&#8217;ve got opinions, right? You&#8217;ve solved a problem (either design based or with codey stuff).</p>

<p>You are unique. Your perspective is unique. Your solutions are unique.</p>

<p>Most bloggers I know &#8211; and certainly me included &#8211; started blogging because their memory is pretty useless. Google + blogging served as a search engine for their memory. Start there if you&#8217;re still not convinced.</p>

<p>If you share those, you will have helped someone, somewhere, sometime along their way. And the more of that we have, the better (even though it&#8217;s possible some content gets stale after a while).</p>

<p>As my friend Chris <a href="https://twitter.com/chrismahon/status/280650684779606017">put it</a>:</p>

<blockquote>
  <p>Most blog posts are crap, but even if a handful of people find them useful it&#8217;s worth it, no?</p>
</blockquote>

<p>Hell. yes.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/01/22/8-questions-after-ie-pissed-the-community-off/' rel='bookmark' title='Permanent Link: 8 questions after IE pissed the community off'>8 questions after IE pissed the community off</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=wJ8AWwD5WnU:9tQsOvM1DDg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=wJ8AWwD5WnU:9tQsOvM1DDg:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/wJ8AWwD5WnU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/12/18/contributing-to-the-web-community/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/12/18/contributing-to-the-web-community/</feedburner:origLink></item>
		<item>
		<title>The Tooling Workshop</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/NBbrUB2uABU/</link>
		<comments>http://remysharp.com/2012/07/30/the-tooling-workshop/#comments</comments>
		<pubDate>Mon, 30 Jul 2012 10:26:18 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[fullfrontalconf]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1086</guid>
		<description><![CDATA[I wanted to explain what the tooling workshop is, why I think it&#8217;s awesome, and therefore why there should be more of these. The cliff notes It&#8217;s 1 day, 3 teachers. You get to pick and choose 4 of the 6 topics. All designed around being a better front end developer giving you the core [...]


Related posts:<ol><li><a href='http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/' rel='bookmark' title='Permanent Link: Full Frontal 2012 launches soon!'>Full Frontal 2012 launches soon!</a></li><li><a href='http://remysharp.com/2011/01/12/creative-html5-and-javascript-workshop-by-seb_ly/' rel='bookmark' title='Permanent Link: Creative HTML5 and JavaScript workshop by @seb_ly'>Creative HTML5 and JavaScript workshop by @seb_ly</a></li><li><a href='http://remysharp.com/2011/04/27/my-big-workshop-tour/' rel='bookmark' title='Permanent Link: My Big Workshop Tour'>My Big Workshop Tour</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I wanted to explain what the tooling workshop is, why I think it&#8217;s awesome, and therefore why there should be more of these.</p>

<h2 id="theCliffNotes-heading">The cliff notes</h2>

<p>It&#8217;s 1 day, 3 teachers. You get to pick and choose 4 of the 6 topics. All designed around being a better front end developer giving you the core skills you need for project work.</p>

<p>Most importantly, the day is organised so you can choose <em>any</em> 4 topics and see them all &#8211; we&#8217;ve worked hard to make sure that&#8217;s possible. RequireJS, debugging, build and release processes, testing techniques, using git to its full advantage and Sass are all for the picking.</p>

<p><a href="http://2012.full-frontal.org/workshop/tooling#tooling">£220+VAT &#8211; sign up now!</a> And if you think there should be more of these, <a href="http://leftlogic.com/contact">let me know</a>!</p>

<p><span id="more-1086"></span></p>

<h2 id="planningThePerfectDay-heading">Planning the perfect day</h2>

<p>What makes this day special is that <em>you</em> choose the content. So the day has been organised to allow for that, but the order of sessions is important to make sure you can get to them all. Below you can choose 4 topics (two in the morning, two in the afternoon), and the planner will show you what order you need to attend the sessions (and yes, this will be available on the day):</p>

<ul>
<li>Sass with Jake</li>
<li>RequireJS with Rebecca</li>
<li>Testing with Rebecca</li>
<li>Git with Jake</li>
<li>Debugging with Remy</li>
<li>Build with Remy</li>
</ul>

<p>There&#8217;s an interactive tool further down this page that will allow you try out different combinations.</p>

<h2 id="whoAreTheTrainers-heading">Who are the trainers?</h2>

<ol>
<li>Myself, <a href="http://twitter.com/rem">Remy Sharp</a></li>
<li><a href="http://twitter.com/rmurphey">Rebecca Murphey</a> who&#8217;s been doing loads of really great stuff in the developer tools arena, <a href="http://rmurphey.com/blog/2012/04/12/a-baseline-for-front-end-developers/">explaining</a> what we should be using and why.</li>
<li><a href="https://twitter.com/jaffathecake/">Jake Archibald</a> who now works for <a href="http://lanyrd.com">Lanyrd</a> and has loads of hands on experience with the problems developers face</li>
</ol>

<h2 id="isThereAnyMoreDetailOnWhatWillEachSessionWillCover-heading">Is there any more detail on what will each session will cover</h2>

<p>A bit more, yes. Head over to <a href="http://2012.full-frontal.org/workshop/tooling#tooling">2012.full-frontal.org/workshop/tooling</a> for full details.</p>

<h2 id="howMuchWhenAndWhere-heading">How much, when and where?</h2>

<p>£220+VAT (so £264), Wednesday 6th November 2012 at The Lighthouse in Brighton.</p>

<p><a href="https://leftlogic.stagehq.com/events/1518">You can buy your ticket here</a></p>

<h2 id="isThisSuitableForBeginnersintermediateexperts-heading">Is this suitable for beginners/intermediate/experts?</h2>

<p>We&#8217;re shooting for these workshops to be ideally accessible for beginners and intermediate experienced developers. Obviously however if you&#8217;re an expert in Git, you&#8217;ll be able to miss that session and attend any of the other four sessions.</p>

<p>On top of which, there&#8217;ll be hands on exercises throughout the day, and practise makes perfect!</p>

<h2 id="whyTheMiniSessions-heading">Why the mini sessions?</h2>

<p>I felt like I needed to learn about Sass and RequireJS, but I knew that I needed more than a 45 minute conference session to get the taster I needed.  Equally I didn&#8217;t want to spend £400 on a full day of Sass. What I <em>really</em> wanted was the taster but <em>with hands on exercises</em> as it&#8217;s the &#8220;fingers to keyboard&#8221; that helps my brain remember and really learn.</p>

<p>So why not create a mixed bag, interactive workshop where you get to have real hands on tasters. Not quite a full workshop where often there will be potions that I might know already, but where <em>I get to decide</em> the technologies I learn.</p>

<h2 id="doINeedToDecideWhichSessionsIAttendNow-heading">Do I need to decide which sessions I attend now?</h2>

<p>No, but we will ask closer to the event which sessions you&#8217;re likely to attend so we can organise our schedule appropriately. One room holds 30 people, the others hold 16, so we&#8217;ll make sure the rooms are carefully balanced to demand.</p>

<h2 id="canIReallyAttendAny4Sessions-heading">Can I <em>really</em> attend any 4 sessions?</h2>

<p>Yes. We&#8217;ve carefully planned the order of sessions so any combination of sessions is possible. Here&#8217;s a session planner (which you&#8217;ll have access to on the day too):</p>

<iframe src="http://jsbin.com/uyupat/36/quiet" style="width: 100%; height: 360px;"></iframe>

<h2 id="whatIfASessionIsFullOnTheDay-heading">What if a session is full on the day?</h2>

<p>If that&#8217;s the case, we&#8217;ll give you first priority when the session runs again. Make sure you prioritise the most important sessions you want for the morning (if possible).</p>

<h2 id="canIAttendTheSameSessionTwice-heading">Can I attend the same session twice?</h2>

<p>If you so desire, absolutely.</p>

<h2 id="isThereAQuestionIHaventAnswered-heading">Is there a question I haven&#8217;t answered?</h2>

<p>If there is, just drop a comment and I&#8217;ll include the answer in this FAQ-type-blog post.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/' rel='bookmark' title='Permanent Link: Full Frontal 2012 launches soon!'>Full Frontal 2012 launches soon!</a></li><li><a href='http://remysharp.com/2011/01/12/creative-html5-and-javascript-workshop-by-seb_ly/' rel='bookmark' title='Permanent Link: Creative HTML5 and JavaScript workshop by @seb_ly'>Creative HTML5 and JavaScript workshop by @seb_ly</a></li><li><a href='http://remysharp.com/2011/04/27/my-big-workshop-tour/' rel='bookmark' title='Permanent Link: My Big Workshop Tour'>My Big Workshop Tour</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=NBbrUB2uABU:D4CwZ7sXc3M:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=NBbrUB2uABU:D4CwZ7sXc3M:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/NBbrUB2uABU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/07/30/the-tooling-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/07/30/the-tooling-workshop/</feedburner:origLink></item>
		<item>
		<title>Full Frontal 2012 launches soon!</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/XbwUk0NMcAM/</link>
		<comments>http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/#comments</comments>
		<pubDate>Mon, 18 Jun 2012 09:19:13 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1074</guid>
		<description><![CDATA[Full Frontal is launching tickets next Monday (25-June) at 10am, and I wanted to give you a heads up as to what you can expect. I should add all this information will be fully revealed as soon as tickets go live next week. Changes to the venue No, we&#8217;re not moving from The Duke of [...]


Related posts:<ol><li><a href='http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/' rel='bookmark' title='Permanent Link: Going Full Frontal in one week'>Going Full Frontal in one week</a></li><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p><img src="/images/ff-2012.png" style="float: right; margin-left: 10px; margin-bottom: 10px"></p>

<p><a href="http://full-frontal.org">Full Frontal</a> is launching tickets next Monday (25-June) at 10am, and I wanted to give you a heads up as to what you can expect.</p>

<p>I should add all this information will be fully revealed as soon as tickets go live next week.</p>

<p><span id="more-1074"></span></p>

<h2 id="changesToTheVenue-heading">Changes to the venue</h2>

<p>No, we&#8217;re not moving from The Duke of Yorks just yet, but they will (in August) make the <a href="https://twitter.com/adebree/status/3018602559053824">seats</a> <em>even more comfy</em>, and bigger &#8211; but bigger means less &#8211; so this year, I&#8217;m afraid, there will be 15 people who can&#8217;t come to the event (as in there are 15 less seats!). </p>

<p>We are seriously looking in to whether we can video record the event and there&#8217;s a few logistical issues we need to overcome &#8211; but it is on our list of possible workarounds to the limit of number of people who can enjoy the event.</p>

<p>Until then, we will continue to capture the audio and <a href="http://huffduffer.com/tags/fullfrontalconf">release it for free</a>.</p>

<p><img src="/images/attendees.jpg" style="max-width: 100%;"></p>

<h2 id="ticketsAndWorkshops-heading">Tickets and workshops</h2>

<p>Tickets this year are £150+VAT (so £180 for those paying VAT), so if you need to provision the budget from a manager or some such, do that now because last year we sold out in 4 days and we&#8217;re hoping and bracing for the same.</p>

<h3 id="workshops-heading">Workshops</h3>

<p>Some people didn&#8217;t realise, but our full day workshops (at £400+VAT) includes the conference day pass &#8211; so that&#8217;s two tickets for the price of one.</p>

<p>I&#8217;ll be running a <a href="http://leftlogic.com/training#mobile">mobile development workshop</a>, the second will be on HTML5, the trainer will be announced on Monday.</p>

<p>We&#8217;re also running a special workshop-slash-tutorials day which I&#8217;m calling the &#8220;Tooling Tutorials Pick &#8216;n Mix&#8221;.  The idea is there will be 3 trainers each teaching 2 hands on tutorials running for 90 minutes (git, testing, debugging, build processes, SASS and RequireJS).  The day is carefully organised that you can attend <em>any</em> 4 sessions in the day (two in the morning, two in the afternoon). </p>

<p>The tutorials are designed to be more than just reading a blog post or watching a 40 minute talk, it goes that little bit further and gets your hands dirty and introduced to <em>actually doing it</em>.  Note that this workshop doesn&#8217;t include a conference pass.  The tickets also go on sale on Monday at £220+VAT.</p>

<p>I&#8217;m really excited about this pick &#8216;n mix workshop, the only disappointing thing is I won&#8217;t be able to attend them all because I&#8217;ll be running two of the six sessions.</p>

<h2 id="speakers-heading">Speakers</h2>

<p>Speakers are important, but the way I curate Full Frontal is there is content I want to hear about, and I then try to find the best match to that content.  We also have an open call for speakers where if you&#8217;re either proposing a talk I&#8217;ve suggested or you&#8217;re passionate about your subject, your talk will be considered for the event. Note that if you&#8217;ve <a href="http://www.flickr.com/photos/remysharp/4125319962/">attended the event in the past</a>, you&#8217;ll notice a general lack of &#8220;library&#8221; based talks &#8211; this is on purpose and hints towards the kinds of talks I&#8217;d like to see at my event.</p>

<p>But you want to know who&#8217;s speaking, right?! The line up (so far) will be revealed on Monday at 10am :)</p>

<h2 id="getYourMugInTheBackgroundOfOurSite-heading">Get your mug in the background of our site</h2>

<p>If you want your face to appear in the background of the site, or intend on coming (or &#8220;tracking&#8221;) add <a href="http://lanyrd.com/2012/full-frontal/">yourself to the Lanyrd page</a></p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2009/11/16/going-full-frontal-in-one-week/' rel='bookmark' title='Permanent Link: Going Full Frontal in one week'>Going Full Frontal in one week</a></li><li><a href='http://remysharp.com/2009/04/20/full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Full Frontal JavaScript Conference'>Full Frontal JavaScript Conference</a></li><li><a href='http://remysharp.com/2009/08/19/win-a-ticket-for-the-full-frontal-javascript-conference/' rel='bookmark' title='Permanent Link: Win a ticket for the Full Frontal JavaScript Conference'>Win a ticket for the Full Frontal JavaScript Conference</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=XbwUk0NMcAM:LsoaNRTkZNw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=XbwUk0NMcAM:LsoaNRTkZNw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/XbwUk0NMcAM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/</feedburner:origLink></item>
		<item>
		<title>Development Trick: auto-updating &amp; auto-reloading</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/u_iM3P1falQ/</link>
		<comments>http://remysharp.com/2012/06/16/development-trick-auto-updating-auto-reloading/#comments</comments>
		<pubDate>Sat, 16 Jun 2012 13:39:00 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[node]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1069</guid>
		<description><![CDATA[For the upgrade of JS Bin to version 3 (an open beta), the whole code base is in the process of being rewritten to run as a Node.js process (whilst still working as a PHP application). What&#8217;s neat is I&#8217;ve got it to automatically pull the latest changes from github and automatically restart my Node [...]


Related posts:<ol><li><a href='http://remysharp.com/2010/10/12/nodejs-rapid-development-nodemon/' rel='bookmark' title='Permanent Link: node.js rapid development: nodemon'>node.js rapid development: nodemon</a></li><li><a href='http://remysharp.com/2006/11/27/auto-input-grow-with-css-but-is-it-a-bug-2/' rel='bookmark' title='Permanent Link: Auto input grow with CSS (but is it a bug?)'>Auto input grow with CSS (but is it a bug?)</a></li><li><a href='http://remysharp.com/2007/01/06/how-to-setup-your-mac-web-development-environment/' rel='bookmark' title='Permanent Link: How to setup your Mac web development environment'>How to setup your Mac web development environment</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>For the upgrade of JS Bin to <a href="http://jsbin.com/3/">version 3</a> (an open beta), the whole code base is in the process of <a href="https://github.com/remy/jsbin/tree/feature/node">being rewritten to run as a Node.js</a> process (whilst still working as a PHP application).</p>

<p>What&#8217;s neat is I&#8217;ve got it to automatically pull the latest changes from github and automatically restart my Node process.</p>

<p>I don&#8217;t claim this to be particularly clever, and I&#8217;m sure I should be able to trigger a pull on the server as a push happens, but this works fairly well for my development workflow (where the app needs to be online) and is pretty simple &#8211; which I like.</p>

<h2 id="commands-heading">Commands</h2>

<p>For those like me who don&#8217;t care about the detail, here&#8217;s exactly what I&#8217;m doing in the terminal:</p>

<pre><code>$ cd /WWW/jsbin/
$ screen -S gitpull
$ watch git pull
CTRL+a d
$ screen -S jsbin
$ nodemon .
CTRL+a d
</code></pre>

<p>Here&#8217;s what&#8217;s going on.</p>

<h2 id="screen-heading">Screen</h2>

<p>I&#8217;m using a linux process called <a href="http://www.oreillynet.com/linux/cmd/cmd.csp?path=s/screen">screen</a> which simply put: creates a persistent shell that you can send to the background and retrieve at a later date. This means I can run my processes inside a screen and get them back any time I want if there&#8217;s some debugging to do.</p>

<p>Now I&#8217;ve got a way of managing two tasks:</p>

<ol>
<li>Pull from github for any changes</li>
<li>Restart my node process</li>
</ol>

<p>Once you&#8217;re inside <code>screen</code> to detach (and return to your original shell) you use the command sequence <code>CTRL+a d</code>. </p>

<p>Here&#8217;s a few extra simple commands:</p>

<ul>
<li><code>screen -ls</code> will show all the screen processes you&#8217;re running and the PIDs they have. You&#8217;ll need the PID to reattach the screen</li>
<li><code>screen -r&lt;PID&gt;</code> so in my case: <code>screen -r gitpull</code> will reattach and put me back in to the screen</li>
</ul>

<h2 id="autoUpdatingCode-heading">Auto-updating code</h2>

<p>Inside one screen we make use of <a href="http://www.oreillynet.com/linux/cmd/cmd.csp?path=w/watch">watch</a> which will keep running a process every 2 seconds. So I &#8220;watch&#8221; the <code>git pull</code> command.</p>

<p>Obviously this is a bit crap because it&#8217;s trying to pull from github to no avail most of the time, but it does mean that when I push new code up, this process will automatically pull.</p>

<p>Which leads me on to restarting&#8230;</p>

<h2 id="autoReloading-heading">Auto-reloading</h2>

<p>In another <code>screen</code> I&#8217;m running the development tool <a href="https://github.com/remy/nodemon">Nodemon</a> to auto restart when any JavaScript files change (which come from the git pull).</p>

<p>So that&#8217;s it. Pretty simple.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2010/10/12/nodejs-rapid-development-nodemon/' rel='bookmark' title='Permanent Link: node.js rapid development: nodemon'>node.js rapid development: nodemon</a></li><li><a href='http://remysharp.com/2006/11/27/auto-input-grow-with-css-but-is-it-a-bug-2/' rel='bookmark' title='Permanent Link: Auto input grow with CSS (but is it a bug?)'>Auto input grow with CSS (but is it a bug?)</a></li><li><a href='http://remysharp.com/2007/01/06/how-to-setup-your-mac-web-development-environment/' rel='bookmark' title='Permanent Link: How to setup your Mac web development environment'>How to setup your Mac web development environment</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=u_iM3P1falQ:H5h-MFozyUo:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=u_iM3P1falQ:H5h-MFozyUo:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/u_iM3P1falQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/06/16/development-trick-auto-updating-auto-reloading/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/06/16/development-trick-auto-updating-auto-reloading/</feedburner:origLink></item>
		<item>
		<title>Issues with position fixed &amp; scrolling on iOS</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/s873qrJTEfM/</link>
		<comments>http://remysharp.com/2012/05/24/issues-with-position-fixed-scrolling-on-ios/#comments</comments>
		<pubDate>Thu, 24 May 2012 09:08:32 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[ios]]></category>
		<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1039</guid>
		<description><![CDATA[With the release of iOS 5, fixed positioned layout is said to be supported in MobileSafari. The word supported needs to be taken with a pinch of salt, because there&#8217;s all kinds of issues which I intend to show you in the following post. Note that I have filed bugs for a number of these [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/02/06/how-i-fixed-wordpress-broken-upgrade/' rel='bookmark' title='Permanent Link: How I Fixed WordPress&#8217; Broken Upgrade'>How I Fixed WordPress&#8217; Broken Upgrade</a></li><li><a href='http://remysharp.com/2009/01/26/element-in-view-event-plugin/' rel='bookmark' title='Permanent Link: Element &#8216;in view&#8217; Event Plugin'>Element &#8216;in view&#8217; Event Plugin</a></li><li><a href='http://remysharp.com/2008/01/21/fixing-ie-overflow-problem/' rel='bookmark' title='Permanent Link: Fixing IE overflow problem'>Fixing IE overflow problem</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>With the release of iOS 5, fixed positioned layout is said to be supported in MobileSafari.</p>

<p>The word <em>supported</em> needs to be taken with a pinch of salt, because there&#8217;s all kinds of issues which I intend to show you in the following post.</p>

<p><small>Note that I have filed bugs for a number of these during the beta of iOS 5 &#8211; but god knows how the Radar Apple thing works, so I don&#8217;t know the issue numbers.</small></p>

<p><span id="more-1039"></span></p>

<div class="update"><strong>Update:</strong> I&#8217;ve added &#8220;scrolling == unusable position:fixed element&#8221; based on Corey Duston pointing out <em>more</em> bugs with position fixed.</div>

<h2 id="positionfixedWhoCares-heading">position:fixed, who cares?</h2>

<p>I might have argued that fixed positioned doesn&#8217;t matter or isn&#8217;t really required in a good app. However, there&#8217;s an increasing number of iOS apps I&#8217;ve noticed that are actually just a collection of WebViews (mini-MobileSafaris) with fixed position toolbars as seen in Apple&#8217;s own AppStore app, the native Facebook app and Instagram below:</p>

<p><img src="http://remysharp.com/images/appstore.jpg" style="max-width: 30%; border: 1px solid #ccc;"><img src="http://remysharp.com/images/facebook.jpg" style="max-width: 30%; margin-left: 10px;border: 1px solid #ccc;"><img src="http://remysharp.com/images/instagram.jpg" style="margin-left: 10px; max-width: 30%;border: 1px solid #ccc;"></p>

<p><small>AppStore via <a href="https://twitter.com/devongovett/statuses/84008944674148352">@devongovett</a>, Facebook via <a href="https://twitter.com/9eggs/status/205558649937072130/photo/1">@9eggs</a></small></p>

<h2 id="issues-heading">Issues</h2>

<p>I&#8217;ve created a number of example pages that you can view for yourself, which are used in the following videos.</p>

<h3 id="juddering-heading">Juddering</h3>

<p>If you add <code>position:fixed</code> in any normal way as you might on a &#8220;desktop&#8221; site, you&#8217;ll see some degree of juddering as the page scrolls.</p>

<iframe width="612" height="341" src="http://www.youtube.com/embed/yps8Ea5GO4I?fs=1&amp;#038;feature=oembed" frameborder="0" allowfullscreen></iframe>

<p>Note that this is the simulator running, but I&#8217;ve also captured the <a href="http://www.youtube.com/watch?v=T5P0x5NPr3M&amp;hd=1">real iPhone</a> (using Reflection) showing the same behaviour.</p>

<p>The page used was: <a href="http://jsbin.com/3/ixewok/6/">jsbin.com/3/ixewok/6/</a> (<a href="http://jsbin.com/3/ixewok/6/edit?html,css,live">edit</a>)</p>

<h3 id="noUpdatedValuesOnScroll-heading">No updated values on scroll</h3>

<p>The sharp eyed viewer might have spotted some values changing in the video. I&#8217;m monitoring the <code>window.scrollTop</code> and <code>window.pageYOffset</code> (and another value which we&#8217;ll look at later). You&#8217;ll notice that the values don&#8217;t change <em>until</em> the scroll has finished.</p>

<p>This is a problem if you want to monitor the page position to simulate effects like the bumping and shunting of category headings like you might see in the address book app.</p>

<h3 id="positionDrift-heading">Position drift</h3>

<p>If the page is zoomed at all, which you can get in iOS when the user rotates from portrait to landscape, as the user scrolls in any scale beyond 1 (i.e. zoomed), the position fixed element drifts upwards (I&#8217;ve seen this drift entirely out of view before in other sites):</p>

<iframe width="612" height="341" src="http://www.youtube.com/embed/YIOdPf7jqK4?fs=1&amp;#038;feature=oembed" frameborder="0" allowfullscreen></iframe>

<p>The page used was: <a href="http://jsbin.com/3/ixewok/6/">jsbin.com/3/ixewok/6/</a> (<a href="http://jsbin.com/3/ixewok/6/edit?html,css,live">edit</a>)</p>

<h3 id="focusJumping-heading">Focus jumping</h3>

<p>If there&#8217;s a focusable element inside the position fixed element, i.e. an input element, this can cause the entire fixed element to jump out of place. This will only happen if the user has scrolled any amount (but if you&#8217;re using <code>position:fixed</code> you&#8217;re expecting exactly that kind of usage).</p>

<iframe width="612" height="341" src="http://www.youtube.com/embed/lrnvZDwgJRc?rel=0" frameborder="0" allowfullscreen></iframe>

<p>The page used was: <a href="http://jsbin.com/3/ixewok/8/">jsbin.com/3/ixewok/8/</a> (<a href="http://jsbin.com/3/ixewok/8/edit?html,css,live">edit</a>)</p>

<h3 id="scrollingUnusablePositionfixedElement-heading">Scrolling == unusable position:fixed element</h3>

<p><a href="https://twitter.com/#cdutson">Corey Dutson</a> pointed out there&#8217;s <em>another</em> issue with position fixed. Although <a href="http://www.youtube.com/watch?v=NStzlMgvZy8">his example</a> show scrolling using JavaScript, the core problem is: if the page moves programatically (i.e. the user didn&#8217;t cause the scroll) the elements inside the fix element are unavailable.</p>

<p>From the screencast I&#8217;ve recorded you can see using <a href="http://www.iwebinspector.com">iWebInspector</a> that although MobileSafari has painted the fixed element in place, it&#8217;s actually not there &#8211; the actual element remains in place until you touch and move the page again.</p>

<iframe width="612" height="341" src="http://www.youtube.com/embed/R2MzdeJSCKw?fs=1&amp;#038;feature=oembed" frameborder="0" allowfullscreen></iframe>

<p>The page used was: <a href="http://jsbin.com/3/ixewok/13/">jsbin.com/3/ixewok/13/</a> (<a href="http://jsbin.com/3/ixewok/13/edit?html,css,live">edit</a>)</p>

<p>I don&#8217;t have a fix for this yet, and I suspect it&#8217;s a core painting issue inside of MobileSafari &#8211; but I will keep playing to see if there&#8217;s something that can be done.</p>

<h3 id="fixingJuddering-heading">Fixing juddering</h3>

<p>With iOS 5, MobileSafari also came with <code>-webkit-overflow-scrolling: touch</code>. This is actually intended for inline blocks of content to the page (I mean inline with respect to the document).</p>

<p>If I change the CSS in my previous example, and set the height of my <code>html</code>, <code>body</code> and content block to 100%, then apply the scrolling touch property to the content, the juddering goes away. However, that alone does not fix the juddering.</p>

<p>The trick would seem to be: make sure your fixed position element is <em>not</em> on a &#8220;moving canvas&#8221;. This example has the fixed element <em>over</em> a scrolling element, but <em>not</em> inside of it.</p>

<p>So when I tried to apply this technique to the <code>body</code> element, the juddering was still visible, as the fixed element was <em>inside</em> the scrolling element.</p>

<iframe width="612" height="341" src="http://www.youtube.com/embed/suXz5dKtlcA?rel=0" frameborder="0" allowfullscreen></iframe>

<p>I also <a href="http://www.youtube.com/watch?v=obTy5tWOsxA&amp;hd=1">captured this</a> on the real device too.</p>

<p>The page used was: <a href="http://jsbin.com/3/ixewok/10/">jsbin.com/3/ixewok/10/</a> (<a href="http://jsbin.com/3/ixewok/10/edit?html,css,live">edit</a>)</p>

<h3 id="gettingScrollPositionToUpdate-heading">Getting scroll position to update</h3>

<p>Again, those keen eyes might have spotted values are moving again. Note that as I&#8217;ve changed the CSS the body is no longer scrolling, so the 0 values on the left and right are <code>window.scrollTop</code> and <code>window.pageYOffset</code> respectively. Since the window isn&#8217;t scrolling, the content block is in an overflow, the values won&#8217;t change.</p>

<p>However, the <code>content.scrollX</code> value <em>is changing</em> &#8211; but it doesn&#8217;t by default.</p>

<p>Firstly, you have to attach <em>any</em> touch event handler to get this value to update as the user is scrolling (or actually touching), so in JavaScript I can add:</p>

<pre><code>content.ontouchstart = function () {};
</code></pre>

<p>The touch event will work with start, end and move, and just needs a value set (note that I didn&#8217;t test just setting it to <code>true</code> &#8211; that <em>might</em> work too!).</p>

<p>However, it&#8217;s still not perfect. You&#8217;ll see from the video above, that it <strong>only updated whilst I&#8217;m touching</strong>. As soon as I let go during a swipe to scroll, the momentum makes the page continue to scroll, but the value doesn&#8217;t update.</p>

<p>I&#8217;ve yet to work out if it&#8217;s even possible to capture this value. ::sigh::</p>

<h2 id="toConcludeTLDR-heading">To conclude / TL;DR</h2>

<p>Don&#8217;t use <code>position:fixed</code> inside a scrolling element, it&#8217;s juddery and looks rubbish (I&#8217;ve seen much worse than the juddering shown in the videos). Do make use of <code>-webkit-overflow-scrolling: touch</code> and if you want the scroll values, make sure you attach a touch handler to that scrolling element.</p>

<p>At the same time: make this work in other mobile browsers too &#8211; don&#8217;t just cater to Apple. It&#8217;s a huge headache that Apple have half arsed-ed-ly fixed the <code>position:fixed</code> issue and done in a <strike>typically Microsoft</strike> proprietory way.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/02/06/how-i-fixed-wordpress-broken-upgrade/' rel='bookmark' title='Permanent Link: How I Fixed WordPress&#8217; Broken Upgrade'>How I Fixed WordPress&#8217; Broken Upgrade</a></li><li><a href='http://remysharp.com/2009/01/26/element-in-view-event-plugin/' rel='bookmark' title='Permanent Link: Element &#8216;in view&#8217; Event Plugin'>Element &#8216;in view&#8217; Event Plugin</a></li><li><a href='http://remysharp.com/2008/01/21/fixing-ie-overflow-problem/' rel='bookmark' title='Permanent Link: Fixing IE overflow problem'>Fixing IE overflow problem</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=s873qrJTEfM:5kxp8yfU8IQ:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=s873qrJTEfM:5kxp8yfU8IQ:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/s873qrJTEfM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/05/24/issues-with-position-fixed-scrolling-on-ios/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/05/24/issues-with-position-fixed-scrolling-on-ios/</feedburner:origLink></item>
		<item>
		<title>Notes from State of the Browser</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/azrHFbuH56Q/</link>
		<comments>http://remysharp.com/2012/04/28/notes-from-state-of-the-browser/#comments</comments>
		<pubDate>Sat, 28 Apr 2012 11:57:00 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1025</guid>
		<description><![CDATA[Notes/live blog from The State of the Browser &#8211; unedited! Web vs. Native &#8211; @mahemoff &#8220;Will apps kill websites&#8221; &#8211; this month Facebook 2011 backing HTML5, whilst investing in native apps - instagram Instagram has no website (yet uses the web) Platforms, apps or otherwise, still using web infrastructure &#8211; via RESTful services Web &#8211; [...]


Related posts:<ol><li><a href='http://remysharp.com/2008/02/12/jquery-api-browser/' rel='bookmark' title='Permanent Link: jQuery API Browser'>jQuery API Browser</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>Notes/live blog from <a href="http://browser.londonwebstandards.org/">The State of the Browser</a> &#8211; unedited!</p>

<h2 id="webVsNativeMahemoffhttptwittercommahemoff-heading">Web vs. Native &#8211; <a href="http://twitter.com/mahemoff">@mahemoff</a></h2>

<p>&#8220;Will apps kill websites&#8221; &#8211; this month</p>

<ul>
<li>Facebook 2011 backing HTML5, whilst investing in native apps -
instagram</li>
<li>Instagram has no website (yet uses the web)</li>
<li>Platforms, apps or otherwise, still using web infrastructure &#8211; via
RESTful services</li>
<li>Web &#8211; dev experience &#8211; boils down to view source + browser => already
going</li>
<li>UI capabilities still suck on the web &#8211; doing it consistently, with
smooth effects is HARDDDD</li>
<li>Offline doesn&#8217;t matter so much?</li>
<li>Dev experience can be tricky for developers &#8211; maybe not the smoothest
or more compatible tech. ie. the localStorage &#8220;issue&#8221;.</li>
<li>Device integration is lacking &#8211; but will specs like WebRT solve this?
Will Google resist these kinds of specs &#8211; why aren&#8217;t they leading this
or is there a politic play whereby Chrome Book doesn&#8217;t require &#8220;apps&#8221;?</li>
</ul>

<h3 id="wereWebappsAreLacking-heading">Were WebApps are lacking</h3>

<ul>
<li>Single sign is hard</li>
<li>Intention</li>
<li>Device access</li>
<li>Background processing&#8230;native apps are able to proactively schedule
task in the background &#8211; web doesn&#8217;t have this at all yet
(WebRT/thing?). Notifications / geo-fencing(?) / syncing. Background
seems like one of the worst/highest level of requirements we need to
compete web vs. native</li>
</ul>

<h3 id="theChallengeWhatWeNeedToDo-heading">The Challenge &#8211; what we need to do</h3>

<ul>
<li>Advisory, like html5ple.se and some guidance &#8211; it&#8217;s kinda like the 90s
again where there was a fuck load of JS libraries. Native has one way
on the web, we have many ways and polyfills to get around issues.</li>
<li>Web Apps should have support from the browser for single sign on &#8211; is
this WebID (was BrowserID), etc?</li>
<li>Developers need to contribute to &#8220;moving the web forward&#8221; &#8211; speak to
the browser vendors. But isn&#8217;t part of the problem &#8220;Fucking Apple&#8221;,
they don&#8217;t talk to anyone &#8211; nor do they release at any reasonable rate
so developers</li>
<li>Think about how web vs. native &#8211; web should remember your log in,
application state &#8211; it shouldn&#8217;t appear to boot from scratch each
time, but this is where we should be using localStorage, and back
doesn&#8217;t destroy state!!! Ajax + history api.</li>
</ul>

<h3 id="questions-heading">Questions</h3>

<ul>
<li>Is the point: browsers don&#8217;t matter &#8211; the web does&#8230;?</li>
<li>Should the browser just be the <code>webview</code>?</li>
<li>&#8220;You&#8217;re not on a fucking plane&#8221; &#8211; but then do all devs know how to
build apps like gmail where it&#8217;s insanely quick because they know how
to work the mobile device?</li>
<li>AppCache is not a replicatement for localStorage &#8211; far from it.</li>
<li>Is there a larger problem that the browser (and a pro) exposes data if
the user wants to get to it. It makes SSO harder because of security,
etc?</li>
<li>Web vs. Native seems like two issues: browser and the web. Browsers
being the limitation.</li>
</ul>

<h2 id="noAppIsAnIslandPaulKinlanhttptwittercompaulKinlan-heading">No app is an island &#8211; <a href="http://twitter.com/paul_kinlan">@paul_kinlan</a></h2>

<p>Overview of some technology in browsers &#8211; &#8220;we&#8217;re moving faster than ever
before&#8221;.</p>

<ul>
<li>CSS regions &#8211; makes print designers super happy &#8211; in that the reflow
is correct.</li>
<li>CSS filters &#8211; take that Instagram &#8211; using same technology as WebGL
under the hood?</li>
<li>Web Components &#8211; shadow DOM is the &#8220;component code&#8221;. Web Components do
look really interesting because we&#8217;ve been re-writing components all
the flipping time, but it seems to boil down to </li>
<li>WebRTC &#8211; gives us the stream (though gUM is part of it), allows us to
use a <em>stream</em> of video data (though god knows what format it&#8217;s in if
we wanted to capture it&#8230;).</li>
<li>And a fuck load more APIs: Gamepad API, battery, pointer lock, etc.</li>
</ul>

<p>To the point: &#8220;tunnels and bridges&#8221;&#8230;All tunnel creation is bespoke
(IRL), in that working across the web with things like oAuth is hard,
and could well go horribly wrong.</p>

<p>Bridges are different: common patterns are part of the process.</p>

<p>Future of web app dev &#8211; is &#8220;client to client&#8221; &#8211; &#8220;bridging&#8221;.</p>

<h3 id="intents-heading">Intents</h3>

<ul>
<li>No oAuth &#8211; because you&#8217;re handing over?</li>
<li>Integrating the &#8220;top 5&#8243; APIs is hard, because a) they&#8217;re all fucking
different, and b) what about when they shutdown (delicious), c) what
about when you don&#8217;t integrate the <em>users&#8217; favourite service</em>?</li>
<li>Intents offers your list of services for the intent, user selects the
service, and the service then returns the content in an open way -
without the developer having to support all these services.</li>
<li>Intent lets me send and receive => communication.</li>
<li>Proposing an <code>&lt;intent&gt;</code> tag</li>
<li>The content-type on the params determine the response kind, example: <code>var params = { type: 'video/mp4', data: blob, transfer: [blob] };</code></li>
<li>You can also establish communication channels (like P2P?) using
<code>Channel</code> API and using ports.</li>
<li>Can play today, Paul has written a polyfill with decent x-browser
support (IE8 upwards).</li>
</ul>

<h3 id="questions-heading">Questions</h3>

<ul>
<li>What about defaults? Chicken and egg &#8211; the user is new, do you offer
default services? Is this even a problem?</li>
<li>How do services register their action handlers?</li>
<li>Really not keen on the <code>action="http://webintents.org/share"</code> &#8211; why
the dependency?</li>
<li>Doesn&#8217;t the <code>startActivity</code>/<code>postResponse</code> assume a persistent page or
new tab or even background services? // No &#8211; it appears as just a popup, whilst my current page remains open.</li>
<li>Are other browsers implementing Intents? Equally is Google starting to
introduce it in their own apps, Google Drive for instance.</li>
</ul>

<h2 id="theWebAsItShouldBeThebeebshttptwittercomthebeebs-heading">The web as it should be &#8211; <a href="http://twitter.com/thebeebs">@thebeebs</a></h2>

<ul>
<li>Text Shadows weren&#8217;t fast enough for IE9 &#8211; the GPU was used for fonts,
but the shadows were poorly performing (and equally on canvas &#8211; super
poor performance even though it&#8217;s all hw accel).</li>
<li>First half of talk: IE sucks &#8211; yep &#8211; MS know it. IE9 is supposed to be
the new flagship. Honestly, still lacking, but IE10 is a good second
step.</li>
<li>8 week launch cycles with previews. 12 weeks with IE10.</li>
<li>Now collaborating (not more, but for a change).</li>
<li>IE10 moving to &#8220;smallest chrome&#8221; &#8211; what about &#8220;Chromeless&#8221;?</li>
<li>Ironically IE10 is touch, yet IE9 isn&#8217;t!!!</li>
<li>Working on and contributing the CSS grid specification &#8211; combination
of row/column. Are other browsers picking this up?</li>
<li>IE10 is the delivery platform &#8211; within the browser and via the Metro
application platform.</li>
<li>IE10 appcache, data storage, etc. Basically where it should be.</li>
<li><a href="http://thebeebs.co.uk/prepare">http://thebeebs.co.uk/prepare</a> &#8211; compatibility indicator via a script
include on your site &#8211; for debugging &#8211; things like userAgent sniffing,
etc.</li>
</ul>

<h3 id="questions-heading">Questions</h3>

<ul>
<li>When is IE10 going to be available on mobile?</li>
<li>Once beyond the beta cycles, and in production ready, what about
updates beyond that time? Do we have to wait another year?</li>
<li>Is win.js implementing the standards &#8211; like File IO &#8211; is that going to
use the standards, rather than the old school WSH type API &#8211; that&#8217;s
utterly bespoke to Windows?  The advantage of PhoneGap is that it
relies on a standard, so ultimately, one day in the future, you can
pull PhoneGap out and it should work. Can I pull out win.js and move
to another platform?</li>
<li>Touch &#8211; is this the standards based touch events?</li>
<li>Debugging tools?</li>
<li>Is IE10 the high street brand to the fashion industry? In that by the
time IE10 comes out, Opera, FF and Chrome will be 12 months ahead. I
guess this isn&#8217;t a problem &#8211; if IE supports &#8220;HTML5&#8243; it means it&#8217;s
serious business &#8211; I guess good for general web sites.</li>
<li>Seriously &#8211; why can&#8217;t I install IE10 on my Mac directly? Or Linux?
Sure, Apple don&#8217;t port Safari to Linux, and the Windows port is pretty
horrible, but they&#8217;re arseholes anyway. // Response: No, they&#8217;re
developing for their platform &#8211; to be fair &#8211; Apple to do the same.</li>
</ul>

<h2 id="brokenHtml5PromisesAreWeAppyCodepo8httptwittercomcodepo8-heading">Broken HTML5 promises &#8211; are we &#8216;appy? &#8211; <a href="http://twitter.com/codepo8">@codepo8</a></h2>

<ul>
<li>Apple is crippling the mobile browser. True, examples include WebGL,
storage, audio, etc, etc, etc.</li>
<li>Christian is asked at Mobile Congress is mostly around how do I protect
my code, how does it compare to HTML5 &#8211; UX &amp; performance.</li>
<li>HTML5 has to be a marketing term &#8211; so it won&#8217;t ever be ready because
it encompasses a mass of technology ranging from true HTML5 to CSS to
Node.js!</li>
<li>Tooling is lacking. Dreamweaver type tools, but all the way to Final
Cut type tools &#8211; i.e. to compose amazing interactive sites. Current
offerings: <a href="http://html.adobe.com">html.adobe.com</a> and Sencha Architech&#8230;</li>
<li>Christian successfully takes the piss out of @thebeebs and @mahemoff,
who&#8217;s next?</li>
<li>DRM is important to real companies. They have to protect their
content.</li>
<li>What about &#8220;native&#8221; performance? Zenga released a scroller library -
and discussion said it works better if it was written for iOS only.
Turned out that it was just the form value feedback that was slowing
it down. (canvas scroller).</li>
<li>Re: HTML5 is ready &#8211; did we pull it off? No, there&#8217;s more questions
than answers right now. Those answers are hard (but isn&#8217;t a lot of
this for the browsers to answer for us as developers?).</li>
<li>Christian says we&#8217;re just keeping ourself busy with other things -
like demoscene or abstractions or random arguments like the
semi-colons (2nd reference &#8211; end on 3 pokes!). Why is Google and MS
releasing demos the canvas demos, etc. (Surely they&#8217;re appealing to
developers to get them on board).</li>
<li>Talking about browsers stats. Me: honestly, these global stats don&#8217;t
matter, the client user stats matter.</li>
<li>Patents: even when we can simulate or re-create the effects but
patents are killing innovation.</li>
</ul>

<p>But &#8220;enough with the bitching&#8221;. Amen.</p>

<ul>
<li>Mozilla is a fully open organisation.</li>
<li>&#8220;Kick ass&#8221; devtools. I hope he&#8217;s not referring to Firebug because I
really don&#8217;t agree &#8211; the new devtools are a great step forward, but
still way behind.</li>
<li>MDN being supported not just by Mozilla &#8211; by people like Paul Irish
from <em>other</em> browser vendors. An excellent web resource for teaching.</li>
<li>More teaching from Mozilla and free access: mozparty, hack arcade,
hackasourus, etc.</li>
<li><a href="https://github.com/gladiusjs/gladius-core">Gladius</a> &#8211; open source (on github) Mozilla supported game platform
(that won&#8217;t be bought by another company and open!).</li>
<li>C++ to JS conversion with <a href="https://github.com/kripken/emscripten">Emscripten</a> (WTF!?)</li>
<li>Are we mobile yet &#8211; a visualisation of current state of mobile
support, with direct links to the bugs &#8211; so go shake a stick to get
them fixed.</li>
<li>Contributing lots of new specifications: battery, camera, vibration,
SMS sending &#8211; and all baked in to Boot 2 Gecko.</li>
<li>Christian demos a B2G which appears fast. My own copy is slow, but I
suspect the hardware is a huge factor.</li>
<li><a href="http://b2gbuilds.org">b2gbuilds.org</a> for getting nightly builds. Nexus S, Galaxy SII and
Galaxy Nexus flash image &#8220;coming soon&#8221;.</li>
<li>Lots of events being run in Mozilla&#8217;s open space &#8211; also open for drop
in working.</li>
<li>Wants people to make things that work.</li>
</ul>

<h3 id="questions-heading">Questions</h3>

<ul>
<li>Why is UX coming up? Surely the OS should provide the UX for these
elements, buttons, etc. </li>
</ul>


<p>Related posts:<ol><li><a href='http://remysharp.com/2008/02/12/jquery-api-browser/' rel='bookmark' title='Permanent Link: jQuery API Browser'>jQuery API Browser</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=azrHFbuH56Q:ncvZGGMRKJI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=azrHFbuH56Q:ncvZGGMRKJI:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/azrHFbuH56Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/04/28/notes-from-state-of-the-browser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/04/28/notes-from-state-of-the-browser/</feedburner:origLink></item>
		<item>
		<title>Mobile Battery Performance</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/1NReSMgtt28/</link>
		<comments>http://remysharp.com/2012/04/25/mobile-battery-performance/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 13:00:51 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=1015</guid>
		<description><![CDATA[I was working late adding some finishing touches to a mobile workshop I would be giving at the BBC the next morning when I run a twitter search looking for &#8220;bbc mobile&#8221; &#8211; and it turns up this article on the BBC about poorly designed mobile sites &#8216;drain smartphone battery&#8217; &#8211; how pertinent! I read [...]


Related posts:<ol><li><a href='http://remysharp.com/2007/04/20/performance-profiling-javascript/' rel='bookmark' title='Permanent Link: Performance profiling JavaScript'>Performance profiling JavaScript</a></li><li><a href='http://remysharp.com/2013/05/16/my-workflow-v2-mobile-devtools-livereload/' rel='bookmark' title='Permanent Link: My Workflow v2: Mobile, DevTools &#038; LiveReload'>My Workflow v2: Mobile, DevTools &#038; LiveReload</a></li><li><a href='http://remysharp.com/2007/12/16/t-mobile-allow-free-wifi-google-maps/' rel='bookmark' title='Permanent Link: T-Mobile allow free Wifi Google Maps'>T-Mobile allow free Wifi Google Maps</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>I was working late adding some finishing touches to a mobile workshop I would be giving at the BBC the next morning when I run a twitter search looking for &#8220;bbc mobile&#8221; &#8211; and it turns up this article <em>on</em> the BBC about <a href="http://www.bbc.co.uk/news/technology-17811557">poorly designed mobile sites &#8216;drain smartphone battery&#8217;</a> &#8211; how pertinent!</p>

<p>I read through, and here&#8217;s my take and criticism.</p>

<p><span id="more-1015"></span></p>

<p>The reporting on the BBC site is excellent, or excellent to me because it&#8217;s a digested form of the <a href="http://www2012.wwwconference.org/proceedings/proceedings/p41.pdf">original report</a> and begins with this quote:</p>

<blockquote>
  <p>We hope this paper demonstrates the importance of building a mobile site optimised for mobile devices.</p>
</blockquote>

<p>&#8220;Perfect!&#8221; &#8211; I exclaim to myself. But go ahead and try reading the report. It may be clear to a hardened engineer, but I&#8217;m be prepared to be 9 out of 10&dagger; <em>web workers</em> (web developers and designers all under one cosy roof) would a) not follow the report, and b) likely not make it to the end of the report. It&#8217;s not written for them &#8211; or rather it&#8217;s undigested.</p>

<p><small>&dagger; I&#8217;d actually wager more than 9/10ths, but it&#8217;s a catchier term!</small></p>

<p>The BBC article does pick up on two messages, one that&#8217;s a pretty nice take away (and frankly, I managed to glean this from the article too):</p>

<blockquote>
  <p>&#8230;using the .jpeg image format instead of other file types like .gif and .png</p>
</blockquote>

<p>This appeared to save on battery. If only we had the flipping <a href="http://www.w3.org/TR/netinfo-api/">connection type API</a> in more browsers we could use media queries to fix this elegantly.</p>

<p>What&#8217;s interesting is (unsurprisingly) Gmail comes up trumps on performance (in the non-eating battery performance metric) but what&#8217;s more interesting is the reasons &#8220;why&#8221;. The paper claims:</p>

<blockquote>
  <p>Gmail, the most &#8220;green&#8221; mobile site we found, uses HTML links to open email messages that the user clicks on. [...] Our experiments suggest that using links instead of Javascript greatly reduces the rendering energy for the page. Thus, by designing the mobile version of the site differently than its desktop version, Gmail was able to save energy on the phone.</p>
</blockquote>

<p>This is <em>really</em> interesting to me because I&#8217;ve spent some time picking apart how Gmail works (and I&#8217;m far from done), but I was <em>pretty damn sure</em> that JavaScript features fairly heavily, <strong>including</strong> clicking email messages. So I fired up my Android, opened Chrome, opened the remote debugging port and sniffed around the DOM (as usual) and here&#8217;s what a message (that you tap/click/whatever) looks like:</p>

<p><img alt="Gmail messages in Chrome for Android" src="http://remysharp.com/images/gmail-messages.gif" style="max-width: 100%"></p>

<p>The first highlighted <code>onclick</code> is to <em>star</em> the email, the second for selecting it for some group action, and the third, yes, that <code>div</code> element, that has a click handler on it to open the message. Not &#8220;using HTML links to open email messages&#8221;. Just to drum the point home &#8211; do you notice even <em>one single</em> HTML (anchor) link in there?</p>

<p>I think perhaps what Gmail <em>are</em> doing to save on battery is deferring the bulk of the JavaScript using the <a href="http://googlecode.blogspot.co.uk/2009/09/gmail-for-mobile-html5-series-reducing.html">evil eval technique</a> where they&#8217;re deploying script modules in commented out code, and eval&#8217;ing it in to execution on demand, both reducing the initial JavaScript parsing, but also negates the need for extra (expensive) HTTP requests for JavaScript modules. Something I suspect, based on this paper, Wikipedia could do with looking at (since it has the highest JavaScript execution time, yet it&#8217;s the most content-ty web site I know of!).</p>

<h2 id="notToBeIgnored-heading">Not to be ignored</h2>

<p>The BBC article does conclude with:</p>

<blockquote>
  <p>The research is to be presented at the World Wide Web 2012 conference in Lyon this week.</p>
</blockquote>

<p>I wonder if/hope there&#8217;ll be videos of these talks, as the paper in it&#8217;s current state is likely to be overlooked by a lot of our peers (understandably) but it does have an important message as smartphones become more capable (with JavaScript APIs like WebGL and the like): with great power comes great responsibility.</p>

<p>&#8230;technically, if the phone had great power, I guess the responsibility would go out the window because then you could go wild, but you get my gist &#8211; be wary this isn&#8217;t a constantly powered device like a desktop computer. Most of us know how crap mobile phone batteries can be.</p>

<p>I&#8217;m just looking forward to web friendly interpretation of these and future results.</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2007/04/20/performance-profiling-javascript/' rel='bookmark' title='Permanent Link: Performance profiling JavaScript'>Performance profiling JavaScript</a></li><li><a href='http://remysharp.com/2013/05/16/my-workflow-v2-mobile-devtools-livereload/' rel='bookmark' title='Permanent Link: My Workflow v2: Mobile, DevTools &#038; LiveReload'>My Workflow v2: Mobile, DevTools &#038; LiveReload</a></li><li><a href='http://remysharp.com/2007/12/16/t-mobile-allow-free-wifi-google-maps/' rel='bookmark' title='Permanent Link: T-Mobile allow free Wifi Google Maps'>T-Mobile allow free Wifi Google Maps</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=1NReSMgtt28:KiPVjIj-nHM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=1NReSMgtt28:KiPVjIj-nHM:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/1NReSMgtt28" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/04/25/mobile-battery-performance/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/04/25/mobile-battery-performance/</feedburner:origLink></item>
		<item>
		<title>Training and events</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/3CG3xxDgHu4/</link>
		<comments>http://remysharp.com/2012/04/16/training-and-events/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 10:14:16 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Business]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=994</guid>
		<description><![CDATA[There&#8217;s a number of upcoming events I wanted to blog about, partly to lend a hand to their promotion, and partly to tell you what I&#8217;m up to. Workshops Workshops over the last 12 months have really increased for me &#8211; both in public workshops (often via events) and private company workshops. I&#8217;ve now finally [...]


Related posts:<ol><li><a href='http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/' rel='bookmark' title='Permanent Link: Full Frontal 2012 launches soon!'>Full Frontal 2012 launches soon!</a></li><li><a href='http://remysharp.com/2011/04/27/my-big-workshop-tour/' rel='bookmark' title='Permanent Link: My Big Workshop Tour'>My Big Workshop Tour</a></li><li><a href='http://remysharp.com/2008/06/18/feed-of-events-via-microformats/' rel='bookmark' title='Permanent Link: Feed of Events via Microformats'>Feed of Events via Microformats</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s a number of upcoming events I wanted to blog about, partly to lend a hand to their promotion, and partly to tell you what I&#8217;m up to.</p>

<p><span id="more-994"></span></p>

<h2 id="workshops-heading">Workshops</h2>

<p>Workshops over the last 12 months have really increased for me &#8211; both in public workshops (often via events) and private company workshops. I&#8217;ve now finally got so much HTML5 content that companies can now create a &#8220;pick and mix&#8221; HTML5 workshop spanning over anything from 1 to 4 days.</p>

<p>I&#8217;m up in Manchester next week doing private workshops for the BBC on mobile web dev. Possibly <a href="https://twitter.com/#!/sparrk/status/156437912546836481">my favourite quote</a> from the last time I ran this event was from James O&#8217;Brien aka @sparrk:</p>

<blockquote>
  <p>Remy&#8217;s HTML5 for mobile workshop showed me how to do at least three things I&#8217;d previously thought were impossible.</p>
</blockquote>

<p>There&#8217;s a few public workshops you can attend, starting with:</p>

<ul>
<li><a href="http://mobilism.nl/2012/workshops#mobile-web-apps">Mobile HTML5 Web Apps</a> &#8211; Amsterdam <a href="https://mobilism.paydro.net/">&euro;350</a></li>
<li><a href="http://developerfocus.com/kurskalender.aspx?lang=no1&amp;cat=170376">3 workshops: HTML5, Mobile and Node</a> &#8211; you&#8217;ll have to pick me out in the table, based in London though</li>
</ul>

<p>I&#8217;ll also be releasing a new workshop for Full Frontal &#8211; so <a href="http://twitter.com/fullfrontalconf">keep an eye out</a> for that :)</p>

<h2 id="talks-heading">Talks</h2>

<ul>
<li><a href="http://sourcedevcon.eu/">SourceDevCon</a> &#8211; talking about using Node to go real-time (with a healthy dash of HTML5)</li>
<li><a href="http://mobilism.nl/2012">Mobilism</a> &#8211; on debugging mobile devices and the pain and some technique (also <a href="https://mobilism.paydro.net/event/amobilism-2012/RemySharp">10% discount off regular ticket price</a> (whilst stocks last!))</li>
<li><a href="http://futureofwebdesign.com/london-2012/">Future of Web Design</a> &#8211; on how developers and designers can work better together (or at least from my perspective!)</li>
<li><a href="http://www.reasonstobeappy.com/">Reasons to be &#8220;Appy&#8221;</a> &#8211; mobile debugging again &#8211; this time in London (a small conference with only 250 places)</li>
<li><a href="http://www.ndcoslo.com/">NDC 2012</a> &#8211; on the lesser known (or used) technologies in and around HTML5 that I think should be worthy of your attention</li>
<li><a href="http://2012.fromthefront.it/">From the Front</a> &#8211; the same HTML5 talk, but this time in Italy (early bird tickets still on sale until end of April)</li>
</ul>

<p>I&#8217;m sure more talks will turn crop up and there&#8217;s a talk in me that I want to give about what I&#8217;ve learnt in developing JSBin over the last 4 years.</p>

<h2 id="ifYouWantMeToTalk-heading">If you want me to talk&#8230;</h2>

<p>Do <a href="http://leftlogic.com/contact">get in touch</a> (via my company site) if you&#8217;ve got an event and want to hear one of these talks, or equally if you company would like some in-house training.</p>

<p>Otherwise, I look forward to seeing and meeting some of you at the upcoming events!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2012/06/18/full-frontal-2012-launches-soon/' rel='bookmark' title='Permanent Link: Full Frontal 2012 launches soon!'>Full Frontal 2012 launches soon!</a></li><li><a href='http://remysharp.com/2011/04/27/my-big-workshop-tour/' rel='bookmark' title='Permanent Link: My Big Workshop Tour'>My Big Workshop Tour</a></li><li><a href='http://remysharp.com/2008/06/18/feed-of-events-via-microformats/' rel='bookmark' title='Permanent Link: Feed of Events via Microformats'>Feed of Events via Microformats</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=3CG3xxDgHu4:0qffY3MgYfw:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=3CG3xxDgHu4:0qffY3MgYfw:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/3CG3xxDgHu4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/04/16/training-and-events/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/04/16/training-and-events/</feedburner:origLink></item>
		<item>
		<title>The TL;DR vendor-prefix post</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/0wuJqUdhQnM/</link>
		<comments>http://remysharp.com/2012/02/10/the-tldr-vendor-prefix-post/#comments</comments>
		<pubDate>Fri, 10 Feb 2012 13:18:33 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=972</guid>
		<description><![CDATA[With my post yesterday I appreciate it might be a bit long and perhaps focused mostly on my take on the meeting minutes. I wanted to be super clear about what I think about the situation, what will happen and what we can do &#8211; in super easy bullet form. Browser vendors for Firefox, Opera [...]


Related posts:<ol><li><a href='http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/' rel='bookmark' title='Permanent Link: Vendor Prefixes &#8211; about to go south'>Vendor Prefixes &#8211; about to go south</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>With my <a href="http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/">post yesterday</a> I appreciate it might be a bit long and perhaps focused mostly on my take on the meeting minutes. I wanted to be super clear about what I think about the situation, what will happen and what we can do &#8211; in super easy bullet form.</p>

<p><span id="more-972"></span></p>

<ol>
<li>Browser vendors for Firefox, Opera and IE will eventually implement <code>-webkit-</code> prefixes (a subset). Sad, but true. It&#8217;s an amazingly bad idea, and I&#8217;d love to be wrong, but browsers are like bulldozers, they&#8217;ll go where they want and more importantly: need to go.</li>
<li>Vendor prefixes are a good thing. Or rather <strong>experimental</strong> prefixes are a good thing. They allow developers to test and feed back to vendors.</li>
<li>Vendor prefixes <em>should</em> be dropped from production level browsers and only made available in beta browser versions.</li>
<li>Point above will not happen (or at least in the short term). Google and Apple have said as much. This was the same reasons Microsoft gave: they didn&#8217;t want to break the web. Microsoft did eventually drop propitiatory tech like CSS filters (well, it vendor-prefixed it, but the effect non-prefixed is &#8220;broken&#8221; in IE9), so maybe in the future this <em>may</em> happen.</li>
<li>Maybe the middle ground is we draw a line in the sand, and say: All current prefixes will remain as they are (WRT production browsers). All <strong>new</strong> experimental properties will have a finite lifetime, and <em>not</em> make it to production.</li>
<li>Yep, the working group should move faster to retire beta technology (<em>if it works</em>), but this hasn&#8217;t happened any time soon (see the irony?!).</li>
<li>Do not go duplicating <em>every</em> <code>-webkit-</code> prefix you find: they&#8217;re not all supported, nor are all the values always the same. Use your head, obviously! This needs to be done on a case-by-case basis. ie. Add <code>-moz-</code> et al for <code>-webkit-border-radius</code> but when you encounter linear gradients the syntax is different.</li>
<li>Do check your code against tools like <a href="http://csslint.net">csslint</a> &#8211; it will tell you which vendor-prefixes can be reused today. I&#8217;m close to having a tool ready that will automatically fix these for you &#8211; but to be clear: this will only stem the flow of the wound, and doesn&#8217;t fix it ultimately for the future.</li>
<li>Should all browsers use the WebKit render engine? Hell no. WebKit would continue to innovate until it was finished, then we&#8217;d have that really long quiet period that Microsoft demonstrated with IE6, where expectations move on but browsers don&#8217;t. No, this a stupid suggestion.</li>
<li>Don&#8217;t stop evangelising. It&#8217;s a slow slog and is never a completed job.</li>
</ol>


<p>Related posts:<ol><li><a href='http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/' rel='bookmark' title='Permanent Link: Vendor Prefixes &#8211; about to go south'>Vendor Prefixes &#8211; about to go south</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=0wuJqUdhQnM:teSqFz6PDC4:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=0wuJqUdhQnM:teSqFz6PDC4:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/0wuJqUdhQnM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/02/10/the-tldr-vendor-prefix-post/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/02/10/the-tldr-vendor-prefix-post/</feedburner:origLink></item>
		<item>
		<title>Vendor Prefixes – about to go south</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/jqJ-UmRsryA/</link>
		<comments>http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 11:00:38 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=952</guid>
		<description><![CDATA[We do like vendor prefixes. They give us access to bleeding edge CSS properties, and make our sites look cool. But there&#8217;s a serious problem: non-webkit vendors are giving serious consideration to implementing the -webkit prefix to a number of CSS properties. This is bat shit crazy, but where the web has arrived to. This [...]


Related posts:<ol><li><a href='http://remysharp.com/2012/02/10/the-tldr-vendor-prefix-post/' rel='bookmark' title='Permanent Link: The TL;DR vendor-prefix post'>The TL;DR vendor-prefix post</a></li><li><a href='http://remysharp.com/2011/04/19/broken-offline-support/' rel='bookmark' title='Permanent Link: Broken Offline Support'>Broken Offline Support</a></li><li><a href='http://remysharp.com/2008/03/18/safari-31-web-developer-functionality/' rel='bookmark' title='Permanent Link: Safari 3.1 web developer functionality'>Safari 3.1 web developer functionality</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>We do like vendor prefixes. They give us access to bleeding edge CSS properties, and make our sites look cool. But there&#8217;s a serious problem: non-webkit vendors are giving serious consideration to implementing the <code>-webkit</code> prefix to a number of CSS properties.</p>

<p>This is bat shit crazy, but where the web has arrived to. This is one developer&#8217;s opinion, but you <strong>need</strong> to voice your opinion now, and if you&#8217;re in agreement that this is madness, you need to <strong>act now</strong>. Make your voice heard, blog about it, tweet about it: <em>make a lot of noise</em>.
<span id="more-952"></span></p>

<div class="update"><p><strong>Keep updated</strong> A week after the meeting more people have contributed to the discussion, a few of the important ones (I felt) I have <a href="#updates">listed here</a> &#8211; please do also read them as they&#8217;re a good follow up to the vendor-prefix kerfuffle.</p><small>Updated February 16, 2012</small></div>

<h2>How is this a problem?</h2>

<p>The CSS working group <a href="http://lists.w3.org/Archives/Public/www-style/2012Feb/0313.html">met very recently and openly talked</a> about whether they should implement `-webkit` <del>as part of the CSS specification</del><ins> in Firefox</ins>.  This means other browser such as Opera and Internet Explorer could and would also implement these prefixes which would result in <em>your site working</em>&trade; in their browser.</p>

<div class="update old"><p><strong>Clarification update (via <a href="http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/#comment-370255">Peter Linss&#8217; comments</a></strong>: this was <strong>not</strong> a meeting to propose adding <code>-webkit-</code> prefixes to the <em>specifications</em>, it was a meeting called by Firefox to seek consent 
for adding <code>-webkit-</code> prefixes. The bottom line that Linss has laid down is:

<blockquote><p>Having a vendor prefix in a specification will simply not happen, ever.</p></blockquote>

<small>Updated February 11, 2012</small>
</div>

<p><a href="http://twitter.com/t">Tantek</a> led the conversation with:</p>

<blockquote>
  <p>tantek: At this point we&#8217;re trying to figure out which and how many webkit prefix properties to actually implement support for in Mozilla<br /><br />
  plinss: Zero.<br /><br />
  tantek: Currently we have zero. Zero is no longer an option for us.</p>
</blockquote>

<p>The fear the browsers have, understandably, is that developers are coding for webkit prefixes in their CSS because they&#8217;re only targetting webkit based browsers.</p>

<p>Now that <code>-webkit</code> prefixes are so prolific in the wild (not my statement, but as suggested from the meeting minute notes), it seems the approach most want in the CSS working group is to simply implement the non-standard feature in to their specification. An oversimplification, but worryingly true.</p>

<p>There is some voice of sanity, namely in <a href="https://twitter.com/#!/glazou">Daniel Glazman / glazou</a> and Peter Linss.</p>

<p>You have to still appreciate the politics of the problem:</p>

<blockquote>
  <p>tantek: What are the thresholds, even approximate, for implementing -webkit- properites (or none)?<br /><br />
  glazou: Unbelieveable we are having this discussion.<br /><br />
  Florian: Our job is to solve interoperability. We want to discuss it here, because that&#8217;s our job.<br /><br />
  tantek: Help us minimize the damage.</p>
</blockquote>

<p>They&#8217;re trying to get interoperability: a good thing. But implementing other vendor prefixes in a browser is <em>not</em> the way to go about it. </p>

<h2 id="onMinimisingTheDamage-heading">On minimising the damage</h2>

<p>Minimising the impact of this change is a misnomer. This is pandora&#8217;s box, no matter how you look at it.  Once you add a single <code>-webkit</code> vendor prefix the expectation of the developer changes.  If you can use a <code>-webkit</code> prefix in Firefox for gradients or transforms (for example), why can&#8217;t I use it for other things like CSS masks. And then other things.</p>

<p>If developers are lazy today (and we are &#8211; it&#8217;s what makes us fast and good), by adding <code>-webkit</code> prefixes to other browsers it&#8217;ll allow us to be even lazier, and by adding <code>-webkit</code> to the spec, the CSS working group will have set the precedence that we can, as developers, put any prefixes property in the other browsers.</p>

<p>At which point: webkit won the browser game and all other browsers should retire.</p>

<p>The only sensible step after implementing WebKit&#8217;s experimental properties is to simply adopt the entire render engine. A silly analogy, but you can see how you could get there.</p>

<p>The working groups are there to give us specs on how to do things the <em>right way</em>:</p>

<blockquote>
  <p>glazou: I don&#8217;t think this is the right way. And this is the first time in this WG that we are proposing to do things that are not the right way.</p>
</blockquote>

<h2 id="andThenItsAffectOnJavascript-heading">And then its affect on JavaScript</h2>

<p>What concerns me even more is this:</p>

<blockquote>
  <p>glazou: I think it&#8217;s very unfortunate timing, esp. now that we&#8217;re trying to use prefixes for JS APIs.</p>
</blockquote>

<p>We&#8217;re already starting to see things like <code>MozWebSocket</code> and the like. The only saving grace we have is adopting <a href="http://remysharp.com/what-is-a-polyfill/">polyfill</a> techniques &#8211; but ensuring we code against the <em>right</em> specification, and not vendor prefixed APIs. </p>

<p>I <em>may</em> be wrong, but I feel like the evangelism is strong in this area, and developers are keen to avoid prefixes &#8211; and there&#8217;s enough libraries that takes this problem away from devs.</p>

<p>CSS hasn&#8217;t been so lucky. </p>

<h2 id="whosGuilty-heading">Who&#8217;s guilty?</h2>

<p>Apple and Chrome: They&#8217;re supporting vendor prefixed properties like they&#8217;re a standard part of development.</p>

<p>Firefox, Opera and Internet Explorer: They should have been on the ball more. Need to push their evangelism further. Teach developers that it&#8217;s not exclusively <code>-webkit</code> to style elements. </p>

<p>All the browsers: <em>experimental</em> suggests that it will either be discarded or implemented fully at some point. It&#8217;s both not clear what&#8217;s a real specification be experimentally supported, nor when those experimental prefixes will be dropped.</p>

<p>The working group: for not getting these properties to standards quickly enough. The web moves quickly, and as much as a I appreciate that the standards will not move <em>as</em> quickly, they&#8217;re still taking way too long.</p>

<p>Evangelists: We&#8217;re too eager to show off experimental effects. They&#8217;re cool, right? But it&#8217;s cost us, and we should <em>always</em> used vendor prefixes as a backup, not as the final thing.</p>

<p>Developers: We know better. We know/hope that eventually these prefixes will be dropped, but we&#8217;re propagating this problem.</p>

<p>You and me: I&#8217;m just as guilty as everyone else in using WebKit only prefixes.</p>

<h2 id="howIveBeenGuiltyAndWhy-heading">How I&#8217;ve been guilty and why</h2>

<ol>
<li>I don&#8217;t know which browsers support which prefixes or values for that matter. Firefox never seemed to have interoperability with CSS gradients or transforms which made it hard to know what would work.</li>
<li>I honestly can&#8217;t tell what&#8217;s a real property from the CSS specs compared to something made up by the vendor (from what I can tell <code>webkit-text-size-adjust</code> is one of those examples)</li>
<li>I have absolutely no clue when the prefix will be dropped. Firefox held on to the <code>-moz-opacity</code> for a looooonnng time. This is my expectation for the other prefixed properties I use today.</li>
</ol>

<h2 id="whatCanWeDoInstead-heading">What can we do instead?</h2>

<p><em>This</em> is the question that they group should be asking. </p>

<p>There&#8217;s things we can do as developers and evangelists, and there&#8217;s things the browsers <em>must</em> do.</p>

<p>As developers we need to better educate. It worked with moving to standards away from spaghetti code back in the height of XHTML-esque coding, it can work again. </p>

<p>We need tools to make it easier not to propagate this problem.  Tools like <a href="http://csslint.net/">csslint</a> and <a href="http://leaverou.github.com/prefixfree/">-prefix-free</a> are a start. I&#8217;m about to embark on a tool that will plug all the missing vendor prefixes too (not a JS solution like Lea&#8217;s tool, but a standalone service &#8211; <a href="https://twitter.com/intent/tweet?source=webclient&amp;text=%40rem+I+can+help+with+that+CSS+tool+you%27re+building">help me if you can/want</a>).</p>

<p>Browsers need to:</p>

<ol>
<li>Non-production ready browsers should support experimental prefixes, <em>production ready releases</em> <strong>should not</strong>. If it&#8217;s Chrome 16 &#8211; the stable version &#8211; experimental support should not be baked in. The properties should be full available <em>without</em> the prefix.</li>
<li>Drop experimental prefixes &#8211; not entirely, but after a finite amount of time. It&#8217;s unacceptable and a disservice to the developers working with your browser. You need to give timelines to dropping these things.</li>
<li>Work with the working groups (&#8230;Apple).</li>
</ol>

<p>And more. Blog about it. Tweet about it. Make some noise. If this happens, the working group will have failed. I&#8217;ll leave you with this:</p>

<blockquote>
  <p>plinss: If we go down this path we have broken standardization.</p>
</blockquote>

<h2 id="updates">Updates and further reading</h2>

<ul>
<li><a href="http://folktrash.com/css-vendor-prefixes/">Nate Vaughn / @folktrash on vendor prefixes &#8211; a good round up</a></li>
<li><a href="http://www.quirksmode.org/blog/archives/2012/02/the_vendor_pref.html">PPK&#8217;s take &#8211; though I don&#8217;t entirely agree with all his points, still important reading</a></li>
<li><a href="http://www.brucelawson.co.uk/2012/on-the-vendor-prefixes-problem/">Fellow author, Bruce Lawson</a></li>
<li><a href="http://www.alistapart.com/articles/the-vendor-prefix-predicament-alas-eric-meyer-interviews-tantek-celik/">Follow up interview with Tantek by Eric Meyer </a></li>
<li><a href="http://infrequently.org/2012/02/misdirection/">The Might Alex Russell&#8217;s step back, take it all in, uber post</a></li>
</ul>


<p>Related posts:<ol><li><a href='http://remysharp.com/2012/02/10/the-tldr-vendor-prefix-post/' rel='bookmark' title='Permanent Link: The TL;DR vendor-prefix post'>The TL;DR vendor-prefix post</a></li><li><a href='http://remysharp.com/2011/04/19/broken-offline-support/' rel='bookmark' title='Permanent Link: Broken Offline Support'>Broken Offline Support</a></li><li><a href='http://remysharp.com/2008/03/18/safari-31-web-developer-functionality/' rel='bookmark' title='Permanent Link: Safari 3.1 web developer functionality'>Safari 3.1 web developer functionality</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=jqJ-UmRsryA:duAzQYkt2dg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=jqJ-UmRsryA:duAzQYkt2dg:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/jqJ-UmRsryA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2012/02/09/vendor-prefixes-about-to-go-south/</feedburner:origLink></item>
		<item>
		<title>My 2011</title>
		<link>http://feedproxy.google.com/~r/remysharp/~3/MqDrNcUBwJY/</link>
		<comments>http://remysharp.com/2011/12/31/my-2011/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 17:13:47 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[newyear]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=930</guid>
		<description><![CDATA[It&#8217;s now a bit of a tradition with a year end blog post (almost entirely so I can look back and actually remember myself!), so today I post my summary of 2011 and what&#8217;s happened for me both in my work and personally. In short, this year has still been hard after losing Tia in [...]


Related posts:<ol><li><a href='http://remysharp.com/2011/10/17/ellis-tennyson-sharp/' rel='bookmark' title='Permanent Link: Ellis Tennyson Sharp'>Ellis Tennyson Sharp</a></li><li><a href='http://remysharp.com/2012/12/31/my-2012/' rel='bookmark' title='Permanent Link: My 2012'>My 2012</a></li><li><a href='http://remysharp.com/2010/12/31/2010-the-year-ill-never-forget/' rel='bookmark' title='Permanent Link: 2010: The Year I&#8217;ll Never Forget'>2010: The Year I&#8217;ll Never Forget</a></li></ol>]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s now a bit of a tradition with a year end blog post (almost entirely so I can look back and actually remember myself!), so today I post my summary of 2011 and what&#8217;s happened for me both in my work and personally.</p>

<p>In short, this year has still been hard after losing Tia in August 2010 but as painful as that is, happiness arrived as a bundle we decided to call <a href="http://remysharp.com/ellis">Ellis Tennyson Sharp</a>. Pretty much everything else falls away compared to family, as much as I love my work, I hope it will remain a distant second to those most important around me.</p>

<p><span id="more-930"></span></p>

<h2 id="professional-heading">Professional</h2>

<p>On that note though, I&#8217;ll start with what I&#8217;ve been up to in the web world.</p>

<h3 id="speaking-heading">Speaking</h3>

<p>I was again fortunate enough to be invited to speak at a real variety of conferences &#8211; some micro events like Aral&#8217;s <a href="http://lanyrd.com/2011/geek-ninja-battle-night-mobile-web-vs-native/">Geek Ninja</a> to larger events like <a href="http://lanyrd.com/2011/oscon/">OSCON</a>.</p>

<p>I was also asked back to Flash on the Beach (I had to pull out last year) which was a real pleasure. The event is run in Brighton, and John Davey is possibly one of the nicest people I know (whom I&#8217;m convinced is actually just a British John Wayne). For a conference that has a strong Flash following the audience were particularly welcoming, and even <a href="http://www.youtube.com/watch?v=GMgDA89PIqs&amp;hd=1">sang me happy birthday</a>!</p>

<p>Personally however, my favourite conference of 2011 was <a href="http://lanyrd.com/2011/the-highland-fling-web-conference/">Highland Fling</a>. It was organised and run in the same spirit as Full Frontal which left me excited and inspired. I&#8217;m a big fan of the indie events and if the organiser is full of passion it stands to reason that it just oozes out in to the day. Highly recommend, and if it&#8217;s on again in 2012, it&#8217;s a damn fine excuse to visit Scotland again.</p>

<p><a href="http://www.flickr.com/photos/drewm/5943127404/"><img alt="Remy - Photo by Drew McLellan" src="http://remysharp.com/images/remy-highland-fling.jpg" style="max-width: 100%;"></a></p>

<p><small>Photo by Drew McLellan</small></p>

<h3 id="workshops-heading">Workshops</h3>

<p>I&#8217;d been considering whether I could pull off a &#8220;workshop tour&#8221; towards the end of 2010, and early on in the year, Julie helped me pull it off. We ran six workshops in five cities over two weeks: Brighton, Manchester, Bristol, London and Nottingham. Amazingly the project was a success both from the teaching, but the business side too. There&#8217;s a lot of risk involved in trying to sell multiple workshops at once but in the last weeks leading up to the workshops, they managed to sell out.</p>

<p>I also ran my first two-dayer on Node for Full Frontal &#8211; something I&#8217;ll be running again a few times this year, so if you&#8217;re interested in be notified, <a href="http://leftlogic.com/contact?subject=Re:%20Node%20Workshop">drop me a message</a>.</p>

<h3 id="projects-heading">Projects</h3>

<p>When I list out these projects that I&#8217;ve released, more often than not I think: damn, I wish I&#8217;d done more. But on the other hand, I could have done a lot less &#8211; or kept them to myself. So hopefully these are useful to someone as well as me!</p>

<ul>
<li><a href="http://inliner.leftlogic.com">Inliner</a> &#8211; a tool to &#8220;inline the crap&#8221; out of web sites, inlining CSS, images, fonts and JavaScript, compressing as much as possible. Also available as a <a href="https://github.com/remy/inliner">command line tool</a>.</li>
<li><a href="http://responsivepx.com">responsivepx</a> &#8211; a tool for testing and finding breaking points in responsive design.</li>
<li><a href="http://www.amazon.co.uk/gp/product/0321784421/ref=as_li_tf_tl?ie=UTF8&amp;tag=inht-21&amp;linkCode=as2&amp;camp=1634&amp;creative=6738&amp;creativeASIN=0321784421">Introducing HTML5 2nd Edition</a> &#8211; somehow Bruce and I managed to pull off a 2nd edition, packed with new info and even a new chapter on polyfills.</li>
<li><a href="http://mit-license.org">mit-license</a> &#8211; a public resource to host your own MIT-License under your own name, eg. <a href="http://rem.mit-license.org">rem.mit-license.org</a> (<a href="http://remysharp.com/2011/10/18/a-public-mit-license-resource/">more</a>)</li>
<li><a href="http://jsconsole.com/remote-debugging.html">jsconsole remote support</a> &#8211; I got fed up with the insane debugging techniques and poor console support in mobile smart phones &#8211; so I tweaked jsconsole so it could do exactly that!</li>
<li><a href="http://2011.full-frontal.org">Full Frontal 2011</a> &#8211; another year and (if I don&#8217;t say so myself) a another huge success. It was an amazing day and to my surprise folks were even telling me that it was the best year yet. So, no pressure for 2012!</li>
</ul>

<p>Randomly aside, I was nominated to have my face happy-webbie-fied amongst 60-odd others. Somehow in the voting rounds it end up me, so the kind folks at <a href="http://www.ngenworks.com/">nGen Works</a> have now immortalised me as a cartoon character &#8211; very neat :)</p>

<p><img src="http://remysharp.com/images/remy-happy-webbie.png" alt="Remy Sharp's happy webbie" title="" /></p>

<h2 id="personal-heading">Personal</h2>

<p>The year was still hard after losing Tia last year. Julie and I decided early that we still wanted to continue with our family, and the new year we would try for our second. Ellis was conceived much quicker than either of us hoped &#8211; one of the many blessings we had with <em>Smudge&#8217;s</em> pregnancy (as we saw Ellis in a 7 week scan, his nickname came from what he resembled most: a smudge!).</p>

<p>Julie delivered <a href="http://remysharp.com/ellis">Ellis Tennyson Sharp</a> on 29-September 2011 at 11:14am &#8211; safely and happily into the arms of his parents. An absolutely amazing day. As tough as it&#8217;s been, both a mix of emotions as we never had this with Tia, but also the physical side of things, like dealing with an upset human being whose communication skills are rather limited. As tough as that&#8217;s been, Ellis is so insanely cute that what he cracks a smile all the stresses are forgotten and I can&#8217;t help but be amazed.</p>

<p><img src="http://remysharp.com/images/ellis-with-tia-bear.jpg" style="max-width: 100%" alt="Ellis with Tia's bear"></p>

<p>Just a month before Ellis was born was Tia&#8217;s first birthday. In the year leading up to that date we started a local project in her name to improve a local children&#8217;s park. We&#8217;ve raised a little over £3,000 for <a href="http://www.virginmoneygiving.com/tiastrees">the project</a> and there&#8217;s more we want to do to improve the area for children (though half the money raised goes to SANDS &#8211; a charity for bereaved parents). I also had Tia&#8217;s hand print tattooed on to me permanently so I can always keep her near.</p>

<p>Both Julie and I celebrated 15 years of being together and completed our second year of <a href="http://www.flickr.com/photos/remysharp/sets/72157625843108084/">365 project</a> &#8211; which our plan is to create a single canvas print with two years of 365 picture &#8211; so that should be epic!</p>

<p>Utterly unrelated, but I built a Death Star this Christmas too &#8211; too cool not to include in my round up &#8211; definitely going to be doing more Lego next year!</p>

<iframe width="612" height="341" src="http://www.youtube.com/embed/pqdJO0w6c1s?hd=1" frameborder="0" allowfullscreen></iframe>

<h2 id="2012-heading">2012?</h2>

<p>I&#8217;m hoping to build <a href="http://leftlogic.com">my business</a> up. I always wanted to grow my little agency to around 6 people. Obviously I need the business in place before I go along employing people, so if there&#8217;s some JavaScript (both client and server side) project that you need an A-team on the case &#8211; do <a href="http://leftlogic.com/contact">get in touch</a>!</p>

<p>Otherwise, I&#8217;m hoping do more of the same, more blogging, more project, continue with our 365 &#8211; but more importantly: spend as much time as I can with my family.</p>

<p>Here&#8217;s to 2012, cheers!</p>


<p>Related posts:<ol><li><a href='http://remysharp.com/2011/10/17/ellis-tennyson-sharp/' rel='bookmark' title='Permanent Link: Ellis Tennyson Sharp'>Ellis Tennyson Sharp</a></li><li><a href='http://remysharp.com/2012/12/31/my-2012/' rel='bookmark' title='Permanent Link: My 2012'>My 2012</a></li><li><a href='http://remysharp.com/2010/12/31/2010-the-year-ill-never-forget/' rel='bookmark' title='Permanent Link: 2010: The Year I&#8217;ll Never Forget'>2010: The Year I&#8217;ll Never Forget</a></li></ol></p><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/remysharp?a=MqDrNcUBwJY:ZO9MSp-44WM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/remysharp?i=MqDrNcUBwJY:ZO9MSp-44WM:F7zBnMyn0Lo" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/MqDrNcUBwJY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2011/12/31/my-2011/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.0/uk/</creativeCommons:license>
	<feedburner:origLink>http://remysharp.com/2011/12/31/my-2011/</feedburner:origLink></item>
	</channel>
</rss>
