<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Jamie Huskisson &#187; code tidbits</title>
	<atom:link href="http://www.jhuskisson.com/tag/code-tidbits/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jhuskisson.com</link>
	<description>Nottingham freelance UK PHP, Magento, Wordpress developer</description>
	<lastBuildDate>Wed, 24 Feb 2010 16:36:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Changing the default Mac screen shot image type</title>
		<link>http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type</link>
		<comments>http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type#comments</comments>
		<pubDate>Thu, 29 Jan 2009 10:00:59 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[articles]]></category>
		<category><![CDATA[mac osx]]></category>
		<category><![CDATA[code tidbits]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/?p=440</guid>
		<description><![CDATA[I recently had the need to change the default Mac OSX takes it&#8217;s screen shots in. There&#8217;s some occasions where you need more quality than PNG and some occasions where you need a file anyone can open and simply don&#8217;t want PNG as your default.
Well, in OSX 10.4 and onwards you can change the default [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the need to change the default Mac OSX takes it&#8217;s screen shots in. There&#8217;s some occasions where you need more quality than PNG and some occasions where you need a file anyone can open and simply don&#8217;t want PNG as your default.</p>
<p>Well, in OSX 10.4 and onwards you can change the default screen shot format.</p>
<p>Start by opening Terminal, located in /Applications/Utilities/Terminal</p>
<p>Type in:</p>
<blockquote><p>defaults write com.apple.screencapture type <strong><em>image_format</em></strong><br />
killall SystemUIServer</p></blockquote>
<p>Replace <strong><em>image_format</em></strong> with your selected format that you wish to change the default setting to. The second line reloads the default so that you don&#8217;t need to log out and back in again for the change to take effect. The next time you take a screen shot after executing both of these commands, it will be saved in the new format you have chosen.</p>
<p>Below is a list of several popular image types and their commands in full should you wish to paste them.</p>
<p>BMP</p>
<blockquote><p>defaults write com.apple.screencapture type bmp<br />
killall SystemUIServer</p></blockquote>
<p>GIF</p>
<blockquote><p>defaults write com.apple.screencapture type gif<br />
killall SystemUIServer</p></blockquote>
<p>JPG</p>
<blockquote><p>defaults write com.apple.screencapture type jpg<br />
killall SystemUIServer</p></blockquote>
<p>PDF</p>
<blockquote><p>defaults write com.apple.screencapture type pdf<br />
killall SystemUIServer</p></blockquote>
<p>PNG</p>
<blockquote><p>defaults write com.apple.screencapture type png<br />
killall SystemUIServer</p></blockquote>
<p>TIFF</p>
<blockquote><p>defaults write com.apple.screencapture type tiff<br />
killall SystemUIServer</p></blockquote>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a href="http://www.jhuskisson.com/tag/mac-osx" rel="tag">mac osx</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type&title=Changing the default Mac screen shot image type">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type%26title%3DChanging the default Mac screen shot image type">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type&title=Changing the default Mac screen shot image type">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type#comments">4 comments have been</a> left so far, <a href="http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/articles/changing-the-default-mac-screen-shot-image-type/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Adding an unsubscribe link to a Magento newsletter template</title>
		<link>http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template</link>
		<comments>http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template#comments</comments>
		<pubDate>Sun, 25 Jan 2009 18:00:38 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[magento development]]></category>
		<category><![CDATA[code tidbits]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/?p=424</guid>
		<description><![CDATA[
A quick tip for Magento developer&#8217;s here, in how to add an unsubscribe link into a newsletter template so that the person can unsubscribe from the newsletter if they chose to do so.
Simply add {{var subscriber.getUnsubscriptionLink()}} into your template in order to output the link for the user to unsubscribe. This even works for people [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://files.jhuskisson.com/blog/magento_logo.png" alt="Magento Commerce logo" title="Adding an unsubscribe link to a Magento newsletter template" /></p>
<p>A quick tip for Magento developer&#8217;s here, in how to add an unsubscribe link into a newsletter template so that the person can unsubscribe from the newsletter if they chose to do so.</p>
<p>Simply add {{var subscriber.getUnsubscriptionLink()}} into your template in order to output the link for the user to unsubscribe. This even works for people who aren&#8217;t registered customers of the Magento installation but that you&#8217;ve imported into your system as subscribing to the newsletter.</p>
<p>Full example of a link in your template to unsubscribe:</p>
<blockquote><p>
&lt;a href=&#8221;{{var subscriber.getUnsubscriptionLink()}}&#8221; title=&#8221;Click here to unsubscribe from this newsletter&#8221;&gt;Unsubscribe&lt;/a&gt;
</p></blockquote>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a href="http://www.jhuskisson.com/tag/magento-development" rel="tag">magento development</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template&title=Adding an unsubscribe link to a Magento newsletter template">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template%26title%3DAdding an unsubscribe link to a Magento newsletter template">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template&title=Adding an unsubscribe link to a Magento newsletter template">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template#comments">6 comments have been</a> left so far, <a href="http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/magento-development/adding-an-unsubscribe-link-to-a-magento-newsletter-template/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>&#8216;Share on Twitter&#8217; link</title>
		<link>http://www.jhuskisson.com/code-tidbits/share-on-twitter-link</link>
		<comments>http://www.jhuskisson.com/code-tidbits/share-on-twitter-link#comments</comments>
		<pubDate>Tue, 20 Jan 2009 13:02:29 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[code tidbits]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/?p=429</guid>
		<description><![CDATA[
Ever wanted to give your readers, or your client&#8217;s readers a chance to share the post quickly on Twitter?
The code is straight forward:
&#60;a href=&#8221;http://twitter.com/home?status=Currently reading http://www.test.com/post-url&#8221; title=&#8221;Click to share this post on Twitter&#8221;&#62;Share on Twitter&#60;/a&#62;
If you&#8217;re using Wordpress and want to automate this, simply use the following to insert the link to the current post [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Click here to follow me on Twitter" href="http://twitter.com/jhuskisson"><img src="http://files.jhuskisson.com/blog/twitter_bird.jpg" alt="Twitter bird" title="Share on Twitter link" /></a></p>
<p>Ever wanted to give your readers, or your client&#8217;s readers a chance to share the post quickly on Twitter?</p>
<p>The code is straight forward:</p>
<blockquote><p>&lt;a href=&#8221;http://twitter.com/home?status=Currently reading http://www.test.com/post-url&#8221; title=&#8221;Click to share this post on Twitter&#8221;&gt;Share on Twitter&lt;/a&gt;</p></blockquote>
<p>If you&#8217;re using Wordpress and want to automate this, simply use the following to insert the link to the current post in the loop into your link:</p>
<blockquote><p>&lt;a href=&#8221;http://twitter.com/home?status=Currently reading &lt;?php the_permalink(); ?&gt;&#8221; title=&#8221;Click to share this post on Twitter&#8221;&gt;Share on Twitter&lt;/a&gt;</p></blockquote>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a href="http://www.jhuskisson.com/tag/twitter" rel="tag">twitter</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/code-tidbits/share-on-twitter-link&title=&#8216;Share on Twitter&#8217; link">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/code-tidbits/share-on-twitter-link%26title%3D&#8216;Share on Twitter&#8217; link">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/code-tidbits/share-on-twitter-link&title=&#8216;Share on Twitter&#8217; link">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/code-tidbits/share-on-twitter-link#comments">53 comments have been</a> left so far, <a href="http://www.jhuskisson.com/code-tidbits/share-on-twitter-link#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/code-tidbits/share-on-twitter-link/feed</wfw:commentRss>
		<slash:comments>53</slash:comments>
		</item>
		<item>
		<title>301 and 302 redirects with .htaccess</title>
		<link>http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess</link>
		<comments>http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess#comments</comments>
		<pubDate>Fri, 26 Sep 2008 08:49:47 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[.htaccess]]></category>
		<category><![CDATA[articles]]></category>
		<category><![CDATA[code tidbits]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/?p=384</guid>
		<description><![CDATA[I&#8217;ve been asked this question time and time again, so here we are. How to redirect directories and old URL&#8217;s to new ones when moving your site from one domain to another, or launching a new version with re-structured URLs.
Here&#8217;s a sample structure of a re-direct line:

Redirect 301 /about.php http://www.newdomain.com/about

/about.php here is the local URL [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been asked this question time and time again, so here we are. How to redirect directories and old URL&#8217;s to new ones when moving your site from one domain to another, or launching a new version with re-structured URLs.</p>
<p>Here&#8217;s a sample structure of a re-direct line:</p>
<blockquote><p>
Redirect 301 /about.php http://www.newdomain.com/about
</p></blockquote>
<p><strong>/about.php</strong> here is the local URL relative to the core domain you&#8217;re redirecting from. If you&#8217;re redirecting from http://www.sample.com/directory/about.php then this will be /directory/about.php and if you are redirecting from http://www.sample.com/about.php then it is simply /about.php.</p>
<p>The second part of this statement is the complete URL you are forwarding to. </p>
<p>The beauty of a 301 redirect with .htaccess is that if you have one big set of URL&#8217;s that have changed from one place to another with the filename/end URL staying the same it is still the same statement. For example:</p>
<blockquote><p>
Redirect 301 /test/ http://www.newdomain.com/testing/
</p></blockquote>
<p>This redirects /test/about.php to http://www.newdomain.com/testing/about.php &#8211; anything after /test/ will be redirected to http://www.newdomain.com/testing/ and placed at the end of the URL. The same applies for all query URLs (i.e. about.php?variable=1&#038;this=that).</p>
<p><strong>Tip:</strong> Always priority order your redirects. The redirects you want done first should go up top. But you should also be careful not to place inherent statements above specific ones.</p>
<p>This won&#8217;t work:</p>
<blockquote><p>
Redirect 301 /test/ http://www.newdomain.com/testing/<br />
Redirect 301 /test/about.php http://www.newdomain.com/about.php
</p></blockquote>
<p>This will result in the first statement being processed and the second statement meaning nothing. The correct order is:</p>
<blockquote><p>
Redirect 301 /test/about.php http://www.newdomain.com/about.php<br />
Redirect 301 /test/ http://www.newdomain.com/testing/
</p></blockquote>
<p>This means the specific statement is applied first, and then the inherent statement is ran afterwards.</p>
<p>Here&#8217;s a sample of our extensive re-directs for Sausage Roll to Rolled:</p>
<blockquote><p>
Redirect 301 /general-posts/ http://www.rolled.at/general-news/<br />
Redirect 301 /wp-content/uploads/11/ http://www.rolled.at/wp-content/uploads/
</p></blockquote>
<p>Here is what they do:</p>
<ul>
<li>Moves all posts in the /general-posts/ slugged category to show at /general-news/ on the new site. For example /general-posts/testing-post is now /general-news/testing-post on the new site as we changed the category.</li>
<li>All uploads from /wp-content/uploads/11/ are now linked to in /wp-content/uploads/. For examples /wp-content/uploads/11/test.jpg is now /wp-content/uploads/test.jpg on the new server.</li>
</ul>
<p>All of these lines can be applied to 302 (temporary) redirects too. Just switch the number 301 with 302 to achieve the result you need. 302 redirects should be used where the file is only moving there for a short while but will be put back eventually and 301 redirects are used to transfer the URL to the new URL permanently and work great for a site move or a URL restructuring.</p>
<p>I used these to transfer Twod.co.uk to JHuskisson.com and several other transfers and they have all retained by page rank and search engine strength from domain to domain with ease.</p>
<p>Have any other htaccess redirect tips or things to discuss? Feel free to leave a comment using the form below.</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/htaccess" rel="tag">.htaccess</a>, <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess&title=301 and 302 redirects with .htaccess">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess%26title%3D301 and 302 redirects with .htaccess">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess&title=301 and 302 redirects with .htaccess">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess#comments">3 comments have been</a> left so far, <a href="http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/articles/301-and-302-redirects-with-htaccess/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Force www. in your URL using .htaccess</title>
		<link>http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess</link>
		<comments>http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess#comments</comments>
		<pubDate>Thu, 15 Mar 2007 14:17:01 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[code tidbits]]></category>
		<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess</guid>
		<description><![CDATA[Insert this into the top of your .htaccess file, making sure that &#8216;RewriteEngine On&#8217; comes before it:
RewriteCond %{HTTP_HOST} !^www\.jhuskisson\.com [NC]
RewriteRule ^(.*)$ http://www.jhuskisson.com/$1 [R=301,L]
Replace jhuskisson.com with your chosen domain and make sure if you are placing any full stops within the first line to enter a backslash before each full stop. This will prevent the code [...]]]></description>
			<content:encoded><![CDATA[<p>Insert this into the top of your .htaccess file, making sure that &#8216;RewriteEngine On&#8217; comes before it:</p>
<blockquote><p>RewriteCond %{HTTP_HOST} !^www\.jhuskisson\.com [NC]<br />
RewriteRule ^(.*)$ http://www.jhuskisson.com/$1 [R=301,L]</p></blockquote>
<p>Replace jhuskisson.com with your chosen domain and make sure if you are placing any full stops within the first line to enter a backslash before each full stop. This will prevent the code from not working.</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/htaccess" rel="tag">.htaccess</a>, <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess&title=Force www. in your URL using .htaccess">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess%26title%3DForce www. in your URL using .htaccess">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess&title=Force www. in your URL using .htaccess">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess#comments">9 comments have been</a> left so far, <a href="http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/code-tidbits/force-www-in-your-url-using-htaccess/feed</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>&#8216;Send me a message on AIM&#8217; link</title>
		<link>http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link</link>
		<comments>http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link#comments</comments>
		<pubDate>Thu, 15 Mar 2007 13:56:51 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[code tidbits]]></category>
		<category><![CDATA[aim]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link</guid>
		<description><![CDATA[
Here&#8217;s the code:
&#60;a href=&#8221;aim:goim?screename=username&#038;message=hello&#8221;&#62;Send me a message on AIM&#60;/a&#62;
Replace username with your required AIM username and &#8216;hello&#8217; with whatever message you wish to set for the user to send you. You can remove &#8216;hello&#8217; altogether if you don&#8217;t wish to pre-set a message for a user to send you upon clicking the link.
Tags: aim, code [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://files.jhuskisson.com/blog/aim_logo.jpg" alt="AOL instant messenger logo" title="Send me a message on AIM link" /></p>
<p>Here&#8217;s the code:</p>
<blockquote><p>&lt;a href=&#8221;aim:goim?screename=<strong>username</strong>&#038;message=hello&#8221;&gt;Send me a message on AIM&lt;/a&gt;</p></blockquote>
<p>Replace <strong>username</strong> with your required AIM username and &#8216;hello&#8217; with whatever message you wish to set for the user to send you. You can remove &#8216;hello&#8217; altogether if you don&#8217;t wish to pre-set a message for a user to send you upon clicking the link.</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/aim" rel="tag">aim</a>, <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link&title=&#8216;Send me a message on AIM&#8217; link">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link%26title%3D&#8216;Send me a message on AIM&#8217; link">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link&title=&#8216;Send me a message on AIM&#8217; link">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link#comments">3 comments have been</a> left so far, <a href="http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/code-tidbits/send-me-a-message-on-aim-link/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Re-enabling error reporting in MAMP</title>
		<link>http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp</link>
		<comments>http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp#comments</comments>
		<pubDate>Fri, 09 Feb 2007 13:01:00 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[code tidbits]]></category>
		<category><![CDATA[mac]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/code-tidbits/enabling-error-reporting-in-mamp</guid>
		<description><![CDATA[For some reason error reporting is turned off by default in MAMP.. So this is how to re-enable it to how it should be.
1. Find your &#8216;MAMP&#8217; directory in &#8216;Applications&#8217;
2. Find &#8216;conf&#8217; and open it up..
3. Open up php4 or php5 (depending on your enabled version)
4. Line 270 should be something like this:
error_reporting  = [...]]]></description>
			<content:encoded><![CDATA[<p>For some reason error reporting is turned off by default in MAMP.. So this is how to re-enable it to how it should be.</p>
<p>1. Find your &#8216;MAMP&#8217; directory in &#8216;Applications&#8217;</p>
<p>2. Find &#8216;conf&#8217; and open it up..</p>
<p>3. Open up php4 or php5 (depending on your enabled version)</p>
<p>4. Line 270 should be something like this:<br />
error_reporting  =  E_ALL</p>
<p>5. Line 277 will be:<br />
display_errors = Off</p>
<p>Change this to:<br />
display_errors = On</p>
<p>6. Restart servers</p>
<p>And voila! We have PHP errors..</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a href="http://www.jhuskisson.com/tag/mac" rel="tag">mac</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp&title=Re-enabling error reporting in MAMP">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp%26title%3DRe-enabling error reporting in MAMP">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp&title=Re-enabling error reporting in MAMP">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp#comments">39 comments have been</a> left so far, <a href="http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/code-tidbits/re-enabling-error-reporting-in-mamp/feed</wfw:commentRss>
		<slash:comments>39</slash:comments>
		</item>
		<item>
		<title>Track outbound links for Google Analytics automatically</title>
		<link>http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically</link>
		<comments>http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically#comments</comments>
		<pubDate>Tue, 09 Jan 2007 14:41:28 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[code tidbits]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically</guid>
		<description><![CDATA[Place this code before the &#60;/body&#62; tag and it&#8217;ll track all outbound links that aren&#8217;t part of your website.

&#60;script type=&#8221;text/javascript&#8221;&#62;
    if (document.getElementsByTagName) {
        var ahrefs = document.getElementsByTagName(&#8216;a&#8217;);
        for (var i=0; i&#60;ahrefs.length;i++) {
       [...]]]></description>
			<content:encoded><![CDATA[<p>Place this code before the &lt;/body&gt; tag and it&#8217;ll track all outbound links that aren&#8217;t part of your website.</p>
<blockquote><p>
&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
    if (document.getElementsByTagName) {<br />
        var ahrefs = document.getElementsByTagName(&#8216;a&#8217;);<br />
        for (var i=0; i&lt;ahrefs.length;i++) {<br />
            if (ahrefs[i].href.indexOf(&#8216;<strong>http://www.jhuskisson.com</strong>&#8216;) == -1 &#038;&#038; !ahrefs[i].onclick) {<br />
                ahrefs[i].onclick = function () { var track = this.href + &#8221;; urchinTracker (&#8216;/outgoing/&#8217;+track.substring(7)); }<br />
            }<br />
        }<br />
    }<br />
&lt;/script&gt;
</p></blockquote>
<p>Simply replace <strong>http://www.jhuskisson.com</strong> with your own site URL and hey presto &#8211; all outbound links that aren&#8217;t internal are being tracked by Google Analytics.</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically&title=Track outbound links for Google Analytics automatically">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically%26title%3DTrack outbound links for Google Analytics automatically">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically&title=Track outbound links for Google Analytics automatically">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically#comments">22 comments have been</a> left so far, <a href="http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/code-tidbits/track-outbound-links-for-google-analytics-automatically/feed</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>From PHP 4 to PHP 5.. PHP Fatal zlib error: imagepng()</title>
		<link>http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng</link>
		<comments>http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng#comments</comments>
		<pubDate>Wed, 03 Jan 2007 13:52:37 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[code tidbits]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng</guid>
		<description><![CDATA[Getting this error?
PHP Fatal error: imagepng() [function.imagepng]: gd-png: fatal libpng error: zlib error in example.php on line 10
Fix it easily by changing your compression variable of imagepng, imagegif or imagejpg/imagejpeg into a 1-10 ranged number &#8211; instead of the PHP 4 1-100 standard. 
It should work smoothly now :)
Tags: code tidbits
Add to
del.icio.us &#124; Stumble Upon [...]]]></description>
			<content:encoded><![CDATA[<p>Getting this error?</p>
<blockquote><p>PHP Fatal error: imagepng() [<a href="http://www.php.net/imagepng">function.imagepng</a>]: gd-png: fatal libpng error: zlib error in example.php on line 10</p></blockquote>
<p>Fix it easily by changing your compression variable of imagepng, imagegif or imagejpg/imagejpeg into a 1-10 ranged number &#8211; instead of the PHP 4 1-100 standard. </p>
<p>It should work smoothly now :)</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng&title=From PHP 4 to PHP 5.. PHP Fatal zlib error: imagepng()">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng%26title%3DFrom PHP 4 to PHP 5.. PHP Fatal zlib error: imagepng()">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng&title=From PHP 4 to PHP 5.. PHP Fatal zlib error: imagepng()">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng#comments">12 comments have been</a> left so far, <a href="http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/code-tidbits/from-php-4-to-php-5-php-fatal-error-imagepng/feed</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Never lose visitors from old URLs again</title>
		<link>http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again</link>
		<comments>http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again#comments</comments>
		<pubDate>Wed, 03 Jan 2007 10:56:52 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[wordpress development]]></category>
		<category><![CDATA[code tidbits]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/wordpress/never-lose-visitors-from-old-urls-again</guid>
		<description><![CDATA[Was coding a script for redirection of old URL&#8217;s into new ones for Wordpress when I found this plugin.
This plugin redirects the old ?p=1 ?page_id=1 URL structure as well as handling feedburner re-direction. Which saved me a lot of time and frustration. It also means converting sites not using permalinks into sites with permalink structures [...]]]></description>
			<content:encoded><![CDATA[<p>Was coding a script for redirection of old URL&#8217;s into new ones for Wordpress when I found <a href="http://fucoder.com/code/permalink-redirect/">this plugin</a>.</p>
<p>This plugin redirects the old ?p=1 ?page_id=1 URL structure as well as handling feedburner re-direction. Which saved me a lot of time and frustration. It also means converting sites not using permalinks into sites with permalink structures is a simple case of enabling this plugin. I love it!</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again&title=Never lose visitors from old URLs again">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again%26title%3DNever lose visitors from old URLs again">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again&title=Never lose visitors from old URLs again">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again#comments">No comments have been</a> left so far, <a href="http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/wordpress-development/never-lose-visitors-from-old-urls-again/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Easily insert a Xbox Live gamer card into your website</title>
		<link>http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website</link>
		<comments>http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website#comments</comments>
		<pubDate>Tue, 02 Jan 2007 15:56:28 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[code tidbits]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website</guid>
		<description><![CDATA[Searched for about 30 minutes on how to do it earlier today as mygamercard.net is extremely slow and unreliable. Here&#8217;s how to do it yourself by using Xbox.com (which is very reliable and fast):
&#60;iframe src=&#8221;http://gamercard.xbox.com/MyGamerTag.card&#8221; class=&#8221;gamercard&#8221; width=&#8221;204&#8243; height=&#8221;141&#8243; scrolling=&#8221;no&#8221; frameBorder=&#8221;0&#8243;&#62;&#60;/iframe&#62;
Simply replace MyGamerTag with your own &#8211; and insert it where you would like your gamer [...]]]></description>
			<content:encoded><![CDATA[<p>Searched for about 30 minutes on how to do it earlier today as mygamercard.net is extremely slow and unreliable. Here&#8217;s how to do it yourself by using Xbox.com (which is very reliable and fast):</p>
<blockquote><p>&lt;iframe src=&#8221;http://gamercard.xbox.com/<strong>MyGamerTag</strong>.card&#8221; class=&#8221;gamercard&#8221; width=&#8221;204&#8243; height=&#8221;141&#8243; scrolling=&#8221;no&#8221; frameBorder=&#8221;0&#8243;&gt;&lt;/iframe&gt;</p></blockquote>
<p>Simply replace <strong>MyGamerTag</strong> with your own &#8211; and insert it where you would like your gamer card on your site &#8211; simple.</p>
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website&title=Easily insert a Xbox Live gamer card into your website">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website%26title%3DEasily insert a Xbox Live gamer card into your website">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website&title=Easily insert a Xbox Live gamer card into your website">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website#comments">2 comments have been</a> left so far, <a href="http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/code-tidbits/a-valid-xhtml-xbox-live-gamercard-for-your-website/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Earthquake Effect: Shake the browser using JavaScript</title>
		<link>http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser</link>
		<comments>http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser#comments</comments>
		<pubDate>Sat, 01 May 2004 15:55:32 +0000</pubDate>
		<dc:creator>Jamie Huskisson</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[code tidbits]]></category>
		<category><![CDATA[twod]]></category>

		<guid isPermaLink="false">http://www.jhuskisson.com/?p=508</guid>
		<description><![CDATA[Note: This post was imported from the very old Twod.co.uk post archives.
This snippet of code will produce a JavaScript function which you can then attach via a JavaScript call and shake the user&#8217;s Internet browser.
Place this anywhere before you&#8217;re going to call the function, or remove the surrounding &#60;script&#62; tags and place it within an [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note:</strong> This post was imported from the very old Twod.co.uk post archives.</p>
<p>This snippet of code will produce a JavaScript function which you can then attach via a JavaScript call and shake the user&#8217;s Internet browser.</p>
<p>Place this anywhere before you&#8217;re going to call the function, or remove the surrounding &lt;script&gt; tags and place it within an external JavaScript file.</p>
<blockquote><p>&lt;script type=&#8221;text/javascript&#8221;&gt;<br />
function shake(n) {<br />
	if (parent.moveBy) {<br />
		for (i = 10; i > 0; i&#8211;) {<br />
			for (j = n; j > 0; j&#8211;) {<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
				parent.moveBy(0,i);<br />
				parent.moveBy(i,0);<br />
				parent.moveBy(0,-i);<br />
				parent.moveBy(-i,0);<br />
			}<br />
		}<br />
	}<br />
}<br />
&lt;/script&gt;</p></blockquote>
<p>An example of this function being called using the onclick method would look as follows:</p>
<blockquote><p>&lt;input type=&#8221;button&#8221; onclick=&#8221;javascript:shake(2)&#8221; value=&#8221;Shake Me!&#8221; /&gt;</p></blockquote>
<p>This will produce (go ahead, click for an example of the effect):<br />
<script type="text/javascript">function shake(n) {if (parent.moveBy) {for (i = 10; i > 0; i--) {for (j = n; j > 0; j--) {parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);parent.moveBy(0,i);parent.moveBy(i,0);parent.moveBy(0,-i);parent.moveBy(-i,0);}}}}</script><br />
<input type="button" onclick="javascript:shake(2);" value="Shake Me!" />
<p>Tags: <a href="http://www.jhuskisson.com/tag/code-tidbits" rel="tag">code tidbits</a>, <a href="http://www.jhuskisson.com/tag/javascript" rel="tag">javascript</a>, <a href="http://www.jhuskisson.com/tag/twod" rel="tag">twod</a></p>
<p>Add to
<a href="http://del.icio.us/post?url=http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser&title=Earthquake Effect: Shake the browser using JavaScript">del.icio.us</a> | <a href="http://www.stumbleupon.com/submit?url=http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser%26title%3DEarthquake Effect: Shake the browser using JavaScript">Stumble Upon</a> | <a href="http://digg.com/submit?url=http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser&title=Earthquake Effect: Shake the browser using JavaScript">Digg this</a></p>
<p><a href="http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser#comments">No comments have been</a> left so far, <a href="http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser#comments">why not add yours?</a>. Or <a href="http://twitter.com/jhuskisson">talk to me on Twitter</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jhuskisson.com/javascript/earthquake-effect-shake-the-browser/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
