<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/rss2full.xsl" type="text/xsl" media="screen"?><?xml-stylesheet href="http://feeds.feedburner.com/~d/styles/itemcontent.css" type="text/css" media="screen"?><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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>remy sharp's b:log</title>
	
	<link>http://remysharp.com</link>
	<description>About [code] and all that jazz</description>
	<pubDate>Mon, 06 Oct 2008 14:55:10 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<geo:lat>50.844973</geo:lat><geo:long>-0.143970</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/remysharp" type="application/rss+xml" /><item>
		<title>JS Bin for Collaborative JavaScript Debugging</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/412863705/</link>
		<comments>http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/#comments</comments>
		<pubDate>Mon, 06 Oct 2008 14:54:51 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[Code]]></category>

		<category><![CDATA[Dump]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/</guid>
		<description><![CDATA[The weekend before last I blitzed through an idea I had on the shelf for about 6 months and put it live under the name JS Bin.



What is it?

JS Bin is a form of paste bin, but with a twist. It allows you to also include the HTML and CSS to provide context to your [...]]]></description>
			<content:encoded><![CDATA[<p>The weekend before last I blitzed through an idea I had on the shelf for about 6 months and put it live under the name <a href="http://jsbin.com">JS Bin</a>.</p>

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

<h2>What is it?</h2>

<p>JS Bin is a form of paste bin, but with a twist. It allows you to also include the HTML and CSS to provide context to your pasty.  As such, it means you can actually run the JavaScript and pass this on to a colleague to help to debug.</p>

<p>A short list of features:</p>

<ul>
<li>Save private snippet</li>
<li>Remote Ajax debugging</li>
<li>Snippet URLs run entirely on their own (i.e. without the JS Bin framework around them)</li>
<li>Support to quickly inject major JS libraries</li>
<li>Saves state within the open window (i.e. refresh and the code doesn't reset)</li>
</ul>

<p>In addition, any code snippet can be edited.</p>

<p>Take this example: <a href="http://jsbin.com/utala/">query string aware JavaScript</a> (<a href="http://jsbin.com/utala/">http://jsbin.com/utala/</a>)</p>

<p>...to edit it, you just add '/edit' to the URL and you can modify the snippet yourself and save it as new:</p>

<p><a href="http://jsbin.com/utala/edit">http://jsbin.com/utala/edit</a></p>

<h2>Why?</h2>

<p>I had a conversation with <a href="http://www.reybango.com/">Rey Bango</a> some months ago where he was trying to debug a piece of code that had an Ajax hit.  He sent me the code, but without seeing it running I wasn't too much help to him.</p>

<p>I made a start some time ago offline and planned for a system to allow you to create fake Ajax handlers to respond to requests.</p>

<p>In the last couple of weeks I saw <a href="http://ejohn.org/apps/learn/">John Resig's learning app</a> and the sandbox idea suddenly had legs again. I knew I could write something very quickly, almost entirely in JavaScript (and since it's a JS debugger, there's no point in the extra work to make it degrade).</p>

<p>A small server side php file does the saving work (and maintaining old code snippets) and over the course of a few hours I had a fully working webapp that allows me to create Ajax responders and code snippets that run live and can make real Ajax calls.</p>

<h2>Examples</h2>

<p>I've recorded a couple of screencasts showing how it can be used:</p>

<ul>
<li><a href="http://jsbin.com/about#video">General introduction</a></li>
<li><a href="http://jsbin.com/about#ajax">Ajax debugging</a></li>
</ul>

<h2>Feedback</h2>

<p>If anyone has suggestions, feedback, bugs, etc - please let me know!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=akxym"><img src="http://feeds.feedburner.com/~f/remysharp?i=akxym" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/412863705" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/10/06/js-bin-for-collaborative-javascript-debugging/</feedburner:origLink></item>
		<item>
		<title>Query String Aware JavaScript</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/410200820/</link>
		<comments>http://remysharp.com/2008/10/03/query-string-aware-javascript/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 12:15:01 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/10/03/query-string-aware-javascript/</guid>
		<description><![CDATA[As developers we know it's useful to read the query string (everything after the '?' in the URL) to allow for customisations.

However, I didn't think I could read the query string in the script tag from within the JavaScript - until now.



The Trick

The trick is simple, in your externally loaded script, you read the last [...]]]></description>
			<content:encoded><![CDATA[<p>As developers we know it's useful to read the query string (everything after the '?' in the URL) to allow for customisations.</p>

<p>However, I didn't think I could read the query string in the script tag from within the JavaScript - until now.</p>

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

<h2>The Trick</h2>

<p>The trick is simple, in your externally loaded script, you read the last DOM element loaded (this script tag that loaded the current script), grab the last DOM element, read the <code>src</code> and there's your query string.</p>

<h2>The Code</h2>

<pre><code>// script included using test.js?a=10&amp;z=50
function getLastChild(el) {
  return (el.lastChild &#038;&#038; el.lastChild.nodeName != '#text') ? getLastChild(el.lastChild) : el;
}

var query = getLastChild(document.lastChild).getAttribute('src').replace(/.*\?/, '');</code></pre>

<p>The <code>query</code> variable now contains the full query string and can be used to change the result of your script.</p>

<p>I would then pass that in to my <a href="http://remysharp.com/2008/06/24/query-string-to-object-via-regex/">getQuery</a> function so I had access to it as an object.</p>

<h2>Demo</h2>

<p>I've created two separate snippets on <a href="http://jsbin.com">JS Bin</a> (my new weekend project), one containing the external script code (with <code>getQuery</code>) and one that makes the call:</p>

<ul>
<li><a href="http://jsbin.com/utala/">Demo of query string read</a> (<a href="http://jsbin.com/utala/edit/#html">source</a>)</li>
<li><a href="http://jsbin.com/oveve/js">Source of external script</a></li>
</ul>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=68ebm"><img src="http://feeds.feedburner.com/~f/remysharp?i=68ebm" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/410200820" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/10/03/query-string-aware-javascript/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/10/03/query-string-aware-javascript/</feedburner:origLink></item>
		<item>
		<title>Autocomplete &amp; even better twitter keys</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/399880088/</link>
		<comments>http://remysharp.com/2008/09/22/autocomplete-even-better-twitter-keys/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 15:23:31 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[project]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/09/22/autocomplete-even-better-twitter-keys/</guid>
		<description><![CDATA[So I've been going a bit greasemonkey mad of late, and with the recent release of Twitter Keys I quickly found myself wanting something like tab completion for the twitter keys.

A few hours of weekend playing later, I've got automatic Twitter keys (or optionally tab completed).  But I've also decided to take it a [...]]]></description>
			<content:encoded><![CDATA[<p>So I've been going a bit greasemonkey mad of late, and with the recent release of <a href="http://thenextweb.org/2008/09/16/twitterkeys-enhance-your-twitter-conversations/">Twitter Keys</a> I quickly found myself wanting something like tab completion for the twitter keys.</p>

<p>A few hours of weekend playing later, I've got automatic Twitter keys (or optionally tab completed).  But I've also decided to take it a little further and pull the autocomplete in to it's own greasemonkey script that can be run on any page.</p>

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

<p>There's two versions: </p>

<ol>
<li>Twitter Keys</li>
<li>Autocomplete for any site</li>
</ol>

<p><object width="400" height="300">   <param name="allowfullscreen" value="true" />   <param name="allowscriptaccess" value="always" />   <param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=1787506&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" />   <embed src="http://vimeo.com/moogaloop.swf?clip_id=1787506&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="300"></embed></object><br /><a href="http://vimeo.com/1787506?pg=embed&amp;sec=1787506">Twitter Keys via Greasemonkey</a> from <a href="http://vimeo.com/user449465?pg=embed&amp;sec=1787506">Remy Sharp</a> on <a href="http://vimeo.com?pg=embed&amp;sec=1787506">Vimeo</a>.</p>

<p>For now you'll have to use <a href="https://addons.mozilla.org/firefox/addon/748">Greasemonkey</a> to install (rather than a straight plugin), and if you want to add more shortcuts, you'll have to edit the script by hand - though I hope to create an interface soon.</p>

<p><a href="http://remysharp.com/downloads/tweet_upgrade.user.js">Get the twitter upgrade</a> or via <a href="http://userscripts.org/scripts/show/34004">userscripts.org</a></p>

<p>The autocomplete script (for use on any page) is available here:</p>

<p><a href="http://remysharp.com/downloads/auto_complete.user.js">Get the autocomplete script</a> or <a href="http://userscripts.org/scripts/show/34248">userscripts.org</a></p>

<p>Note that with autocomplete, you will need to open the greasemonkey script and add new shortcuts manually.  They only currently trigger on space (or new line).</p>

<h2>List of Twitter key auto completes</h2>

<p>You can poke around the code, but here's a list of all the keys:</p>

<div>
<div style="float: left;  width: 30%;">love : ♥<br />
plane : ✈<br />
smile : ☺<br /> <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> : ☺<br /> <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> : ☺<br />
music : ♬<br />
boxtick : ☑<br />
spade : ♠<br />
phone : ☎<br />
darksmile : ☻<br />
song : ♫<br />
box : ☒<br />
whitespade : ♤<br />
carrot : ☤<br />
sad :  ☹<br /> <img src='http://remysharp.com/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> : ☹<br /> <img src='http://remysharp.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> : ☹<br />
note : ♪<br />
female : ♀<br />
star : ✩<br />
letter : ✉<br />
pirate : ☠<br />
tick : ✔<br />
male : ♂<br />
darkstar : ★<br />
cross : ✖</div>
<div style="float: left;  width: 30%;">
cook : ♨<br />
random1 : ❦<br />
cloud : ☁<br />
peaceout : ✌<br />
king : ♛<br />
rose : ❁<br />
islam : ☪<br />
umbrella : ☂<br />
pen : ✏<br />
bishop : ♝<br />
flower : ❀<br />
tools : ☭<br />
snowman : ☃<br />
right : ☛<br />
-&gt; : ☛<br />
darkknight : ♞<br />
darkflower : ✿<br />
peace : ☮<br />
sun : ☼<br />
left : ☚<br />
&lt;- : ☚<br />
knight : ♘<br />
random2 : ✾<br />
ying : ☯<br />
christ : ✝</div>
<div style="float: left;  width: 30%;">
moon : ☾<br />
up : ☝<br />
rook : ♖<br />
snow : ✽<br />
comet : ☄<br />
down : ☟<br />
pawn : ♟<br />
random3 : ✺<br />
prince : ☥<br />
cut : ✂<br />
write : ✍<br />
queen : ♕<br />
darkstar2 : ✵<br />
copy : ©<br />
tm : ™<br />
euro : €<br />
&lt;&lt; : «<br />
&gt;&gt; : »<br />
yen : ¥<br />
wheel : ✇<br />
recycle : ♺<br />
retweet : ♺<br />
rt : ♺<br />
radioactive : ☢</div>
<div class="clear: left;"></div>
</div>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=1v6dl"><img src="http://feeds.feedburner.com/~f/remysharp?i=1v6dl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/399880088" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/09/22/autocomplete-even-better-twitter-keys/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/09/22/autocomplete-even-better-twitter-keys/</feedburner:origLink></item>
		<item>
		<title>Twitter Upgrades via Greasemonkey</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/397111743/</link>
		<comments>http://remysharp.com/2008/09/19/twitter-upgrades-via-greasemonkey/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 11:00:49 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://remysharp.com/?p=247</guid>
		<description><![CDATA[Quickly following on from my greasemonkey script yesterday, Josh Russell, local Brightonite, updated his (and Dave's Twitter search script.

So I've taken it upon myself to a) upgrade his script to work on all pages, not just the home page, and meld together my Twitter scripts with his moving towards (in my best deep Jerry Bruckheimer [...]]]></description>
			<content:encoded><![CDATA[<p>Quickly following on from my greasemonkey script yesterday, <a href="http://www.joshrussell.com">Josh Russell</a>, local Brightonite, <a href="http://www.joshrussell.com/2008/07/18/we-added-search-to-twitter/">updated</a> his (and <a href="http://builtbydave.co.uk/">Dave's</a> Twitter search script.</p>

<p>So I've taken it upon myself to a) upgrade his script to work on all pages, not just the home page, and meld together my Twitter scripts with his moving towards (in my best deep Jerry Bruckheimer voiceover voice): The Ultimate Twitter Upgrade Script!</p>

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

<p>I've also striped out the code that waited for the DOM to be ready - not sure why I did it in the first place, but it looks like the whole DOM is available to greasemonkey as soon as it hit the code - so it means the lat/long lookup is quicker.</p>

<p><a href="http://remysharp.com/downloads/tweet_upgrade.user.js">Get the twitter upgrade</a> or via <a href="http://userscripts.org/scripts/show/34004">userscripts.org</a></p>

<p>For more information on my bits of the script, <a href="http://remysharp.com/2008/09/17/tweet-offline-better-locations/">have a read of my initial post</a></p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=NXR4l"><img src="http://feeds.feedburner.com/~f/remysharp?i=NXR4l" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/397111743" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/09/19/twitter-upgrades-via-greasemonkey/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/09/19/twitter-upgrades-via-greasemonkey/</feedburner:origLink></item>
		<item>
		<title>Tweet offline &amp; better locations</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/395349233/</link>
		<comments>http://remysharp.com/2008/09/17/tweet-offline-better-locations/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 16:42:26 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[greasemonkey]]></category>

		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/09/17/tweet-offline-better-locations/</guid>
		<description><![CDATA[If you follow me on Twitter you'll have seen that I've been moaning a bit lot about using Twitter as an alternative to email or IM.

Rather than bitch and moan the whole time, I've made myself a solution: I can now pull a tweet in to an email and thus continue/create the conversation offline.

In addition, [...]]]></description>
			<content:encoded><![CDATA[<p>If you <a href="http://twitter.com/rem">follow me on Twitter</a> you'll have seen that I've been <a href="http://twitter.com/rem/statuses/906601822">moaning</a> a <del>bit</del> lot about using Twitter as an alternative to email or <abbr title="Instance messenger">IM</abbr>.</p>

<p>Rather than bitch and moan the whole time, I've made myself a solution: I can now pull a tweet in to an email and thus continue/create the conversation offline.</p>

<p>In <em>addition</em>, since I'm writing code that will parse the Twitter DOM, I might as well fix the latitude and longitude data that appears on Twitter (since I can't do geo mapping in my head).</p>

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

<p>I've done this as a <a href="https://addons.mozilla.org/en-US/firefox/addon/748">Greasemonkey</a> script:</p>

<p><a href="http://remysharp.com/downloads/tweet_upgrade.user.js">Tweet offline &amp; Locations</a></p>

<h2>Offline Replies</h2>

<p>It simply adds a reply icon to each tweet, which plugs the contents of the tweet in to the subject of an email allowing you to continue a conversation offline.</p>

<p><img src="http://remysharp.com/wp-content/uploads/2008/09/tweet-offline.png" alt="Tweet Offline" title="" /></p>

<p>It doesn't plug in the person's email address since Twitter's API doesn't (rightly) open that information up - but it's a quick convenient plug in.  I'm considering taking a look at <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">Ubiquity</a> to see if I can extend this to a plugin that you can continue the last conversation offline for X user.</p>

<h2>Locations</h2>

<p>With the iPhone having GPS or using the 'locate me' functionality, there are more Twitter profiles that show 'iPhone: lat,long' which doesn't mean anything to the regular user that can't map latitudes and longitudes in their head.  So, inside the twitter greasemonkey script, it will use Google to work out the actual location of the lat/long coordinates.</p>

<h3>Few examples</h3>

<p>Load up the Twitter greasemonkey script and take a look at a few people that have the lat/long on their Twitter profiles:</p>

<ul>
<li><a href="http://twitter.com/rem">rem</a></li>
<li><a href="http://twitter.com/shapeshed">shapeshed</a></li>
<li><a href="http://twitter.com/simonw">simonw</a></li>
</ul>

<h3>How's the techie stuff done?</h3>

<p>It's actually two calls to Google's API - but since it's done through your browser, there's no worry about hitting limits.  </p>

<p>The first call goes off an requests the directions from the lat/long combo <em>to</em> the same lat/long position.  This results in the road name being given.  This is used to zoom out a little bit more to give a reasonable description of the location.</p>

<p>The second call is to Google's <em>typical</em> geo mapping API, giving the street name from the first call and the original lat/long to help locate the street.  </p>

<p>The result is the full location in a string.</p>

<p>In some ways I wonder if this information is a little too much, knowing exactly which street the tweet was made, but then on the other hand, the lat/long is there in the first place, which is actually giving me this detail (I just can't work it out in my head!).</p>

<p>Aside from that, there's some nifty little iframe magic going on in the script to get around the sandboxing that greasemonkey does, so that I can hook JSONP callbacks in (the Google map requests).</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=T1f9l"><img src="http://feeds.feedburner.com/~f/remysharp?i=T1f9l" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/395349233" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/09/17/tweet-offline-better-locations/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/09/17/tweet-offline-better-locations/</feedburner:origLink></item>
		<item>
		<title>Big Three Oh - happy birthday to me!</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/391352354/</link>
		<comments>http://remysharp.com/2008/09/13/big-three-oh-happy-birthday-to-me/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 07:18:59 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Personal]]></category>

		<category><![CDATA[birthday]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/09/13/big-three-oh-happy-birthday-to-me/</guid>
		<description><![CDATA[I turned 30 years old, much to the dismay of my real world colleagues - who still think I'm 17! Perhaps if I shave my beard off...



I've actually been looking forward to turning 30.  I've been working towards this kind of "stable" version of myself over the last few years.  Getting to know [...]]]></description>
			<content:encoded><![CDATA[<p>I turned 30 years old, much to the dismay of my <em>real world</em> colleagues - who still think I'm 17! Perhaps if I shave my beard off...</p>

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

<p>I've actually been looking forward to turning 30.  I've been working towards this kind of "stable" version of myself over the last few years.  Getting to know myself (not that way you cheeky buggers) and understanding what I want.</p>

<p>In fact, the last year has been a pretty successful one for me:</p>

<ul>
<li>I started <a href="http://jqueryfordesigners.com/" title="jQuery for Designers - Tutorials and screencasts">jQuery for Designers</a> and it receives almost 3 times the amount of traffic compared to this blog and only contains 12 articles.</li>
<li>I've been approached about writing a book of jQuery for Designers - very flattering and plan to take it up.</li>
<li>I've done my <a href="http://remysharp.com/2008/03/13/presenting-jquery-at-qcon/">first</a> 3 <a href="http://remysharp.com/2008/07/09/updated-jquery-talk/">public speaking</a> gigs.</li>
<li>Finally got out of the flat and attended some local meetups (particularly <a href="http://skillswap-brighton.org/" title="SkillSwap Brighton">SkillSwaps</a>), and made a few friends in the process.</li>
<li><a href="http://leftlogic.com/" title="Left Logic - Brighton web development and design consultancy">Left Logic</a> (my business) is going very, very well.  Clients are approaching me for new and interesting work and I'm always excited when they've found me through one of my sites.</li>
<li>Finally resigned, entirely, from <a href="http://remysharp.com/about/">DL</a>, after 9 1/2 years, though have been scaling down the days over the last few years as I was given time to focus on building Left Logic.</li>
<li><a href="http://remysharp.com/2008/05/02/the-long-ride/">Cycled from London to Paris</a> (and <a href="http://icanhaz.com/london2paristweet">Tweeted it</a>)</li>
</ul>

<p>Finally, I'm most proud of myself, for attending the gym for the last 9 months, going 6-8 times a week and now I've got back down to the same waist size I was when I was 22 and clothes fit me again that I used to wear in the 90s...though apparently that's not a reason to wear my shiny tight red top according to my wife <img src='http://remysharp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':-D' class='wp-smiley' /> </p>

<p>I'm really looking forward to the next era of my life, I'm planning on moving to a co-working office space in Brighton (perhaps the Werks), I want to grow my business and take on employees who are as passionate about the web as I am, I'm thinking about running a workshop course at some point in the next year or two and I'm likely to have started a family with my <a href="http://flickr.com/photos/remysharp/2268940118/in/set-72157600666145464/">rockin' wife</a>.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=0LZTl"><img src="http://feeds.feedburner.com/~f/remysharp?i=0LZTl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/391352354" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/09/13/big-three-oh-happy-birthday-to-me/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/09/13/big-three-oh-happy-birthday-to-me/</feedburner:origLink></item>
		<item>
		<title>The Silky Smooth Marquee</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/388521108/</link>
		<comments>http://remysharp.com/2008/09/10/the-silky-smooth-marquee/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 09:55:16 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[html]]></category>

		<category><![CDATA[marquee]]></category>

		<category><![CDATA[plugin]]></category>

		<category><![CDATA[project]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/09/10/the-silky-smooth-marquee/</guid>
		<description><![CDATA[As we abused the Internet back in the 90 with tags like &#60;blink&#62; and &#60;marquee&#62; the last 10 years have seen the gradual extinction of these proprietary tags until we did full circle and the marquee effect appears in CSS 3.

There's actually a very strong business case and requirement for the marquee tag - since [...]]]></description>
			<content:encoded><![CDATA[<p>As we abused the Internet back in the 90 with tags like <code>&lt;blink&gt;</code> and <code>&lt;marquee&gt;</code> the last 10 years have seen the gradual extinction of these proprietary tags until we did full circle and the <a href="http://www.w3.org/TR/css3-marquee/">marquee effect appears in CSS 3</a>.</p>

<p>There's actually a very strong business case and requirement for the marquee tag - since the only the alternative is often a hacky solution (I feel) that shifts the CSS left position which, depending on your browser, will begin to eat away at your CPU.</p>

<p>Funnily enough, the marquee tag is pretty well supported amongst the browser, but the actual effect is poorly executed natively (which is kind of odd if it's built directly in to the browser).  So let's solve this with JavaScript.</p>

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

<h2>Demo</h2>

<p>This demonstration shows 3 <em>jQuerified</em> marquees and 3 standard marquees. You can see how the untouched marquees are jumpy to animate, even in the later browsers such as Firefox 3 and Safari - let alone IE6.</p>

<p><a href="http://remysharp.com/demo/marquee.html">Demonstration of jQuery Marquee</a></p>

<h2>Download</h2>

<p><a href="http://remysharp.com/downloads/jquery.marquee.js">Download jQuery marquee plugin</a></p>

<h2>Usage</h2>

<p>Include the <a href="http://jquery.com/">latest jQuery</a> and the plugin file via the <code>script</code> tag, then:</p>

<pre><code>$('marquee').marquee(optionalClass);</code></pre>

<p>Note that the enhanced marquee doesn't particularly have to apply to a marquee tag - but it is reading the effect details from the tag - currently it will default to behaviour = scroll, dir = left, speed = 2.  There's no (current) option for setting an overall default - but I'll add this if people feel it's required.</p>

<h2>How it Works</h2>

<p>There's a few solutions available that create a similar effect, but this plugin does two things differently:</p>

<ol>
<li>Progressively enhances the <code>marquee</code> tag making this plugin uber easy to use.</li>
<li>The effect is <strong>not</strong> achieved using CSS.  It's created using the overflow scroll on the element, which massively reduces the work the browser has to do - i.e. there's no re-rendering due to changes in CSS, it's scrolling using native functions of the browser.</li>
</ol>

<p>It's worth noting that behind the scenes, the <code>marquee</code> tag is being lifted out of the DOM and replaced with <code>div</code>s.  However, when it's chains in jQuery, it returns the new enhanced marquee <code>div</code>, so you can still hook click events, or navigate the DOM element if you wish - i.e. business as usual.</p>

<p>However, be warned - as we are lifting the <code>marquee</code>'s contents in to a new <code>div</code>, it means and predefined events or data will be lost.  To avoid this, make sure the marquee plugin is called before hand.</p>

<h2>Events</h2>

<p>The following events can be bound to:</p>

<ul>
<li>stop - triggers when a loop is completed</li>
<li>start - triggers when a loop is started</li>
<li>end - completely finishes the loops if set</li>
</ul>

<p>The follow events can be triggered by the user:</p>

<ul>
<li>pause/stop (both do the same thing)</li>
<li>unpause/start (both do the same thing)</li>
</ul>

<h2>Support</h2>

<p>I've written the marquee to run on a single timer function rather than one per marquee, the idea being that you <em>could</em> go crazy and add lots of marquees, and this code should scale<sup>&dagger;</sup>.  </p>

<p>Also, the marquee doesn't currently support <code>direction="up"</code> or <code>direction="down"</code>...yet.  Come back later and I'll upgrade if there's any interest.</p>

<p><small>&dagger; I've not tested it with more than 3 marquees yet - feel free to test and give feedback</small></p>

<h2>Other Uses</h2>

<p>I've played around with the implementation of the marquee and I've been able to easily create the effect of the user clicking and dragging the marquee back and forth - which is very smooth (note that before I start the drag effect, I need to trigger a stop event):</p>

<pre><code>$('div.demo marquee').marquee('pointer').mouseover(function () {
  $(this).trigger('stop');
}).mouseout(function () {
  $(this).trigger('start');
}).mousemove(function (event) {
  if ($(this).data('drag') == true) {
    this.scrollLeft = $(this).data('scrollX') + ($(this).data('x') - event.clientX);
  }
}).mousedown(function (event) {
  $(this).data('drag', true).data('x', event.clientX).data('scrollX', this.scrollLeft);
}).mouseup(function () {
  $(this).data('drag', false);
});</code></pre>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=UHoHl"><img src="http://feeds.feedburner.com/~f/remysharp?i=UHoHl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/388521108" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/09/10/the-silky-smooth-marquee/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/09/10/the-silky-smooth-marquee/</feedburner:origLink></item>
		<item>
		<title>dConstruct 08</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/386552177/</link>
		<comments>http://remysharp.com/2008/09/08/dconstruct-08/#comments</comments>
		<pubDate>Mon, 08 Sep 2008 10:12:25 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<category><![CDATA[conference]]></category>

		<category><![CDATA[dconstruct]]></category>

		<category><![CDATA[dconstruct08]]></category>

		<category><![CDATA[review]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/09/08/dconstruct-08/</guid>
		<description><![CDATA[dConstruct 08 is over for another year - and another year of great talks.

This year was much more focused on the theoretical than practical, which in retrospect, last year appealed to skills I was a lot more familiar with.  That being said, this years talks were superb, and stimulated a lot of conversation and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://2008.dconstruct.org/">dConstruct 08</a> is over for another year - and another year of great talks.</p>

<p>This year was much more focused on the theoretical than practical, which in retrospect, <a href="http://2007.dconstruct.org/">last year</a> appealed to skills I was a lot more familiar with.  That being said, this years talks were superb, and stimulated a lot of conversation and thought.</p>

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

<h2>Inspiring Talks</h2>

<p>My two favourite talks were by <a href="http://www.toastkid.com/" title="Aleks Krotoski">Aleks Krotoski</a>, and <a href="http://adactio.com/" title="Adactio: Jeremy Keith">Jeremy Keith</a>.</p>

<h3>Play</h3>

<p>Aleks talked about <a href="http://2008.dconstruct.org/schedule/AleksKrotoski.php">gaming and the web</a>, and although I'd heard some of the buzz on the Intertubes about how game play can be introduced to web sites, her talk really helped me visualise how that can be done, and opened my mind a little more beyond just using the Internet to deliver web pages.  </p>

<p>My biggest gripe with the console gaming world and the Internet is the proprietary BS that we're still seeing.  Though perhaps it's getting better - at least you can buy Guitar Hero 3 on a multitude of platforms.  My gripe is that, although GH3 has been developed by the same company, and multiplayer works via the web, and there <em>must</em> be a standardised protocol for joining players together: I can't play my Wii version of GH3 against my friend who has an Xbox 360.  WTF? </p>

<p>In a way, I see the Xbox Live subscription service a little like the IE6 of gaming.</p>

<h3>The Universe of Links</h3>

<p>I was warned by <a href="http://www.andybudd.com/" title="Andy Budd::Blogography">Andy Budd</a> earlier in the morning that 20% of people would probably get and love <a href="http://adactio.com/journal/1507/">Jeremy's talk</a>, the other 80% will think it's pretentious waffle.  </p>

<p>Whether that was a subtle reference to the <a href="http://en.wikipedia.org/wiki/Pareto_principle" title="Pareto principle - Wikipedia, the free encyclopedia">Pareto principle</a> or not - I actually (a little to my surprise) found the talk superb and inspiring.</p>

<p>I thought the talk was so good that I'm close to convincing my non-techie wife to listening to the podcast once it's available.</p>

<p>Some of the best bits:</p>

<ul>
<li><a href="http://en.wikipedia.org/wiki/Black_swan_theory">Black swans</a>, and our need to explain</li>
<li><a href="http://en.wikipedia.org/wiki/Small_world_experiment">Small world</a>, 6 degrees of separation - and our logically random minds not being able to accept it.</li>
<li>Not a particular point in the talk, but 6 degrees of separation is only successful from the weakest links in our social network, so therefore they're sometimes the best links to have. Something I'm trying to make use of in my "real world" starting today.</li>
</ul>

<h2>Post Conference</h2>

<p>As much as I love having my brain go crazy with inspiration and ideas, I always experience the same drop off after conferences: the distinct feeling that I must build something.</p>

<p>That <em>something</em> needs to both be of business value and challenging existing products.</p>

<p>I've got lots of little ideas brewing, and God knows I've got <a href="http://search.msn.com/results.aspx?q=ip%3A80.82.117.99">too many domains</a> (and there's more that don't point to my machine), but it's a matter of finding time and finding an idea that I'm passionate enough about to take to fruition.</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=vYsvl"><img src="http://feeds.feedburner.com/~f/remysharp?i=vYsvl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/386552177" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/09/08/dconstruct-08/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/09/08/dconstruct-08/</feedburner:origLink></item>
		<item>
		<title>Safari show bug</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/382174543/</link>
		<comments>http://remysharp.com/2008/09/03/safari-show-bug/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 09:33:01 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[bug]]></category>

		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/09/03/safari-show-bug/</guid>
		<description><![CDATA[This is probably the first time I've come across a bug in Safari that's comparable in bizarreness to IE bugs.

The symptoms of this bug are that when you set the CSS display property to block from none the element doesn't appear.  In fact, it has a height of zero.



The bug only happens in a [...]]]></description>
			<content:encoded><![CDATA[<p>This is probably the first time I've come across a bug in Safari that's comparable in bizarreness to IE bugs.</p>

<p>The symptoms of this bug are that when you set the CSS <code>display</code> property to <code>block</code> from <code>none</code> the element <em>doesn't</em> appear.  In fact, it has a height of zero.</p>

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

<p>The bug only happens in a specific markup situation, as such I've never seen it before now - but it's worth being aware of since debugging the issue would normally start in the JavaScript, when in fact it's Webkit that's the problem.</p>

<p>The bug occurs when your hidden content is an inline element, containing <code>&lt;br /&gt;</code> tags and proceeded by another inline element.  It's tricky to explain, but can be seen in the source code of the example below:</p>

<p><a href="http://remysharp.com/demo/safari-hide-bug.html">View the demonstration of the bug</a></p>

<p>The fix, after a lot of debugging, turned out to be simply to follow the inline element with a block element.  Somehow the height in the first example is being set to zero allowing the inline <code>span</code> to sit above the element.  In the second example, the block element clears the newly displayed <code>span</code> and it appears correctly.</p>

<p>It's pretty convoluted, which is why it reminds me a of an IE bug!</p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=fAGykl"><img src="http://feeds.feedburner.com/~f/remysharp?i=fAGykl" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/382174543" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/09/03/safari-show-bug/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/09/03/safari-show-bug/</feedburner:origLink></item>
		<item>
		<title>How to default a variable in XSLT</title>
		<link>http://feeds.feedburner.com/~r/remysharp/~3/365974036/</link>
		<comments>http://remysharp.com/2008/08/15/how-to-default-a-variable-in-xslt/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 20:58:18 +0000</pubDate>
		<dc:creator>Remy Sharp</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Dump]]></category>

		<category><![CDATA[xml]]></category>

		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://remysharp.com/2008/08/15/how-to-default-a-variable-in-xslt/</guid>
		<description><![CDATA[Since I couldn't find this anywhere on the web, and I'm working on a project that has had me very quickly learn XSLT, here's how to default a value in XSLT - useful if you're looking to grab a variable via the query string, and it may not be there in the first place.



&#60;xsl:variable name=&#34;show_comments&#34;&#62;
 [...]]]></description>
			<content:encoded><![CDATA[<p>Since I couldn't find this anywhere on the web, and I'm working on a project that has had me <em>very</em> quickly learn XSLT, here's how to default a value in XSLT - useful if you're looking to grab a variable via the query string, and it may not be there in the first place.</p>

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

<pre><code>&lt;xsl:variable name=&quot;show_comments&quot;&gt;
  &lt;xsl:choose&gt;
    &lt;xsl:when test=&quot;//QUERY_STRING/show_comments&quot;&gt;&lt;xsl:value-of select=&quot;//QUERY_STRING/show_comments&quot;/&gt;&lt;/xsl:when&gt;
    &lt;xsl:otherwise&gt;0&lt;/xsl:otherwise&gt; &lt;!-- default value --&gt;
  &lt;/xsl:choose&gt;
&lt;/xsl:variable&gt;</code></pre>

<p><small>Note: <code>//QUERY_STRING</code> is a made up variable</small></p>

<p>I know XSLT might be a bit random for me, but client wants: client gets <img src='http://remysharp.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<div class="feedflare">
<a href="http://feeds.feedburner.com/~f/remysharp?a=oAVSpk"><img src="http://feeds.feedburner.com/~f/remysharp?i=oAVSpk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/remysharp/~4/365974036" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://remysharp.com/2008/08/15/how-to-default-a-variable-in-xslt/feed/</wfw:commentRss>
		<feedburner:origLink>http://remysharp.com/2008/08/15/how-to-default-a-variable-in-xslt/</feedburner:origLink></item>
	</channel>
</rss>
