<?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>Mon, 25 Jan 2010 22:07:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</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>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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F11%2F13%2Fyui-compressor-textmate-bundle%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F11%2F13%2Fyui-compressor-textmate-bundle%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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>3</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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F11%2F10%2Fgoogle-closure-compiler-textmate-bundle%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F11%2F10%2Fgoogle-closure-compiler-textmate-bundle%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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 &#8211; something akin to the <a href="http://www.experienceinternet.co.uk/resources/details/yui-compressor-textmate-bundle/" target="_blank">YUI Compressor bundle</a> &#8211; 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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F10%2F12%2Fequal-height-columns-with-pure-css%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F10%2F12%2Fequal-height-columns-with-pure-css%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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>margin</code>, <code>padding</code> and <code>float</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="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000"><span style="color: #009900;">&lt;<span style="color:#000;font-weight:bold">div</span> <span style="color:#900;font-weight:bold">id</span><span style="color:#000">=</span><span style="color:#D14">&quot;wrapper&quot;</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color:#000;font-weight:bold">div</span> <span style="color:#900;font-weight:bold">id</span><span style="color:#000">=</span><span style="color:#D14">&quot;content&quot;</span>&gt;</span>
        ...
    <span style="color: #009900;">&lt;<span style="color:#000">/</span><span style="color:#000;font-weight:bold">div</span>&gt;</span>
    <span style="color: #009900;">&lt;<span style="color:#000;font-weight:bold">div</span> <span style="color:#900;font-weight:bold">id</span><span style="color:#000">=</span><span style="color:#D14">&quot;sidebar&quot;</span>&gt;</span>
        ...
    <span style="color: #009900;">&lt;<span style="color:#000">/</span><span style="color:#000;font-weight:bold">div</span>&gt;</span>
<span style="color: #009900;">&lt;<span style="color:#000">/</span><span style="color:#000;font-weight:bold">div</span>&gt;</span></pre></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="wp_syntax"><div class="code"><pre class="css" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000"><span style="color:#900;font-weight:bold">#wrapper</span> <span style="color:#000">&#123;</span>
    <span style="color:#000;font-weight:bold">margin</span><span style="color:#000">:</span> <span style="color:#099">0</span> <span style="color:#000;font-weight:bold">auto</span><span style="color:#000">;</span>    <span style="color:#998;font-style:italic">/* Center the wrapper horizontally */</span>
    <span style="color:#000;font-weight:bold">overflow</span><span style="color:#000">:</span> <span style="color:#000;font-weight:bold">hidden</span><span style="color:#000">;</span>
    <span style="color:#000;font-weight:bold">width</span><span style="color:#000">:</span> <span style="color:#108888">500px</span><span style="color:#000">;</span>
<span style="color:#000">&#125;</span>
&nbsp;
<span style="color:#900;font-weight:bold">#content</span><span style="color:#000">,</span> <span style="color:#900;font-weight:bold">#sidebar</span> <span style="color:#000">&#123;</span>
    <span style="color:#000;font-weight:bold">margin-bottom</span><span style="color:#000">:</span> <span style="color:#108888">-10000px</span><span style="color:#000">;</span>
    <span style="color:#000;font-weight:bold">padding-bottom</span><span style="color:#000">:</span> <span style="color:#108888">100000px</span><span style="color:#000">;</span>
<span style="color:#000">&#125;</span>
&nbsp;
<span style="color:#900;font-weight:bold">#content</span> <span style="color:#000">&#123;</span>
    <span style="color:#000;font-weight:bold">float</span><span style="color:#000">:</span> <span style="color:#000;font-weight:bold">right</span><span style="color:#000">;</span>
    <span style="color:#000;font-weight:bold">width</span><span style="color:#000">:</span> <span style="color:#108888">300px</span><span style="color:#000">;</span>
<span style="color:#000">&#125;</span>
&nbsp;
<span style="color:#900;font-weight:bold">#sidebar</span> <span style="color:#000">&#123;</span>
    <span style="color:#000;font-weight:bold">float</span><span style="color:#000">:</span> <span style="color:#000;font-weight:bold">left</span><span style="color:#000">;</span>
    <span style="color:#000;font-weight:bold">width</span><span style="color:#000">:</span> <span style="color:#108888">200px</span><span style="color:#000">;</span>
