<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	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/"
	>

<channel>
	<title>allskonar</title>
	<atom:link href="http://www.snitchmedia.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.snitchmedia.com/blog</link>
	<description>everything and nothing</description>
	<lastBuildDate>Wed, 03 Aug 2011 11:13:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Vitunes, yes iTunes controlled from Vi</title>
		<link>http://www.snitchmedia.com/blog/2011/08/03/726/</link>
		<comments>http://www.snitchmedia.com/blog/2011/08/03/726/#comments</comments>
		<pubDate>Wed, 03 Aug 2011 11:12:52 +0000</pubDate>
		<dc:creator>baldur</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.snitchmedia.com/blog/?p=726</guid>
		<description><![CDATA[A college sent out this link. And I just couldn&#8217;t resist installing it and I am glad I did. Yes, Ke$ha I know &#8230; it keeps my engaged and is loud enough to block distractions when I code.]]></description>
			<content:encoded><![CDATA[<p>A college sent out <a href="http://danielchoi.com/software/vitunes.html">this link</a>. And I just couldn&#8217;t resist installing it and I am glad I did.</p>
<p><a href="http://www.snitchmedia.com/blog/wp-content/uploads/2011/08/vitunes-e1312369754436.png"><img class="alignnone size-full wp-image-727" title="vitunes" src="http://www.snitchmedia.com/blog/wp-content/uploads/2011/08/vitunes-e1312369754436.png" alt="" width="600" height="339" /></a></p>
<p>Yes, Ke$ha I know &#8230; it keeps my engaged and is loud enough to block distractions when I code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snitchmedia.com/blog/2011/08/03/726/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Implementing HTML 5 History Api</title>
		<link>http://www.snitchmedia.com/blog/2011/08/02/implementing-html-5-history-api/</link>
		<comments>http://www.snitchmedia.com/blog/2011/08/02/implementing-html-5-history-api/#comments</comments>
		<pubDate>Tue, 02 Aug 2011 01:22:58 +0000</pubDate>
		<dc:creator>baldur</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://www.snitchmedia.com/blog/?p=724</guid>
		<description><![CDATA[A few weeks back I was inspired by github.com implementation of the tree slider and I had a project at patch.com where I was building a dashboard for Business owners to manage features through our site. In order to make a dashboard with multiple pages and make it snappy and interactive I felt using a [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks back I was inspired by github.com implementation of the <a title="Github Tree Slider" href="https://github.com/blog/760-the-tree-slider">tree slider</a> and I had a project at <a title="Patch" href="http://www.patch.com">patch.com</a> where I was building a dashboard for Business owners to manage features through our site. In order to make a dashboard with multiple pages and make it snappy and interactive I felt using a proper history control was in order. I have never had pleasant relationship with Really Simple History or any other history library for that matter. So I started investigating the new html5 history api. The nice thing about the new history api is that it will always result in a &#8220;proper&#8221; url so linking straight to a particular page is doable without having to have js kick in and respond to a location hash on your page. This also makes it easier to manage history when coming traveling into the feature as well as out of it. One problem with RSH is that you have to handle that awkward first stage where you end up dealing with issues going between pages that are paged in via xhr vs pages that are full requests.</p>
<p>One thing that is clear and helped in making a design choice was the fact that the history api is not even close to being <a href="http://blogs.msdn.com/b/ukmsdn/archive/2011/06/29/ie10-platform-preview-2-released.aspx">implemented in the IE family</a>. This I doesn&#8217;t bother me too much since this is what you label as progressive enhancement but this limitation did make force me implement the pages in a way that it was working without it which is a good practice any ways this way it can work without javascript for example. I was lucky because the &#8220;page&#8221; area was well defined so I was able to create two endpoints in our rails stack where it switches between rendering a whole page and a partial depending on if the request is an xhr request or not &#8230; rails is good at that type of stuff.</p>
<p>Then for the history javascript example. I used the <a href="https://github.com/balupton/history.js">history.js</a> library that offers some hashbang support as a html4 fallback. But you can use similar code for the native history api support with a few replacements</p>
<pre><code class="javascript">
if( !History.enabled ) { return; } 

var loadPage = function( opts ) {
    if( opts ) {
        $.each( opts, function( k, v ) {
            defaultOptions[ k ] = v;
        } );
    }
    var panels = contentSpace.data( 'panels' ); 

    if(!panels[opts.path]) {
        $.get( opts.path, function( data ) {
            //cache page
            if( opts.page ) {
                panels[ opts.path ] = { 'data' : data, 'page' : opts.page };
                contentSpace.data( 'panels', panels );
            }
            contentSpace.html( data );
        });
    } else {
        contentSpace.html( panels[ opts.path ].data );
    }
} 

History.Adapter.bind( window, 'statechange', function(e) {
    var opts = { 'path' : History.getState().hash, 'page' : History.getState().data.page };
    loadPage( opts );
}); 

// hit it for the first time
History.pushState( optionHash, "Title", "the url path" );
</code></pre>
<p>This implementation is specific to fit the requirements I had but I wanted it to be out there in the interest of having more examples of how this can be implemented and demonstrate that it&#8217;s relatively straight forward. I sugar coded this with caching which will obviously prevent the users to see any &#8220;real&#8221; time info if there are any.</p>
<p>Good Links to explore HTML5 history api</p>
<ul>
<li><a href="http://www.w3.org/TR/html5/history.html">W3C spec</a></li>
<li><a href="https://github.com/balupton/history.js">The Awesome history.js library</a> that makes this almost possible everywhere</li>
<li><a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history">Mozilla Developer Docs</a></li>
<li><a href="http://robertnyman.com/html5/history-api/history-api.html">Robert Nyman</a> a swedish guy who works for mozilla who has an awesome website with bunch of examples</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.snitchmedia.com/blog/2011/08/02/implementing-html-5-history-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hekla in the Icelandic news &#8230; one minute into the video</title>
		<link>http://www.snitchmedia.com/blog/2011/04/03/hekla-in-the-icelandic-news-one-minute-into-the-video/</link>
		<comments>http://www.snitchmedia.com/blog/2011/04/03/hekla-in-the-icelandic-news-one-minute-into-the-video/#comments</comments>
		<pubDate>Sun, 03 Apr 2011 01:17:26 +0000</pubDate>
		<dc:creator>baldur</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.snitchmedia.com/blog/?p=725</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="600" height="400"><param name="movie" value="http://www.mbl.is/player/mblplayer.swf"></param><param name="allowFullScreen" value="true"></param><param name="flashvars" value="media_id=56787"></param>
<embed src="http://www.mbl.is/player/mblplayer.swf" width="600" height="400"<br />
  type="application/x-shockwave-flash" allowfullscreen="true"<br />
  flashvars="media_id=56787" /><br />
</object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snitchmedia.com/blog/2011/04/03/hekla-in-the-icelandic-news-one-minute-into-the-video/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Giles Meets Zombie: In search of love he only found fear &#8230;</title>
		<link>http://www.snitchmedia.com/blog/2011/03/18/giles-meets-zombie-in-search-of-love-he-only-found-fear/</link>
		<comments>http://www.snitchmedia.com/blog/2011/03/18/giles-meets-zombie-in-search-of-love-he-only-found-fear/#comments</comments>
		<pubDate>Fri, 18 Mar 2011 01:43:11 +0000</pubDate>
		<dc:creator>baldur</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.snitchmedia.com/blog/?p=719</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/21150797?title=0&amp;byline=0&amp;portrait=0" width="398" height="224" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.snitchmedia.com/blog/2011/03/18/giles-meets-zombie-in-search-of-love-he-only-found-fear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JSlint for Your Big Project</title>
		<link>http://www.snitchmedia.com/blog/2011/01/30/jslint-for-your-big-project/</link>
		<comments>http://www.snitchmedia.com/blog/2011/01/30/jslint-for-your-big-project/#comments</comments>
		<pubDate>Sun, 30 Jan 2011 01:59:27 +0000</pubDate>
		<dc:creator>baldur</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jslint]]></category>

		<guid isPermaLink="false">http://www.snitchmedia.com/blog/?p=718</guid>
		<description><![CDATA[So, many years ago, I was pretty pumped up about having found a decent way to run JSlint on the command line instead of having to either paste it into the jslint website or even run it through an IDE. That approach works well so long that you have a little project and you don&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>So, many years ago, I was pretty pumped up about having found a decent way to <a href="http://www.snitchmedia.com/blog/2007/11/29/jslint-from-the-terminal/">run JSlint on the command line instead</a> of having to either paste it into the jslint website or even run it through an IDE. That approach works well so long that you have a little project and you don&#8217;t have massive code base. This time around I wanted to find a decent way of running it against a larger code base with multiple developers, <a href="https://github.com/baldur/jsLintWrapper">jsLintWrapper</a> is the proposed solution. When I was investigating ways to do this I didn&#8217;t find anything that worked well for me and no good way of excluding some of the errors that jslint complains about. When I looked at the jquery project they had a good way to exclude some of the errors so I snagged that idea and built it further to run on a large code base. This meant finding a way to run them on all files and be reasonably quick. I also added in some ways of placing a stick in the ground, sort of speak where you pick an day where you want to be lint free after and then you only have to lint files that you modify this is a good strategy for getting a clean run which you can then tie into your commit hooks, build process or what ever ways work for your workflow. This is still a work in progress so I would appreciate feedback and suggestions for features.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.snitchmedia.com/blog/2011/01/30/jslint-for-your-big-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

