<?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:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Matt Kirman</title>
	
	<link>http://mattkirman.com</link>
	<description />
	<lastBuildDate>Sat, 28 Aug 2010 10:03:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MattKirman" /><feedburner:info uri="mattkirman" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><feedburner:emailServiceId>MattKirman</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>My Git Workflow; Introducing Flit</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/FjQX1ia1zVo/</link>
		<comments>http://mattkirman.com/2010/08/27/my-git-workflow-introducing-flit/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 21:42:19 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Flit]]></category>
		<category><![CDATA[flit]]></category>
		<category><![CDATA[git]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=306</guid>
		<description><![CDATA[I&#8217;ve been a Git convert, and version control geek, for over a year now so I&#8217;ve sort of become the unofficial Git consultant at the office. If anythings breaks or something weird happens I&#8217;m usually the one called in to sort it out. In order to preserve at least some of the remnants of our [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a Git convert, and version control geek, for over a year now so I&#8217;ve sort of become the unofficial Git consultant at the office. If anythings breaks or something weird happens I&#8217;m usually the one called in to sort it out.</p>
<p>In order to preserve at least some of the remnants of our sanity I decided, after my colleague managed to corrupt his entire local repository, that I needed to enforce some sort of system. What I finished up with is this fairly typical workflow:</p>
<ul>
<li>Find a feature (or bugfix, ticket, etc.) to work on</li>
<li><code class="codecolorer text twitlight"><span class="text">git checkout -b my_new_feature</span></code></li>
<li>Hack away at some code</li>
<li><code class="codecolorer text twitlight"><span class="text">git commit</span></code> early and often. Small diffs are the key.</li>
<li>When I&#8217;ve finished <code class="codecolorer text twitlight"><span class="text">git checkout master</span></code></li>
<li><code class="codecolorer text twitlight"><span class="text">git pull</span></code> any changes</li>
<li><code class="codecolorer text twitlight"><span class="text">git checkout my_new_feature</span></code></li>
<li><code class="codecolorer text twitlight"><span class="text">git rebase master</span></code></li>
<li>Fix any merge conflicts that I may have. If there are conflicts, fix them and keep going. Merge conflicts should be kept off the master branch if at all possible.</li>
<li><code class="codecolorer text twitlight"><span class="text">git rebase -i</span></code> so that I squash all the commits in my branch down into one. This keeps the master branch nice and tidy.</li>
<li><code class="codecolorer text twitlight"><span class="text">git checkout master</span></code> once the code is ready</li>
<li><code class="codecolorer text twitlight"><span class="text">git merge my_new_feature</span></code></li>
<li><code class="codecolorer text twitlight"><span class="text">git push</span></code></li>
</ul>
<p>Once our code is ready for staging we push our code to the <code class="codecolorer text twitlight"><span class="text">staging</span></code> branch, and likewise to the <code class="codecolorer text twitlight"><span class="text">production</span></code> branch. The <code class="codecolorer text twitlight"><span class="text">master</span></code> branch is reserved for bleeding edge code.</p>
<p>I then started thinking, surely there must be a much easier way to manage this workflow? A minimum of seven separate commands to merge my changes into <code class="codecolorer text twitlight"><span class="text">master</span></code> and push it back to the server?</p>
<h3>Introducing Flit</h3>
<p>Flit is a command line utility that eases the typical Git workflow that I&#8217;ve outlined above. Setting up Flit to work with either a new or existing Git repository is a simple as <code class="codecolorer text twitlight"><span class="text">flit init</span></code>. If you haven&#8217;t already created a Git repository then Flit will create one for you.</p>
<p>Then, whenever you want to start, or continue with, a feature or bugfix simply do <code class="codecolorer text twitlight"><span class="text">flit start feature my_new_feature</span></code>. Flit will create, or switch, to your feature branch, ready for you to start hacking away.</p>
<p>You can then use Git as normal, committing your changes as and when you see fit. Once you&#8217;ve finished work for the day on your feature or bugfix, <code class="codecolorer text twitlight"><span class="text">flit stop</span></code> will return you back to your development branch.</p>
<p>Once your feature is complete <code class="codecolorer text twitlight"><span class="text">flit finish feature my_new_feature</span></code> will pull down changes in <code class="codecolorer text twitlight"><span class="text">master</span></code>, rebase them into your feature branch and then merge your feature back into <code class="codecolorer text twitlight"><span class="text">master</span></code>.</p>
<h3>Caveats</h3>
<p>Flit is an extremely early alpha. Features may be broken or just plain missing, but getting this code out into the open-source community where people can start hacking away with it is much more important.</p>
<p>To that end, the entire codebase is hosted on <a href="http://github.com/mattkirman/flit">GitHub</a>. If something&#8217;s missing just fork the code, add your fix and send me a pull request.</p>
<h3>Requirements</h3>
<ul>
<li>Git 1.6.4 or greater</li>
<li>Ruby 1.8.7 or greater</li>
<li>RubyGems</li>
</ul>
<h3>Installation</h3>
<p>The easiest way to install Flit is through RubyGems:<br />
<code class="codecolorer text twitlight"><span class="text">gem install flit --pre</span></code></p>
<p>Alternatively you can install Flit from source:<br />
<code class="codecolorer text twitlight"><span class="text">rake gem &amp;&amp; rake install</span></code></p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/FjQX1ia1zVo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2010/08/27/my-git-workflow-introducing-flit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2010/08/27/my-git-workflow-introducing-flit/</feedburner:origLink></item>
		<item>
		<title>YUI Compressor TextMate Bundle</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/AnZ_7XfjJiw/</link>
		<comments>http://mattkirman.com/2009/11/13/yui-compressor-textmate-bundle/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 13:14:25 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[compressor]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[textmate]]></category>
		<category><![CDATA[yui]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=245</guid>
		<description><![CDATA[Even though the Google Closure Compiler is very useful for compressing JavaScript it has absolutely no support for CSS, something that the YUI Compressor excels at. I give you the YUI Compressor TextMate bundle, an almost direct port of the Google Closure Compiler TextMate bundle but with a different compression library. It has support for [...]]]></description>
			<content:encoded><![CDATA[<p>Even though the Google Closure Compiler is very useful for compressing JavaScript it has absolutely no support for CSS, something that the YUI Compressor excels at. I give you the YUI Compressor TextMate bundle, an almost direct port of the <a href="http://mattkirman.com/2009/11/10/google-closure-compiler-textmate-bundle/">Google Closure Compiler TextMate bundle</a> but with a different compression library.</p>
<p>It has support for compressing multiple JavaScript and CSS files at the same time; just select the files you want to compress and hit &#x21E7;&#8984;Y.</p>
<h3>Requirements</h3>
<p>The YUI Compressor bundle requires:</p>
<ul>
<li><a href="http://yuilibrary.com/downloads/#yuicompressor" target="_blank">The YUI Compressor</a></li>
<li><a href="http://www.ruby-lang.org/" target="_blank">Ruby</a> version 1.8.7 or greater (installed as default on Mac OS 10.5 and above)</li>
<li>and <a href="http://macromates.com/" target="_blank">TextMate</a> (obviously)</li>
</ul>
<p>Please make sure you read the <a href="http://github.com/mattkirman/YUI-Compressor-tmbundle/blob/master/README.md" target="_blank">README</a> before installing. The YUI Compressor TextMate bundle is licenced under the <a href="http://www.opensource.org/licenses/gpl-2.0.php" target="_blank">GPL Licence</a>. This bundle has only been tested with the latest versions of Mac OS X (v10.6.2) and TextMate (v1.5.8) but should work with earlier versions as long as the requirements above are met.</p>
<h3>Get It</h3>
<ul>
<li><a href="http://github.com/mattkirman/YUI-Compressor-tmbundle/downloads">Downloads</a></li>
<li><a href="http://github.com/mattkirman/YUI-Compressor-tmbundle">Source</a></li>
</ul>
<p>Using this bundle? Got any suggestions? Let me know in the comments!</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/AnZ_7XfjJiw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/11/13/yui-compressor-textmate-bundle/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/11/13/yui-compressor-textmate-bundle/</feedburner:origLink></item>
		<item>
		<title>Google Closure Compiler TextMate Bundle</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/AIFjcW7SJxo/</link>
		<comments>http://mattkirman.com/2009/11/10/google-closure-compiler-textmate-bundle/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 15:51:12 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[closure-compiler]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[textmate]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=212</guid>
		<description><![CDATA[I&#8217;ve been trying out the brand new Google Closure Compiler instead of the YUI Compressor. I&#8217;m not going to go into any detail about the Closure Compiler as there&#8217;s plenty of information out there already, but I can say that it looks like another solid offering from Google. Anyway, in an effort to make a [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been trying out the brand new <a href="http://code.google.com/closure/compiler/" target="_blank">Google Closure Compiler</a> instead of the <a href="http://yuilibrary.com/downloads/#yuicompressor" target="_blank">YUI Compressor</a>. I&#8217;m not going to go into any detail about the Closure Compiler as there&#8217;s plenty of information out there already, but I can say that it looks like another solid offering from Google.</p>
<p>Anyway, in an effort to make a pretty good piece of software even better I decided to make a <a href="http://macromates.com/" target="_blank">TextMate</a> bundle for it so that it&#8217;s never more than a keystroke away (defaults to &#x21E7;&#8984;G).</p>
<h3>Requirements</h3>
<p>The Google Closure Compiler bundle requires:</p>
<ul>
<li><a href="http://closure-compiler.googlecode.com/files/compiler-latest.zip">The Google Closure Compiler</a> (not included in the bundle)</li>
<li><a href="http://www.ruby-lang.org/" target="_blank">Ruby</a> version 1.8.7 or greater (installed as standard on Mac OS 10.5 and above)</li>
<li><a href="http://macromates.com/" target="_blank">TextMate</a> (obviously)</li>
</ul>
<p>Make sure you read the <a href="http://github.com/mattkirman/GoogleClosureCompiler-tmbundle/blob/master/README.md">README</a> file before installing. The Google Closure Compiler TextMate bundle is licenced under the <a href="http://www.opensource.org/licenses/gpl-2.0.php">GPL Licence</a>. This bundle has only been tested with the latest versions of Mac OS X (v10.6.2) and TextMate (v1.5.8) but should work with earlier versions as long as the requirements above are met.</p>
<h3>Get It</h3>
<ul>
<li><strong>[Update]</strong> The bundle is now available via the <a href="http://svn.textmate.org/trunk/Review/Bundles/GetBundles.tmbundle/" target="_blank">GetBundles</a> TextMate bundle. Simply search for &#8220;Google Closure Compiler&#8221; (Recommended)</li>
<li><a href="http://github.com/mattkirman/GoogleClosureCompiler-tmbundle/downloads">Downloads</a></li>
<li><a href="http://github.com/mattkirman/GoogleClosureCompiler-tmbundle">Source code</a></li>
</ul>
<p>Using this bundle? Got any suggestions? Let me know in the comments!</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/AIFjcW7SJxo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/11/10/google-closure-compiler-textmate-bundle/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/11/10/google-closure-compiler-textmate-bundle/</feedburner:origLink></item>
		<item>
		<title>Equal height columns with pure CSS</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/k48FDWA36qA/</link>
		<comments>http://mattkirman.com/2009/10/12/equal-height-columns-with-pure-css/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 11:46:36 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=172</guid>
		<description><![CDATA[A common problem when designing for the web is how to create equal height columns. The usual solution is to either resort to JavaScript or CSS absolute positioning, here I will show you how to create equal height columns with pure CSS using the margin, padding and float properties. HTML The HTML of our page [...]]]></description>
			<content:encoded><![CDATA[<p>A common problem when designing for the web is how to create equal height columns. The usual solution is to either resort to JavaScript or CSS absolute positioning, here I will show you how to create equal height columns with pure CSS using the <code class="codecolorer text twitlight"><span class="text">margin</span></code>, <code class="codecolorer text twitlight"><span class="text">padding</span></code> and <code class="codecolorer text twitlight"><span class="text">float</span></code> properties.</p>
<p><span id="more-172"></span></p>
<h2>HTML</h2>
<p>The HTML of our page is going to look something like this:</p>
<div class="codecolorer-container html4strict twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="html4strict codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;wrapper&quot;</span>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;content&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a> <span style="color: #000066;">id</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;sidebar&quot;</span>&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ...<br />
&nbsp; &nbsp; <span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span><br />
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><a href="http://december.com/html/4/element/div.html"><span style="color: #000000; font-weight: bold;">div</span></a>&gt;</span></div></div>
<h2>CSS</h2>
<p>Our page is going to be 500px wide, with a 300px content area and a 200px sidebar. The CSS:</p>
<div class="codecolorer-container css twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #cc00cc;">#wrapper</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span> <span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> &nbsp; &nbsp;<span style="color: #808080; font-style: italic;">/* Center the wrapper horizontally */</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">overflow</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">hidden</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #cc00cc;">#content</span><span style="color: #00AA00;">,</span> <span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-10000px</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">100000px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #cc00cc;">#content</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">300px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<br />
<span style="color: #cc00cc;">#sidebar</span> <span style="color: #00AA00;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span> <span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span><br />
&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">200px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span></div></div>
<h2>The Demo</h2>
<p>Putting this together you end up with something like this:</p>
<div style="background:#fff;position:relative;margin:0 auto;overflow:hidden;width:500px">
<div style="float:right;padding-bottom:10000px;margin-bottom:-10000px;width:300px">
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</p></div>
<div style="background:#ccc;float:left;padding-bottom:10000px;margin-bottom:-10000px;width:200px">
<ul>
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
</ul></div>
</div>
<h2>Why does this work?</h2>
<p>The key to creating equal height columns using this method are the <code class="codecolorer text twitlight"><span class="text">overflow: hidden</span></code> selector on the wrapper and the large <code class="codecolorer text twitlight"><span class="text">padding-bottom</span></code> and negative <code class="codecolorer text twitlight"><span class="text">margin-bottom</span></code>. Any padding is hidden when setting the overflow of the container to hidden. Basically, this means that by setting a large enough <code class="codecolorer text twitlight"><span class="text">padding-bottom</span></code> then we can effectively stretch the background colour of the element to the bottom of the page. If 10000px isn&#8217;t enough then just make it even larger.</p>
<p>The large negative <code class="codecolorer text twitlight"><span class="text">margin-bottom</span></code> then tells the browser where to render the bottom of the box (I think. Don&#8217;t quote me on that). If we had set a <code class="codecolorer text twitlight"><span class="text">height</span></code> of the container this wouldn&#8217;t have worked, and without the negative <code class="codecolorer text twitlight"><span class="text">margin-bottom</span></code> we would have ended up with a container over 10000px tall.</p>
<p><strong>When using this method always make sure that you set the <code class="codecolorer text twitlight"><span class="text">margin-bottom</span></code> to be equal and negative of the <code class="codecolorer text twitlight"><span class="text">padding-bottom</span></code>.</strong></p>
<p>And the best bit of this method? If you decide that you now want your sidebar on the right, simply set <code class="codecolorer text twitlight"><span class="text">float: right</span></code> on the <code class="codecolorer text twitlight"><span class="text">#sidebar</span></code> and <code class="codecolorer text twitlight"><span class="text">float: left</span></code> on the <code class="codecolorer text twitlight"><span class="text">#content</span></code>.</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/k48FDWA36qA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/10/12/equal-height-columns-with-pure-css/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/10/12/equal-height-columns-with-pure-css/</feedburner:origLink></item>
		<item>
		<title>Blog redesign #4 (and why the WordPress Plugin API needs fixing)</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/eeGsiTlgMxA/</link>
		<comments>http://mattkirman.com/2009/10/08/blog-redesign-4-and-why-the-wordpress-plugin-api-needs-fixing/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 14:18:18 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[glimmer]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mootools]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=136</guid>
		<description><![CDATA[Whilst I was redesigning my blog (what do you think by the way) I decided that what I really needed to finish it off was an ajaxy live search. Now normally I would have looked for a jQuery version, but as I&#8217;ve been trying my hand at a bit of MooTools recently I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>Whilst I was redesigning my blog (what do you think by the way) I decided that what I really needed to finish it off was an ajaxy live search. Now normally I would have looked for a <a href="http://jquery.com/">jQuery</a> version, but as I&#8217;ve been trying my hand at a bit of <a href="http://mootools.net/">MooTools</a> recently I decided to write my own plugin. By the way, if you want to use it on your own site it&#8217;s available for <a href="http://github.com/mattkirman/wp-live-search">download</a> on GitHub.</p>
<p>After a few minutes hacking it together on my local web-server I had a pretty good implementation, even if I say so myself. However, once I&#8217;d installed it onto my live server it stopped returning any results. The reason for this? I had WP Super Cache installed on my live server, but not on my local server, and was messing up the JSON output by putting a comment at the bottom. Obviously, the JavaScript function refused to parse it as valid JSON. When I turned WP Super Cache off everything returned to normal.</p>
<p>As a developer this was simple enough to debug and fix, but for the average user who just wants to use WordPress, install some plugins and then start blogging away this incompatibility simply isn&#8217;t good enough. Before you know it you&#8217;ll end up with your support forums full of posts such as &#8220;<em>Your plugin doesn&#8217;t work with xxxx, please fix it</em>&#8220;, even if you have already stated this issue in your readme and installation guides.</p>
<p><span id="more-136"></span></p>
<p>Then it struck me: <strong>the WordPress Plugin API is broken</strong>.  As developers we shouldn&#8217;t have to rely on users checking that their plugins play nicely together, the plugin should know <em>before</em> it has even been activated. An excellent example of this is the <a href="http://docs.rubygems.org/">RubyGems</a> framework. I propose, therefore, <a href="http://glimmer.redflex.co.uk/">Glimmer</a> &#8211; the next-generation plugin manager for WordPress. Now, that&#8217;s a pretty bold claim to make, but I strongly believe that this is the route that WordPress ought to be going down. But just don&#8217;t take my word for it, let&#8217;s have a look at what&#8217;s planned for Glimmer Alpha 1:</p>
<dl>
<dt>Dependency checking</dt>
<dd>Utilise the hours of work carried out by other developers by building on their plugins. The user is prompted if a required plugin is missing. Glimmer can then, in some cases, automatically install missing plugins. Glimmer can even check to make sure that the correct WordPress version in installed and that certain PHP functions and extensions are available.</dd>
<dt>Incompatibility checking</dt>
<dd>Known issues with a third party plugin? Don&#8217;t rely on the user, Glimmer can warn them about possible incompatibilities before they have even activated the plugin on their site.</dd>
<dt>Easy distribution</dt>
<dd>You are no longer forced to use the WordPress hosted SVN if you want to provide automatic updates of your plugin. Glimmer uses <a href="http://connectedflow.com/appcasting/">Appcasts</a>, a RSS variant, to distribute your code from any web server. If users have already installed Glimmer they can ask it to install from the <tt>your-plugin-name.glimmer</tt> file which gets distributed with your plugin, saving them the need to upload your plugin via FTP (and potentially getting it wrong).</dd>
<dt>Awesome updates</dt>
<dd>Glimmer automatically checks for plugin updates. Better still, Glimmer supports multiple development branches (e.g. providing a legacy branch for a previous version of WordPress) and scheduling future updates via the RSS <tt>pubDate</tt> element. You can also embed any release notes in the feed to be displayed to the user <em>before</em> they update.</dd>
<dt>Glimmer is an extension, not a replacement</dt>
<dd>Users who haven&#8217;t got Glimmer installed will still be able to use your plugin but just without all the fancy features and improvements that Glimmer provides. If you want to Glimmer-ise an existing plugin simply add a <tt>your-plugin-name.glimmer</tt> file to the plugin directory.</dd>
</dl>
<p>Glimmer is open-source, it&#8217;s licensed under the <a href="http://www.opensource.org/licenses/gpl-2.0.php">GPL Licence</a>, and is <a href="http://github.com/mattkirman/glimmer">available on GitHub</a>. If you would like to contribute to Glimmer please get in touch, by leaving a comment here, messaging me on <a href="http://twitter.com/mattkirman">Twitter</a> or just send me a pull request on GitHub.</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/eeGsiTlgMxA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/10/08/blog-redesign-4-and-why-the-wordpress-plugin-api-needs-fixing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/10/08/blog-redesign-4-and-why-the-wordpress-plugin-api-needs-fixing/</feedburner:origLink></item>
		<item>
		<title>Using Capistrano to deploy PHP (or anything else in a Git repository)</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/ZZsaSOLXgUc/</link>
		<comments>http://mattkirman.com/2009/09/17/using-capistrano-to-deploy-php/#comments</comments>
		<pubDate>Thu, 17 Sep 2009 21:56:32 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=122</guid>
		<description><![CDATA[Recently I&#8217;ve been looking at a way to ease the path of deploying PHP applications to my servers. I eventually settled on the excellent Ruby tool Capistrano which is very popular with the Rails crowd. Now, I&#8217;m aware of the irony of using Ruby to deploy PHP but please bare with me. All of my [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been looking at a way to ease the path of deploying <a href="http://php.net/">PHP</a> applications to my servers. I eventually settled on the excellent <a href="http://www.ruby-lang.org/">Ruby</a> tool <a href="http://www.capify.org/">Capistrano</a> which is very popular with the <a href="http://rubyonrails.org/">Rails</a> crowd. Now, I&#8217;m aware of the irony of using Ruby to deploy PHP but please bare with me.</p>
<p>All of my code is stored in the <a href="http://git-scm.com/">Git</a> VCS with a bare repository on the server, which is what you should be doing as well. Once you&#8217;ve got used to managing your code with Git over SSH you will never want to go back to FTP again. Seriously, try it.</p>
<p>My work-flow is fairly typical: clone the repository onto my local machine; hack away; commit the changes and push the commit back to the server. The problem arises when it comes to deploying this code &#8211; I could either set up a post-update hook in the bare repository to pull the changes into the web root or do it manually.</p>
<p><span id="more-122"></span></p>
<p>Using a post-update hook is not ideal. For one, I might not want to trigger a <code class="codecolorer text twitlight"><span class="text">git pull</span></code> every time I push a commit to the server. Furthermore, how would I go about differentiating between staging and production servers? And manually SSH-ing into the server, changing to the correct directory and running a <code class="codecolorer text twitlight"><span class="text">git pull</span></code> every time is just too long winded and time consuming.</p>
<p>Instead, I looked at a way to automate the process. I&#8217;m quite a fan of Ruby, so I naturally turned to a Ruby solution, Capistrano. Plus the blurb on their home page described the exact tool that I was looking for. That&#8217;s some really great copy writing. So, without any hesitation, I quickly ran <code class="codecolorer text twitlight"><span class="text">sudo gem install capistrano</span></code> and started to have a play around.</p>
<p>The first thing you want to do is to create a <tt>capfile</tt> in the root of your web application. This is to capistrano as a rakefile is to rake and a makefile is to make. Once you&#8217;ve got your capfile you can run <code class="codecolorer text twitlight"><span class="text">cap -T</span></code> to see a list of your Capistrano recipes. By default Capistrano includes the <code class="codecolorer text twitlight"><span class="text">invoke</span></code> and <code class="codecolorer text twitlight"><span class="text">shell</span></code> recipes. I&#8217;m not going to explain what these do as they are documented well enough elsewhere.</p>
<p>The next thing you want to do is to create your <code class="codecolorer text twitlight"><span class="text">deploy</span></code> namespace:</p>
<div class="codecolorer-container ruby twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="ruby codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">set <span style="color:#ff3333; font-weight:bold;">:web_directory</span>, <span style="color:#996600;">&quot;the deployed file location&quot;</span><br />
set <span style="color:#ff3333; font-weight:bold;">:branch</span>, <span style="color:#996600;">&quot;origin/master&quot;</span><br />
<br />
role <span style="color:#ff3333; font-weight:bold;">:server</span>, <span style="color:#996600;">&quot;your server address&quot;</span><br />
<br />
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; desc <span style="color:#996600;">&quot;Updates the code on the server&quot;</span><br />
&nbsp; &nbsp; task <span style="color:#ff3333; font-weight:bold;">:default</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:server</span>, <span style="color:#ff3333; font-weight:bold;">:except</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:no_release</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; run <span style="color:#006600; font-weight:bold;">&#91;</span> <span style="color:#996600;">&quot;cd #{web_directory}&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#996600;">&quot;git fetch origin&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color:#996600;">&quot;git reset --hard #{branch}&quot;</span> <span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">join</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;; &quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span><br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<br />
&nbsp; &nbsp; desc <span style="color:#996600;">&quot;Rollback a single commit on the server&quot;</span><br />
&nbsp; &nbsp; task <span style="color:#ff3333; font-weight:bold;">:rollback</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:server</span>, <span style="color:#ff3333; font-weight:bold;">:except</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> <span style="color:#ff3333; font-weight:bold;">:no_release</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span> <span style="color:#006600; font-weight:bold;">&#125;</span> <span style="color:#9966CC; font-weight:bold;">do</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; set <span style="color:#ff3333; font-weight:bold;">:branch</span>, <span style="color:#996600;">&quot;HEAD^&quot;</span>,<br />
&nbsp; &nbsp; &nbsp; &nbsp; default<br />
&nbsp; &nbsp; <span style="color:#9966CC; font-weight:bold;">end</span><br />
<span style="color:#9966CC; font-weight:bold;">end</span></div></div>
<p>Then once you decide that your code is at the right point to be deployed to your web server, simply call <code class="codecolorer text twitlight"><span class="text">cap deploy</span></code>. That&#8217;s it! No more messing around with Git commands on a remote server.</p>
<p>This isn&#8217;t an ideal configuration, obviously there ought to be a way to decide which branch/tag is checked out. But, as a 2 minute fix, this&#8217;ll do for now.</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/ZZsaSOLXgUc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/09/17/using-capistrano-to-deploy-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/09/17/using-capistrano-to-deploy-php/</feedburner:origLink></item>
		<item>
		<title>jQuery Plugin: rf.Sparks</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/H2ufOJNYwO0/</link>
		<comments>http://mattkirman.com/2009/05/20/jquery-plugin-rfsparks/#comments</comments>
		<pubDate>Wed, 20 May 2009 11:03:19 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[rfsparks]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=74</guid>
		<description><![CDATA[[Update] I&#8217;ve recently changed my JavaScript framework to MooTools, hence the rf.Sparks demo isn&#8217;t working properly. The plugin itself hasn&#8217;t actually changed so should still work perfectly fine on your own site. This month&#8217;s jQuery plugin is one that creates an effect that I like to describe as &#8220;sparks&#8221;. We are currently using it on [...]]]></description>
			<content:encoded><![CDATA[<p><strong>[Update] I&#8217;ve recently changed my JavaScript framework to MooTools, hence the rf.Sparks demo isn&#8217;t working properly. The plugin itself hasn&#8217;t actually changed so should still work perfectly fine on your own site.</strong></p>
<p>This month&#8217;s jQuery plugin is one that creates an effect that I like to describe as &#8220;sparks&#8221;. We are currently using it on the <a href="http://redflex.co.uk">Redflex</a> splash page whilst we prepare for a new product launch.</p>
<p>From a code point of view it is a reasonably simple effect to produce, all we are doing is creating a whole bunch of <code class="codecolorer text twitlight"><span class="text">&lt;div/&gt;</span></code>s with an image inside them, and then move them about a bit.</p>
<p>For the sake of brevity I am not going to show you the whole plugin code. If you want to go into more detail than I&#8217;m going to here download the <span class="bold">development</span> version at the bottom of the page. Instead I&#8217;m going to dive right in and show you how to use it.</p>
<p><span id="more-74"></span></p>
<h2>Hello, <del>World</del> Sparks</h2>
<p>The simplest usage of the plugin is by calling:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">sparks</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>where <code class="codecolorer text twitlight"><span class="text">#container</span></code> is the element that you want to display the sparks in. It renders 10 sparks with the image <code class="codecolorer text twitlight"><span class="text">/img/sparks/spark.png</span></code> and a speed of 5.</p>
<h2>Customising Sparks</h2>
<p>The plugin is very versatile, you can create as many instances with as many images and/or speeds as you want. <span class="small highlight"><span class="bold">Please note:</span> with large numbers of sparks you may notice a significant performance hit.</span></p>
<p>Creating your own custom sparks is as simple as:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">sparks</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; number<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span> <span style="color: #006600; font-style: italic;">// how many sparks to create</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; speed<span style="color: #339933;">:</span> &nbsp;<span style="color: #CC0000;">5</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #006600; font-style: italic;">// how fast you want this to move</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; img<span style="color: #339933;">:</span> <span style="color: #3366CC;">'/img/sparks/custom-spark.png'</span> <span style="color: #006600; font-style: italic;">// the spark image</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>If you want to have different images for your sparks (like the <a href="http://redflex.co.uk">Redflex</a> splash page) then you just need to add another array to the plugin options. For example:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">sparks</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// custom spark 1</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; number<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; speed<span style="color: #339933;">:</span> &nbsp;<span style="color: #CC0000;">5</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; img<span style="color: #339933;">:</span> &nbsp; &nbsp;<span style="color: #3366CC;">'/img/sparks/custom-spark.png'</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// custom spark 2</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; number<span style="color: #339933;">:</span> <span style="color: #CC0000;">5</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; speed<span style="color: #339933;">:</span> &nbsp;<span style="color: #CC0000;">3</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; img<span style="color: #339933;">:</span> &nbsp; &nbsp;<span style="color: #3366CC;">'/img/sparks/custom-spark2.png'</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>Simples, eh?</p>
<h2>Demo</h2>
<style type="text/css">
.post img { background: transparent; border: 0; margin: 0; padding: 0; }
</style>
<div id="sparks-container" style="position:relative;background:url(/downloads/rf_sparks/background.jpg) no-repeat;height:313px"></div>
<div style="float:right;font-size:10px">Background by <a href="http://www.flickr.com/photos/8078381@N03/3224470179/">pareeerica</a></div>
<p><script type="text/javascript" src="/downloads/rf_sparks/custom.rf.sparks.js"></script></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#sparks-container'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">sparks</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; number<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; speed<span style="color: #339933;">:</span> &nbsp;<span style="color: #CC0000;">5</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; img<span style="color: #339933;">:</span> &nbsp; &nbsp;<span style="color: #3366CC;">'/downloads/rf_sparks/spark.png'</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<h2>Download</h2>
<ul>
<li><a href="/downloads/rf_sparks/rf.sparks.min.js">Minified</a> <small>(1.2KB Gzipped)</small></li>
<li><a href="/downloads/rf_sparks/rf.sparks.pack.js">Packed</a> <small>(1.4KB Gzipped)</small></li>
<li><a href="/downloads/rf_sparks/rf.sparks.js">Development version</a> <small>(1.5KB Gzipped)</small></li>
<li>or <a href="http://github.com/mattkirman/jquery-sparks" class="highlight">fork it on GitHub</a></li>
</ul>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/H2ufOJNYwO0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/05/20/jquery-plugin-rfsparks/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/05/20/jquery-plugin-rfsparks/</feedburner:origLink></item>
		<item>
		<title>How to recreate the Konami code in Javascript</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/Y1w0TXJ_RNo/</link>
		<comments>http://mattkirman.com/2009/05/11/how-to-recreate-the-konami-code-in-javascript/#comments</comments>
		<pubDate>Mon, 11 May 2009 14:22:57 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[konami]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=63</guid>
		<description><![CDATA[Facebook has featured in social media blogs recently for adding a Konami code Easter egg in their home page. In this blog post I show you how to add similar &#8220;functionality&#8221; to your site using Javascript. First, the full code: 123456789101112131415161718192021// check to make sure that the browser can handle window.addEventListener if &#40;window.addEventListener&#41; &#123; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Facebook has featured in social media blogs recently for adding a <a href="http://en.wikipedia.org/wiki/Konami_code">Konami code</a> <a href="http://en.wikipedia.org/wiki/Easter_egg_(media)">Easter egg</a> in their home page. In this blog post I show you how to add similar &#8220;functionality&#8221; to your site using Javascript.</p>
<p>First, the full code:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">// check to make sure that the browser can handle window.addEventListener</span><br />
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>window.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// create the keys and konami variables</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> keys <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; konami <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;38,38,40,40,37,39,37,39,66,65&quot;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// bind the keydown event to the Konami function</span><br />
&nbsp; &nbsp; window.<span style="color: #660066;">addEventListener</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;keydown&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// push the keycode to the 'keys' array</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; keys.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>e.<span style="color: #660066;">keyCode</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// and check to see if the user has entered the Konami code</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>keys.<span style="color: #660066;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">indexOf</span><span style="color: #009900;">&#40;</span>konami<span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;=</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// do something such as:</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// alert('Konami');</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// and finally clean up the keys array</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; keys <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p>The script adds a callback function to the <var>keydown</var> event which stores the keycode in the <var>keys</var> array. It then checks the array against the pre-defined <var>konami</var> array (which contains a keycoded version of the Konami code).</p>
<p>Found the Konami code (or any other easter eggs) on the web? Let me know in the comments.</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/Y1w0TXJ_RNo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/05/11/how-to-recreate-the-konami-code-in-javascript/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/05/11/how-to-recreate-the-konami-code-in-javascript/</feedburner:origLink></item>
		<item>
		<title>Why fee is better than free</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/_3q8r9Ude98/</link>
		<comments>http://mattkirman.com/2009/04/23/why-fee-is-better-than-free/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 12:00:54 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Thoughts]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[freemium]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=57</guid>
		<description><![CDATA[There is a major problem with the approach of many internet based companies. Don&#8217;t get me wrong, I&#8217;m as much a fan of them as anybody, but if they want to survive they need to get smart. And fast. Very simply, the majority of internet based companies are not self-sufficient. Without massive injections of cash [...]]]></description>
			<content:encoded><![CDATA[<p>There is a major problem with the approach of many internet based companies. Don&#8217;t get me wrong, I&#8217;m as much a fan of them as anybody, but if they want to survive they need to get smart. And fast.</p>
<p>Very simply, the majority of internet based companies are not self-sufficient. Without massive injections of cash from their investors/founders they would not survive their first year in business. This is due to their inability to raise any revenue from their user base.</p>
<p><span id="more-57"></span></p>
<p>Let&#8217;s have a look at <a href="http://twitter.com">Twitter</a>, the media&#8217;s web application of the moment. In the three years since the application was created they have only managed to survive through their very generous investors which have pumped a massive $55 million into the company. And the best bit? They still haven&#8217;t made any money and don&#8217;t appear to have any idea of how to go about changing the status quo.</p>
<p>But it doesn&#8217;t stop there. According to a recent report by Credit Suisse, <a href="http://youtube.com">YouTube</a> is on track to lose it&#8217;s parent company <a href="http://google.com">Google</a> roughly $470 million in 2009 alone. By anyone&#8217;s books that is a bitter pill to swallow. And then of course there is the social network <a href="http://facebook.com">Facebook</a> that has plumetted in value from $12 billion in 2008 to only $4 billion today.</p>
<p>There is a very obvious conclusion to draw from these statistics &#8211; that free, advertising supported services simply do not work in their current guise. Of course, many companies are now adopting a <a href="http://en.wikipedia.org/wiki/Freemium">freemium</a> business model with mixed success but, after all, you just can&#8217;t beat a company that is offering a similar product for free.</p>
<p>Therefore, I suggest that companies try to re-educate people about the true value of the price tag. It isn&#8217;t simply a way to part people from their hard earned cash &#8211; it&#8217;s a sign of company confidence in a truly great product.</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/_3q8r9Ude98" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/04/23/why-fee-is-better-than-free/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/04/23/why-fee-is-better-than-free/</feedburner:origLink></item>
		<item>
		<title>jQuery Plugin: rf.Highlight</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/vHS0I1kfvPE/</link>
		<comments>http://mattkirman.com/2009/04/11/jquery-plugin-rfhighlight/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 10:34:27 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Downloads]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[rfhighlight]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=21</guid>
		<description><![CDATA[[Update] I’ve recently changed my JavaScript framework to MooTools, hence the rf.Highlight demo isn’t working properly. The plugin itself hasn’t actually changed so should still work perfectly fine on your own site. I needed a simple implementation of the famous Yellow Fade Technique (YFT) for a new product that we are developing at Redflex. We [...]]]></description>
			<content:encoded><![CDATA[<p><strong>[Update] I’ve recently changed my JavaScript framework to MooTools, hence the rf.Highlight demo isn’t working properly. The plugin itself hasn’t actually changed so should still work perfectly fine on your own site.</strong></p>
<p>I needed a simple implementation of the famous <a href="http://www.37signals.com/svn/archives/000558.php">Yellow Fade Technique</a> (YFT) for a new product that we are developing at <a href="http://redflex.co.uk">Redflex</a>. We struggled to find a YFT jQuery plugin that was simple to use, had a small file size and supported chaining. I give you rf.Highlight.</p>
<p>To highlight an element simply call:</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">highlight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p>And, of course, it is also customisable (default values are shown):</p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#element'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">highlight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; color<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span><span style="color: #CC0000;">255</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">255</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">187</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #006600; font-style: italic;">// rgb color of the fade (yep, it doesn't have to be yellow!)</span><br />
&nbsp; &nbsp; duration<span style="color: #339933;">:</span> <span style="color: #CC0000;">400</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #006600; font-style: italic;">// duration of the fade in milliseconds</span><br />
&nbsp; &nbsp; quality<span style="color: #339933;">:</span> <span style="color: #CC0000;">20</span><span style="color: #339933;">,</span> &nbsp;<span style="color: #006600; font-style: italic;">// quality of the fade (the higher the number the better)</span><br />
&nbsp; &nbsp; wait<span style="color: #339933;">:</span> <span style="color: #CC0000;">3000</span> &nbsp;<span style="color: #006600; font-style: italic;">// initial pause before the element starts to fade</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<p><span id="more-21"></span></p>
<p>Because it relies on RGBa browser support for the fade it is only compatible with Firefox 3, Safari 3.2+ and Google Chrome. On unsupported browsers you will get the yellow highlight to transparency but without the fancy fading transition.</p>
<h2>Demo</h2>
<div id="highlight_demo" style="cursor:pointer;font-size:14px;color:#fff">Click me!</div>
<p><script type="text/javascript" src="http://mattkirman.com/downloads/rf_highlight/rf.Highlight.min.js"></script><script type="text/javascript">
    $('#highlight_demo').click(function(e){
        $(this).highlight();
    });
</script></p>
<div class="codecolorer-container javascript twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'#highlight_demo'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">click</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>e<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">highlight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<h2>Download rf.Highlight</h2>
<ul>
<li><a href="http://mattkirman.com/downloads/rf_highlight/rf.Highlight.min.js">Minified</a> <small>(0.9KB Gzipped)</small></li>
<li><a href="http://mattkirman.com/downloads/rf_highlight/rf.Highlight.pack.js">Packed</a> <small>(1.2KB Gzipped)</small></li>
<li><a href="http://mattkirman.com/downloads/rf_highlight/rf.Highlight.js">Development version</a> <small>(1.0KB Gzipped)</small></li>
</ul>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/vHS0I1kfvPE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/04/11/jquery-plugin-rfhighlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/04/11/jquery-plugin-rfhighlight/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 2.107 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-09-04 21:26:58 -->