<span style="color:#000">&#125;</span></pre></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>overflow: hidden</code> selector on the wrapper and the large <code>padding-bottom</code> and negative <code>margin-bottom</code>. Any padding is hidden when setting the overflow of the container to hidden. Basically, this means that by setting a large enough <code>padding-bottom</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>margin-bottom</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>height</code> of the container this wouldn&#8217;t have worked, and without the negative <code>margin-bottom</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>margin-bottom</code> to be equal and negative of the <code>padding-bottom</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>float: right</code> on the <code>#sidebar</code> and <code>float: left</code> on the <code>#content</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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F10%2F08%2Fblog-redesign-4-and-why-the-wordpress-plugin-api-needs-fixing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F10%2F08%2Fblog-redesign-4-and-why-the-wordpress-plugin-api-needs-fixing%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F09%2F17%2Fusing-capistrano-to-deploy-php%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F09%2F17%2Fusing-capistrano-to-deploy-php%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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>git pull</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>git pull</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>sudo gem install capistrano</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>cap -T</code> to see a list of your Capistrano recipes. By default Capistrano includes the <code>invoke</code> and <code>shell</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>deploy</code> namespace:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">set <span style="color:#108888">:web_directory</span>, <span style="color:#D14">&quot;the deployed file location&quot;</span>
set <span style="color:#108888">:branch</span>, <span style="color:#D14">&quot;origin/master&quot;</span>
&nbsp;
role <span style="color:#108888">:server</span>, <span style="color:#D14">&quot;your server address&quot;</span>
&nbsp;
namespace <span style="color:#108888">:deploy</span> <span style="color:#000;font-weight:bold">do</span>
    desc <span style="color:#D14">&quot;Updates the code on the server&quot;</span>
    task <span style="color:#108888">:default</span>, <span style="color:#108888">:roles</span> <span style="color:#000">=&gt;</span> <span style="color:#108888">:server</span>, <span style="color:#108888">:except</span> <span style="color:#000">=&gt;</span> <span style="color:#000">&#123;</span> <span style="color:#108888">:no_release</span> <span style="color:#000">=&gt;</span> <span style="color:#000;font-weight:bold">true</span> <span style="color:#000">&#125;</span> <span style="color:#000;font-weight:bold">do</span>
        run <span style="color:#000">&#91;</span> <span style="color:#D14">&quot;cd #{web_directory}&quot;</span>,
              <span style="color:#D14">&quot;git fetch origin&quot;</span>,
              <span style="color:#D14">&quot;git reset --hard #{branch}&quot;</span> <span style="color:#000">&#93;</span>.<span style="color:#900;font-weight:bold">join</span><span style="color:#000">&#40;</span><span style="color:#D14">&quot;; &quot;</span><span style="color:#000">&#41;</span>
    <span style="color:#000;font-weight:bold">end</span>
&nbsp;
    desc <span style="color:#D14">&quot;Rollback a single commit on the server&quot;</span>
    task <span style="color:#108888">:rollback</span>, <span style="color:#108888">:roles</span> <span style="color:#000">=&gt;</span> <span style="color:#108888">:server</span>, <span style="color:#108888">:except</span> <span style="color:#000">=&gt;</span> <span style="color:#000">&#123;</span> <span style="color:#108888">:no_release</span> <span style="color:#000">=&gt;</span> <span style="color:#000;font-weight:bold">true</span> <span style="color:#000">&#125;</span> <span style="color:#000;font-weight:bold">do</span>
        set <span style="color:#108888">:branch</span>, <span style="color:#D14">&quot;HEAD^&quot;</span>,
        default
    <span style="color:#000;font-weight:bold">end</span>
<span style="color:#000;font-weight:bold">end</span></pre></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>cap deploy</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>Introducing Hydrogen</title>
		<link>http://feedproxy.google.com/~r/MattKirman/~3/m5jsrRlSkjk/</link>
		<comments>http://mattkirman.com/2009/08/21/introducing-hydrogen/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 21:09:17 +0000</pubDate>
		<dc:creator>Matt</dc:creator>
				<category><![CDATA[Redflex]]></category>
		<category><![CDATA[hydrogen]]></category>

		<guid isPermaLink="false">http://mattkirman.com/?p=110</guid>
		<description><![CDATA[Originally posted at Redflex. - - We&#8217;re really excited to annouce our newest product, Hydrogen. So what exactly is it? Hydrogen is what we like to call a &#8220;support-centric discussion area&#8221;, it is a place where you and your customers can submit any problems, questions or ideas that they may have. We built Hydrogen for [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F08%2F21%2Fintroducing-hydrogen%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F08%2F21%2Fintroducing-hydrogen%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Originally posted at <a href="http://redflex.co.uk/blog/1">Redflex</a>.</p>
<p>- -</p>
<p>We&#8217;re really excited to annouce our newest product, <a href="http://hydrogenapp.com/">Hydrogen</a>. So what exactly is it? Hydrogen is what we like to call a &#8220;support-centric discussion area&#8221;, it is a place where you and your customers can submit any problems, questions or ideas that they may have.</p>
<p><img src="http://redflex.co.uk/img/blog/1/hydrogen.jpg" alt="Hydrogen promo image" style="width:510px" /></p>
<p>We built Hydrogen for one simple reason, all the other help desk / support applications available are either too bloated or too complicated to use. Customer support should be easy, with the minimum of padding between you and your customers.</p>
<p><span id="more-110"></span></p>
<h3>Support applications should be quick &amp; easy</h3>
<p>Hydrogen is designed to be quick to learn and easy for developers to extend. Set up your account in less than a minute, add your support staff and start communicating with your customers almost instantly.</p>
<h3>Support applications should be part of your brand</h3>
<p>You can change the design of Hydrogen, with few limitations, by adding your own custom CSS. It is even possible to keep your own domain name for your Hydrogen account. All Hydrogen accounts also get their own <em>account</em>.hydrogenapp.com subdomain.</p>
<h3>Support applications should be tailored for your company</h3>
<p>Whatever the size of your company, we&#8217;ve got a Hydrogen plan to suit. Paying plans start at a very competitive &pound;9.95 per month with no limit on the number of products you can add to your account.</p>
<h3>Support applications should be easily extendable</h3>
<p>With our REST API <em>(currently in private beta)</em> it&#8217;s possible for third-party developers to build upon our already extensive service. We strongly believe in data portability and with an open API none of your data is locked in.</p>
<h3>This is just the beginning</h3>
<p>Hydrogen is a brand new product and there are already some major updates that we&#8217;ve got planned for the next few weeks. The best way to keep up with new features and updates is by keeping an eye on <a href="http://redflex.co.uk/blog">our blog</a> or by following <a href="http://twitter.com/redflex">@redflex</a> and <a href="http://twitter.com/hydrogenapp">@hydrogenapp</a>.</p>
<p>So what are you waiting for? <a href="http://redflex.co.uk/hydrogen/plans">Sign up for a new installation</a>. There&#8217;s no restrictions or credit card required for the first 15 days &mdash; what have you got to lose?</p>
<img src="http://feeds.feedburner.com/~r/MattKirman/~4/m5jsrRlSkjk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://mattkirman.com/2009/08/21/introducing-hydrogen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://mattkirman.com/2009/08/21/introducing-hydrogen/</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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F05%2F20%2Fjquery-plugin-rfsparks%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F05%2F20%2Fjquery-plugin-rfsparks%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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>&lt;div/&gt;</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="wp_syntax"><div class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">$<span style="color:#000">&#40;</span><span style="color:#D14">'#container'</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">sparks</span><span style="color:#000">&#40;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span></pre></div></div>

<p>where <code>#container</code> is the element that you want to display the sparks in. It renders 10 sparks with the image <code>/img/sparks/spark.png</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="wp_syntax"><div class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">$<span style="color:#000">&#40;</span><span style="color:#D14">'#container'</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">sparks</span><span style="color:#000">&#40;</span><span style="color:#000">&#91;</span>
    <span style="color:#000">&#123;</span>
        number<span style="color:#000">:</span> <span style="color:#099">10</span><span style="color:#000">,</span> <span style="color:#998;font-style:italic">// how many sparks to create</span>
        speed<span style="color:#000">:</span>  <span style="color:#099">5</span><span style="color:#000">,</span>  <span style="color:#998;font-style:italic">// how fast you want this to move</span>
        img<span style="color:#000">:</span> <span style="color:#D14">'/img/sparks/custom-spark.png'</span> <span style="color:#998;font-style:italic">// the spark image</span>
    <span style="color:#000">&#125;</span>
<span style="color:#000">&#93;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span></pre></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="wp_syntax"><div class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">$<span style="color:#000">&#40;</span><span style="color:#D14">'#container'</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">sparks</span><span style="color:#000">&#40;</span><span style="color:#000">&#91;</span>
    <span style="color:#998;font-style:italic">// custom spark 1</span>
    <span style="color:#000">&#123;</span>
        number<span style="color:#000">:</span> <span style="color:#099">10</span><span style="color:#000">,</span>
        speed<span style="color:#000">:</span>  <span style="color:#099">5</span><span style="color:#000">,</span>
        img<span style="color:#000">:</span>    <span style="color:#D14">'/img/sparks/custom-spark.png'</span>
    <span style="color:#000">&#125;</span><span style="color:#000">,</span>
&nbsp;
    <span style="color:#998;font-style:italic">// custom spark 2</span>
    <span style="color:#000">&#123;</span>
        number<span style="color:#000">:</span> <span style="color:#099">5</span><span style="color:#000">,</span>
        speed<span style="color:#000">:</span>  <span style="color:#099">3</span><span style="color:#000">,</span>
        img<span style="color:#000">:</span>    <span style="color:#D14">'/img/sparks/custom-spark2.png'</span>
    <span style="color:#000">&#125;</span>
<span style="color:#000">&#93;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span></pre></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="wp_syntax"><div class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">$<span style="color:#000">&#40;</span><span style="color:#D14">'#sparks-container'</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">sparks</span><span style="color:#000">&#40;</span><span style="color:#000">&#91;</span>
    <span style="color:#000">&#123;</span>
        number<span style="color:#000">:</span> <span style="color:#099">10</span><span style="color:#000">,</span>
        speed<span style="color:#000">:</span>  <span style="color:#099">5</span><span style="color:#000">,</span>
        img<span style="color:#000">:</span>    <span style="color:#D14">'/downloads/rf_sparks/spark.png'</span>
    <span style="color:#000">&#125;</span>
<span style="color:#000">&#93;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span></pre></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: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F05%2F11%2Fhow-to-recreate-the-konami-code-in-javascript%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F05%2F11%2Fhow-to-recreate-the-konami-code-in-javascript%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000"><span style="color:#998;font-style:italic">// check to make sure that the browser can handle window.addEventListener</span>
<span style="color:#000;font-weight:bold">if</span> <span style="color:#000">&#40;</span>window.<span style="color:#900;font-weight:bold">addEventListener</span><span style="color:#000">&#41;</span> <span style="color:#000">&#123;</span>
    <span style="color:#998;font-style:italic">// create the keys and konami variables</span>
    <span style="color:#000;font-weight:bold">var</span> keys <span style="color:#000">=</span> <span style="color:#000">&#91;</span><span style="color:#000">&#93;</span><span style="color:#000">,</span>
        konami <span style="color:#000">=</span> <span style="color:#D14">&quot;38,38,40,40,37,39,37,39,66,65&quot;</span><span style="color:#000">;</span>
&nbsp;
    <span style="color:#998;font-style:italic">// bind the keydown event to the Konami function</span>
    window.<span style="color:#900;font-weight:bold">addEventListener</span><span style="color:#000">&#40;</span><span style="color:#D14">&quot;keydown&quot;</span><span style="color:#000">,</span> <span style="color:#000;font-weight:bold">function</span><span style="color:#000">&#40;</span>e<span style="color:#000">&#41;</span><span style="color:#000">&#123;</span>
        <span style="color:#998;font-style:italic">// push the keycode to the 'keys' array</span>
        keys.<span style="color:#900;font-weight:bold">push</span><span style="color:#000">&#40;</span>e.<span style="color:#900;font-weight:bold">keyCode</span><span style="color:#000">&#41;</span><span style="color:#000">;</span>
&nbsp;
        <span style="color:#998;font-style:italic">// and check to see if the user has entered the Konami code</span>
        <span style="color:#000;font-weight:bold">if</span> <span style="color:#000">&#40;</span>keys.<span style="color:#900;font-weight:bold">toString</span><span style="color:#000">&#40;</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">indexOf</span><span style="color:#000">&#40;</span>konami<span style="color:#000">&#41;</span> <span style="color:#000">&gt;=</span> <span style="color:#099">0</span><span style="color:#000">&#41;</span> <span style="color:#000">&#123;</span>
            <span style="color:#998;font-style:italic">// do something such as:</span>
            <span style="color:#998;font-style:italic">// alert('Konami');</span>
&nbsp;
            <span style="color:#998;font-style:italic">// and finally clean up the keys array</span>
            keys <span style="color:#000">=</span> <span style="color:#000">&#91;</span><span style="color:#000">&#93;</span><span style="color:#000">;</span>
        <span style="color:#000">&#125;</span><span style="color:#000">;</span>
    <span style="color:#000">&#125;</span><span style="color:#000">,</span> <span style="color:#000;font-weight:bold">true</span><span style="color:#000">&#41;</span><span style="color:#000">;</span>
<span style="color:#000">&#125;</span><span style="color:#000">;</span></pre></td></tr></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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F04%2F23%2Fwhy-fee-is-better-than-free%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F04%2F23%2Fwhy-fee-is-better-than-free%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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[<div class="tweetmeme_button" style="float: right; margin-left: 10px;margin-right:-25px;margin-top:3px">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fmattkirman.com%2F2009%2F04%2F11%2Fjquery-plugin-rfhighlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fmattkirman.com%2F2009%2F04%2F11%2Fjquery-plugin-rfhighlight%2F&amp;source=mattkirman&amp;style=compact&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<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="wp_syntax"><div class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">$<span style="color:#000">&#40;</span><span style="color:#D14">'#element'</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">highlight</span><span style="color:#000">&#40;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span></pre></div></div>

<p>And, of course, it is also customisable (default values are shown):</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">$<span style="color:#000">&#40;</span><span style="color:#D14">'#element'</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">highlight</span><span style="color:#000">&#40;</span><span style="color:#000">&#123;</span>
    color<span style="color:#000">:</span> <span style="color:#000">&#91;</span><span style="color:#099">255</span><span style="color:#000">,</span> <span style="color:#099">255</span><span style="color:#000">,</span> <span style="color:#099">187</span><span style="color:#000">&#93;</span><span style="color:#000">,</span>  <span style="color:#998;font-style:italic">// rgb color of the fade (yep, it doesn't have to be yellow!)</span>
    duration<span style="color:#000">:</span> <span style="color:#099">400</span><span style="color:#000">,</span>  <span style="color:#998;font-style:italic">// duration of the fade in milliseconds</span>
    quality<span style="color:#000">:</span> <span style="color:#099">20</span><span style="color:#000">,</span>  <span style="color:#998;font-style:italic">// quality of the fade (the higher the number the better)</span>
    wait<span style="color:#000">:</span> <span style="color:#099">3000</span>  <span style="color:#998;font-style:italic">// initial pause before the element starts to fade</span>
<span style="color:#000">&#125;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span></pre></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:#000">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="wp_syntax"><div class="code"><pre class="javascript" style="font-family:'Bitstream Vera Sans Mono',Monaco,Courier,monospace;background:#f8f8ff;padding:5px 8px;border:1px solid #dedede;color:/*#108888*/#000">$<span style="color:#000">&#40;</span><span style="color:#D14">'#highlight_demo'</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">click</span><span style="color:#000">&#40;</span><span style="color:#000;font-weight:bold">function</span><span style="color:#000">&#40;</span>e<span style="color:#000">&#41;</span><span style="color:#000">&#123;</span>
    $<span style="color:#000">&#40;</span><span style="color:#000;font-weight:bold">this</span><span style="color:#000">&#41;</span>.<span style="color:#900;font-weight:bold">highlight</span><span style="color:#000">&#40;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span>
<span style="color:#000">&#125;</span><span style="color:#000">&#41;</span><span style="color:#000">;</span></pre></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 3.824 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-07-22 20:30:14 -->
