<?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>Sam Lu - goSammy &#187; Web Development</title>
	<atom:link href="http://www.gosammy.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gosammy.com</link>
	<description>A Blog on Web Development, Design and the Occasional Rant</description>
	<lastBuildDate>Mon, 31 Oct 2011 06:48:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A New Portfolio</title>
		<link>http://www.gosammy.com/2011/07/15/a-new-portfolio/</link>
		<comments>http://www.gosammy.com/2011/07/15/a-new-portfolio/#comments</comments>
		<pubDate>Fri, 15 Jul 2011 15:58:59 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[1140]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[media queries]]></category>
		<category><![CDATA[portfolio]]></category>
		<category><![CDATA[stacey]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=1005</guid>
		<description><![CDATA[The last time I redesigned my portfolio was in June of 2007. A little over <em>four years ago</em>...that's a long time. Since then, a lot has changed in the web sphere. There's been a larger shift towards the mobile space, the browsers have changed, and my old portfolio was definitely showing its age.]]></description>
			<content:encoded><![CDATA[<p>The last time I redesigned my portfolio was in <a href="/2007/06/12/new-portfolio/">June of 2007</a>. A little over <em>four years ago</em>&#8230;that&#8217;s a long time.</p>
<p>A couple months ago, the thought of updating it crossed my mind and although I designed a few mockups in Photoshop, I never got around to sitting down and developing it. One of the earlier ideas I toyed around with was this one:</p>
<p><div id="attachment_1007" class="wp-caption center" style="width: 219px"><a href="http://www.gosammy.com/wp-content/uploads/2011/07/silly_portfolio_mockup.jpg"><img src="http://www.gosammy.com/wp-content/uploads/2011/07/silly_portfolio_mockup-209x300.jpg" alt="" title="Early Portfolio Mockup" width="209" height="300" class="size-medium wp-image-1007" /></a><p class="wp-caption-text">Please excuse the silly copy. It was a late night when I made this one.</p></div></p>
<p>Eventually I fell out of love with it and designed the following one which is the design that made it into the final product.</p>
<p><div id="attachment_1015" class="wp-caption center" style="width: 310px"><a href="http://www.gosammy.com/wp-content/uploads/2011/07/Screen-shot-2011-07-14-at-11.41.36-PM.png"><img src="http://www.gosammy.com/wp-content/uploads/2011/07/Screen-shot-2011-07-14-at-11.41.36-PM-300x197.png" alt="" title="Final Portfolio Design" width="300" height="197" class="size-medium wp-image-1015" /></a><p class="wp-caption-text">It&#039;s simple</p></div></p>
<p>The final design was very much influenced by two key frameworks/libraries which drive the site. For the layout and CSS, I used the <a href="http://cssgrid.net/" title="The 1140px Grid">1140px Grid</a> and for content management, I used <a href="http://staceyapp.com/" title="Stacey, The Lightweight Content Management System">Stacey</a>.</p>
<p><iframe src="http://player.vimeo.com/video/26462085?title=0&#038;byline=0&#038;portrait=0" width="398" height="249" frameborder="0" style="width:398px;height:249px;"></iframe>The 1140px Grid is a fantastic CSS framework for creating a website that can adapt itself for different devices (as long as you keep this in mind during the design). If you <a href="http://samlu.ca" title="Check out my new portfolio!">visit the site</a> and resize the window to a shorter width you can see the framework in action as the site adapts for the shorter width. </p>
<p>This allows for a more friendlier layout when viewing it on a mobile device. The CSS framework also allows for the use of higher resolution images for devices which have a high density display. (eg. the iPhone 4)</p>
<p><div id="attachment_1024" class="wp-caption center" style="width: 210px"><a href="http://www.gosammy.com/wp-content/uploads/2011/07/photo.png"><img src="http://www.gosammy.com/wp-content/uploads/2011/07/photo-200x300.png" alt="" title="Screenshot of portfolio viewed on an iPhone 4" width="200" height="300" class="size-medium wp-image-1024" /></a><p class="wp-caption-text">Screenshot of portfolio viewed on an iPhone 4</p></div></p>
<p>In regards to Stacey, the CMS I used, it&#8217;s really great for portfolio situations. As is described on its site, it&#8217;s also very lean since it does not require a database. However, it still supports RSS feeds and editing content is a pleasure as each project ended up being contained in its own folder with all the content contained in one text file. With no database involved, I&#8217;m able to make updates to my portfolio locally and when ready, push up all my changes with git with ease (<a href="http://toroid.org/ams/git-website-howto">using this method</a>).</p>
<p>I went a bit experimental with some of the aesthetic implementations, like choosing to use CSS3 stylings for the About and Contact buttons. They look great in Firefox and Chrome but not as intended in IE 8, and definitely not IE 7. In IE 6 the site blows up. I made the decision not to support IE 6 like with most of the other recent sites I developed as the marketshare is no longer significant. Plus it&#8217;s 2011, if you&#8217;re still using IE 6, <em>you&#8217;re three versions behind</em>. Even Microsoft <a href="http://www.ie6countdown.com/">doesn&#8217;t want you using it anymore</a>.</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/" title="Using Git Between Mac and Windows">Using Git Between Mac and Windows</a></li><li><a href="http://www.gosammy.com/2011/04/11/bbm-probably-wont-be-available-to-iphoneandroid/" title="BBM Probably Won&#8217;t Be Available to iPhone/Android">BBM Probably Won&#8217;t Be Available to iPhone/Android</a></li><li><a href="http://www.gosammy.com/2010/11/18/next-stop-an-iphone-app-for-calgary-transit/" title="Next Stop: An iPhone App for Calgary Transit">Next Stop: An iPhone App for Calgary Transit</a></li><li><a href="http://www.gosammy.com/2010/07/23/six-tips-for-optimizing-your-websiteweb-application/" title="Six Tips for Optimizing Your Website/Web Application">Six Tips for Optimizing Your Website/Web Application</a></li><li><a href="http://www.gosammy.com/2010/07/18/a-new-stint-with-mediumrare-a-new-theme/" title="A New Stint With Mediumrare, A New Theme">A New Stint With Mediumrare, A New Theme</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2011/07/15/a-new-portfolio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Git Between Mac and Windows</title>
		<link>http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/</link>
		<comments>http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 08:48:27 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[source code]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[version control]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=974</guid>
		<description><![CDATA[In the past I've been mostly a Subversion guy when it came to version control, but recently I decided to try Git on a project. After going through an <a href="http://library.edgecase.com/git_immersion/index.html" title="Git Immersion">awesome intro guide to Git</a>, I can definitely see the appeal of Git, especially when it comes to small personal projects. Inside are a few cases where I ended up scratching my head trying to clone and pull between a Mac and Windows because the support for Git on Windows isn't as great on OSX or Linux.
]]></description>
			<content:encoded><![CDATA[<p>In the past I&#8217;ve been mostly a Subversion guy when it came to version control, but recently I decided to try Git on a project. After going through an <a href="http://library.edgecase.com/git_immersion/index.html" title="Git Immersion">awesome intro guide to Git</a>, I can definitely see the appeal of Git, especially when it comes to small personal projects. Below are a few cases where I ended up scratching my head trying to clone and pull between a Mac and Windows because the support for Git on Windows isn&#8217;t as great on OSX or Linux.</p>
<div id="readmore" class="warning"><strong>Warning:</strong> The following has worked for me on Windows 7. <acronym title="Your mileage may vary">YMMV</acronym> when it comes to previous versions of Windows. I also prefer the command line when working with Git and Cygwin is a requirement.</div>
<h3>Cloning a repository from Mac to Windows</h3>
<p>To clone a repository from a location on my Mac to Windows, I had to install ssh and git for <a href="http://www.cygwin.com/" title="Cygwin">Cygwin</a> through its installer. After that, the standard &#8216;git clone&#8217; worked:</p>
<div class="codesnip-container" >
<div class="codesnip">$ git clone your.macs.ip.address:/path/to/files</div>
</div>
<p>You will need to turn on <strong>Remote Login</strong> in your System Preferences to open up port 22 needed to create the SSH connection between your Mac and Windows PC:<br />
<a href="http://www.gosammy.com/wp-content/uploads/2011/06/System-PreferencesScreenSnapz001.jpg"><img src="http://www.gosammy.com/wp-content/uploads/2011/06/System-PreferencesScreenSnapz001-590x483.jpg" alt="" title="Remote Login - OSX System Preferences" width="590" height="483" class="aligncenter size-large wp-image-992" /></a></p>
<h3>Pulling changes from Windows to Mac</h3>
<p>This problem was the more challenging one. Perhaps it was because my mindset was used to the centralized philosophies of CVS and Subversion, but for a couple of hours, I thought that I had to figure out a way to issue a &#8216;git pull&#8217; from Windows to my Mac <i>and through SSH</i>. Googling the issue with the terms I had in mind didn&#8217;t help either and it looks like quite a few people out there ran into the same issue. I struggled installing different SSH servers onto my PC, generating and importing public keys, and running the git daemon. Eventually I managed to get a working SSH connection from my Mac to my PC, but then the pull didn&#8217;t work &#8211; I couldn&#8217;t provide a proper path to the files since Windows has its paths with opposite slashes (eg. &#8216;/Users/samlu/repo&#8217; wouldn&#8217;t work because it would have to be &#8216;\Users\samlu\repo&#8217;) and I was unable to enter those slashes properly in the command line.</p>
<p>Then I figured out a solution that was simple and got the job done by mounting my user folder from my Windows box as a samba share on my Mac.<br />
<a href="http://www.gosammy.com/wp-content/uploads/2011/06/ScreenSnapz.jpg"><img src="http://www.gosammy.com/wp-content/uploads/2011/06/ScreenSnapz.jpg" alt="" title="OSX Connect to Server - Samba share" width="486" height="231" class="aligncenter size-full wp-image-998" /></a></p>
<p>Once that network share gets mounted, you can access it directly as a drive. You should be able to find it if you navigate to /Volumes.</p>
<p>After that, you can issue a git pull easily.</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2011/07/15/a-new-portfolio/" title="A New Portfolio">A New Portfolio</a></li><li><a href="http://www.gosammy.com/2011/04/11/bbm-probably-wont-be-available-to-iphoneandroid/" title="BBM Probably Won&#8217;t Be Available to iPhone/Android">BBM Probably Won&#8217;t Be Available to iPhone/Android</a></li><li><a href="http://www.gosammy.com/2010/11/18/next-stop-an-iphone-app-for-calgary-transit/" title="Next Stop: An iPhone App for Calgary Transit">Next Stop: An iPhone App for Calgary Transit</a></li><li><a href="http://www.gosammy.com/2010/07/23/six-tips-for-optimizing-your-websiteweb-application/" title="Six Tips for Optimizing Your Website/Web Application">Six Tips for Optimizing Your Website/Web Application</a></li><li><a href="http://www.gosammy.com/2010/07/18/a-new-stint-with-mediumrare-a-new-theme/" title="A New Stint With Mediumrare, A New Theme">A New Stint With Mediumrare, A New Theme</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Six Tips for Optimizing Your Website/Web Application</title>
		<link>http://www.gosammy.com/2010/07/23/six-tips-for-optimizing-your-websiteweb-application/</link>
		<comments>http://www.gosammy.com/2010/07/23/six-tips-for-optimizing-your-websiteweb-application/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 15:09:42 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[scaling]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=786</guid>
		<description><![CDATA[Ever since I started moving on from just developing websites to more complex web applications, I've learned different ways of optimizing your web application for speed and efficiency. It's important to keep your web application running snappy, because as LinkedIn has found out: the likeliness at which visitors bounce is directly related to the performance of your web application. Inside you will read about six optimization tips that I commonly apply to my websites and web applications. These tips involve saving on HTTP requests as well as techniques on optimizing code.]]></description>
			<content:encoded><![CDATA[<p>Ever since I started moving on from just developing websites to more complex web applications, I&#8217;ve learned different ways of optimizing your web application for speed and efficiency. It&#8217;s important to keep your web application running snappy, because as LinkedIn has found out: the likeliness at which visitors bounce is directly related to the performance of your web application. You can find out more about their story with how they kept their Bumper Sticker application running snappy by watching <a href="http://www.joyent.com/customers/linkedin/" title="Watch a video on how LinkedIn scaled a Rails app to 1 billion page views" class="qtiplink">this video hosted on Joyent</a>:</p>
<p><a href="http://www.joyent.com/customers/linkedin/" title="Watch LinkedIn&#039;s Story on Scaling Their Facebook Application: Bumper Sticker"><img src="http://www.gosammy.com/wp-content/uploads/2010/07/joyent_video_cap.jpg" alt="Watch LinkedIn&#039;s Story on Scaling Their Facebook Application: Bumper Sticker" title="Watch LinkedIn&#039;s Story on Scaling Their Facebook Application: Bumper Sticker" width="549" height="326" class="size-full wp-image-808" /></a></p>
<blockquote class="rightquote"><p>&#8220;&#8230;the likeliness at which visitors bounce is directly related to the performance of your web application.&#8221;</p></blockquote>
<p>Although most of these tips are geared more towards web applications, there is nothing stopping you from applying this to a website. Applying these tips in practice towards any sort of web development will see immediate payoffs during a sudden burst of traffic. Those with slightly slower internet connections or using outdated browsers will also unknowingly appreciate these extra steps you take as these older browsers have javascript engines that perform much slower than what we&#8217;re used to with the blazing fast engines implemented in Google Chrome, Safari 4, Firefox 3, etc.</p>
<h3>Tip 1: Use Image Sprites Whenever Possible, Especially On Common Graphics</h3>
<p><div id="attachment_814" class="wp-caption aligncenter" style="width: 600px"><img src="http://www.gosammy.com/wp-content/uploads/2010/07/globalnavbg-590x91.png" alt="Apple&#039;s Navigation Sprite" title="Apple&#039;s Navigation Sprite" width="590" height="91" class="size-large wp-image-814" /><p class="wp-caption-text">Apple's usage of a sprite for their navigation menu</p></div></p>
<p>This has been advised many times in blog articles but for those who do not know, utilizing one larger image file instead of multiple image files is better. Of course, there is always a point when the benefit can become lost if you go overboard with it, but the rule of thumb is: <em>if a graphic is used multiple times across a sprite, especially in the use of a CSS background, add it into a common sprite</em>.</p>
<p>Why is it more efficient? The bottom line is that you save on the amount of HTTP requests that have to be made between the client and the server. For more information on sprites and how to implement them, check out the awesome <a href="http://css-tricks.com/css-sprites/" title="CSS Sprites: What They Are, Why They’re Cool, and How To Use Them">&#8220;how-to&#8221; article over at CSS-Tricks</a>.</p>
<h3>Tip 2: Keep Your External Javascript and CSS Tidy</h3>
<blockquote class="leftquote"><p>&#8220;Why is it more efficient? The bottom line is that you save on the amount of HTTP requests that have to be made between the client and the server.&#8221;</p></blockquote>
<p>As a follow-up to the first tip and how saving on HTTP requests can help your web application; the same can be said about external javascript and CSS. By minimizing the amount of external files that have to be referenced, you save on HTTP requests. This results in the scripts getting to the client (browser) quicker and having it execute faster. As mentioned in the introduction of this post, I said that those using older browsers with slower javascript engines would unknowingly appreciate some of these extra steps you take to optimize your web app &#8211; this tip is one large part of it.</p>
<p>To help see which files can be combined, <a href="http://developer.yahoo.com/yslow/" title="Yahoo! YSlow for Firebug">YSlow for Firebug</a> is a great extension for <a href="http://getfirebug.com/" title="Firebug - The most popular and powerful web development tool">Firebug</a> that analyzes page loads and script execution to see where your website/web application is performing slowly.</p>
<p>In fact, these first two tips are outlined in <a href="http://developer.yahoo.com/performance/rules.html">Yahoo&#8217;s Best Practices for Speeding Up Your Web Site</a>. They also advise that you move references to javascript to the bottom of your page (just before the ending &lt;/body&gt; tag) so that your page loads first, and then your javascript.</p>
<h3>Tip 3: Compress Your Javascript</h3>
<p>This tip is meant more for web applications that utilize a lot of javascript. By compressing your javascript with a tool like <a href="http://developer.yahoo.com/yui/compressor/" title="Download YUI Compressor to compress your javascript">YUI Compressor</a>, you can cut down on the size of your javascript files so that they can be downloaded to the client quicker, resulting in earlier execution.</p>
<h3>Tip 4: Optimize Your Algorithms</h3>
<p>This tip is also meant more for web applications as building websites typically do not require the use of algorithms. As I&#8217;ve learned with the development of <a href="http://www.gosammy.com/2007/07/06/wii-friend-number-facebook-app-released/">my facebook application</a>, the use of a very inefficient algorithm can break your application.</p>
<p>Long story short, I created my facebook application in PHP and deployed it on a very powerful Joyent server that I was able to use for free for a year as part of a promotion. I created a very inefficient algorithm during a lookup which performed fine on the Joyent server. However, when the year of free service came to an end, I moved the application over to my personal server and saw the application break. The use of unnecessary nested loops was later rewritten into one loop and then the application came back to life.</p>
<h3>Tip 5: Cache Dynamic Content on the Server When Possible</h3>
<p>Codeigniter is one of my favourite PHP frameworks to work with. I&#8217;ve used it a ton for its great performance and ease of use. On one of my projects I used it for, I noticed that it was having to constantly look-up data from the database when I knew that it didn&#8217;t necessarily have to. I knew that there were caching plugins for WordPress which worked by saving static pages of dynamic content. If something liked this existed for WordPress, then surely it must for CodeIgniter since it had such a strong community.</p>
<p>Lo and behold the core installation of Codeigniter already included <a href="http://codeigniter.com/user_guide/general/caching.html" title="Read the CodeIgniter user guide on caching" class="qtiplink">methods of caching dynamic content</a>. After implementing it, less database calls were made which resulted in a more efficient application.</p>
<p>There are also some modules for PHP which can be installed to help give an even better boost with server side caching such as <a href="http://xcache.lighttpd.net/">XCache</a>. Installing this alongside with smartly utilizing cache methods in CodeIgniter can make your web app perform almost as fast as if it were a static web page.</p>
<h3>Tip 6: Tweak Your Server Set-up</h3>
<p>For the longest time I was a user of Apache. Of course, when I started out making websites, I really had no idea what a web server consisted of so I was using it without knowing.</p>
<p>When I set out to set up my own VPS for the first time, I went with an installation that used Apache. When I found that it was constantly eating up memory, I did more research on how to optimize it. It turned out that Apache was a bit hungry on memory.</p>
<p><div id="attachment_826" class="wp-caption aligncenter" style="width: 510px"><a href="http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/"><img src="http://www.gosammy.com/wp-content/uploads/2010/07/apache_vs_nginx.jpg" alt="Apache vs. Nginx Response Time" title="Apache vs. Nginx Response Time" width="500" height="331" class="size-full wp-image-826" /></a><p class="wp-caption-text">A graph of Apache vs. Nginx Response Time. Apache is represented in blue.</p></div></p>
<p>In the above graph that was taken from <a href="http://www.joeandmotorboat.com/2008/02/28/apache-vs-nginx-web-server-performance-deathmatch/">Joe&#8217;s Blog</a>, it&#8217;s easy to see that Apache isn&#8217;t the most efficient server out there. There are things you can do however to optimize Apache so it performs better, but I ended up switching to using Nginx since it used up less memory. You could also see performance gains by using Nginx as a reverse proxy alongside Apache to get the best of both worlds. More about my Nginx experiences at another time though.</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2008/04/08/how-to-create-your-very-own-archive-navigator/" title="How to Create Your Very Own &#8220;Archive Navigator&#8221;">How to Create Your Very Own &#8220;Archive Navigator&#8221;</a></li><li><a href="http://www.gosammy.com/2007/08/30/integrating-flickr-into-your-wordpress-theme/" title="Integrating Flickr Into Your Wordpress Theme">Integrating Flickr Into Your Wordpress Theme</a></li><li><a href="http://www.gosammy.com/2008/06/11/improving-the-archive-navigator-graceful-degradation/" title="Improving the Archive Navigator; Graceful Degradation">Improving the Archive Navigator; Graceful Degradation</a></li><li><a href="http://www.gosammy.com/2011/07/15/a-new-portfolio/" title="A New Portfolio">A New Portfolio</a></li><li><a href="http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/" title="Using Git Between Mac and Windows">Using Git Between Mac and Windows</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2010/07/23/six-tips-for-optimizing-your-websiteweb-application/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>iPhone Specific Favicon</title>
		<link>http://www.gosammy.com/2009/02/04/iphone-specific-favicon/</link>
		<comments>http://www.gosammy.com/2009/02/04/iphone-specific-favicon/#comments</comments>
		<pubDate>Thu, 05 Feb 2009 00:49:24 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=688</guid>
		<description><![CDATA[Did you ever wonder how Google specified an iPhone specific icon for their mobile Gmail Tasks application to your iPhone home screen? It turns out it's about as simple as applying any regular favicon.]]></description>
			<content:encoded><![CDATA[<p>Earlier this week, Google released a mobile version of Gmail Tasks which could be accessed on the iPhone/iPod touch or an Android device as its internet browser is also <a href="http://webkit.org/" title="The WebKit Open Source Project">WebKit</a> based. I thought it was great that Google allowed us to manage our tasklist previously only accessible through Gmail or a <a href="http://mail.google.com/mail/help/tasks/" title="Google Tasks in Labs">Google Gadget</a> on the go now &#8211; but was pleasantly surprised at the attention to detail when you added the site to your Home screen on the iPhone:</p>
<div class="center">
<a href="http://www.flickr.com/photos/senmu/3253771411/" title="How did Google specify this special tasks icon? by Senmu, on Flickr"><img src="http://farm4.static.flickr.com/3124/3253771411_84b2ffab0e.jpg" width="500" height="375" alt="How did Google specify this special tasks icon?" /></a><br />
<small>How did Google specify this iPhone specific icon?</small>
</div>
<p>Getting your site to have this &#8220;iPhone specific favicon&#8221; was just as simple as applying a regular favicon. To do so, just insert a tag like so in the &lt;head&gt; section of your markup:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/link.html"><span class="kw2">&lt;link</span></a> <span class="kw3">rel</span>=<span class="st0">&#8220;apple-touch-icon&#8221;</span> <span class="kw3">href</span>=<span class="st0">&#8220;PATH_TO_ICON_HERE&#8221;</span> /<span class="kw2">&gt;</span></a></span></div>
</div>
<p>Obviously, just replace &#8220;PATH_TO_ICON_HERE&#8221; with an image path and you&#8217;re all set!<br />
To keep things to spec, be sure to design your icon in a 57&#215;57 pixel canvas and export it to PNG format when finished.<br />
If you&#8217;d like a sample to work with, why not check out the <a href="http://www.gstatic.com/m/og/icons/tasks-iphone-57x57-p.png" title="Apple iphone specific tasks icon">tasks icon</a> Google uses?</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2011/04/11/bbm-probably-wont-be-available-to-iphoneandroid/" title="BBM Probably Won&#8217;t Be Available to iPhone/Android">BBM Probably Won&#8217;t Be Available to iPhone/Android</a></li><li><a href="http://www.gosammy.com/2010/11/18/next-stop-an-iphone-app-for-calgary-transit/" title="Next Stop: An iPhone App for Calgary Transit">Next Stop: An iPhone App for Calgary Transit</a></li><li><a href="http://www.gosammy.com/2007/08/15/iphone-web-concept-kit/" title="iPhone Web Concept Kit">iPhone Web Concept Kit</a></li><li><a href="http://www.gosammy.com/2011/10/19/commute-logger/" title="Commute Logger">Commute Logger</a></li><li><a href="http://www.gosammy.com/2011/07/15/a-new-portfolio/" title="A New Portfolio">A New Portfolio</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2009/02/04/iphone-specific-favicon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First Impressions of Google&#8217;s New Browser: Chrome</title>
		<link>http://www.gosammy.com/2008/09/02/first-impressions-of-googles-new-browser-chrome/</link>
		<comments>http://www.gosammy.com/2008/09/02/first-impressions-of-googles-new-browser-chrome/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 21:27:22 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[chrome]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=554</guid>
		<description><![CDATA[Just yesterday, <a href="http://blogoscoped.com/archive/2008-09-01-n47.html" title="Google Chrome, Google's Browser Project">news surfaced</a> that Google was going to release a browser which was being used internally. Now that it's been <a href="http://www.google.com/chrome?open" title="Download Google Chrome">released as a beta for Windows</a> as of this moment, how did it do?]]></description>
			<content:encoded><![CDATA[<p>Just yesterday, <a href="http://blogoscoped.com/archive/2008-09-01-n47.html" title="Google Chrome, Google's Browser Project">news surfaced</a> that Google was going to release a browser which was being used internally. It was a bit of a surprise for sure but when I first read the news, I was pretty excited because of the claim that the browser would run multiple processes instead of the way browsers usually ran which was single-threaded. Also, javascript rendering was going to be done by a new engine built from scratch called V8. In layman&#8217;s terms this meant that Google Chrome was going to be fast.</p>
<p>Now that it&#8217;s been <a href="http://www.google.com/chrome?open" title="Download Google Chrome">released as a beta for Windows</a> as of this moment (Mac and Linux versions are currently being developed), how did it fare to this claim?</p>
<h3>Installation</h3>
<p>Installing the browser was a very easy task. Google made it so simple that it automatically installs it onto your primary drive without even asking you where you&#8217;d like to install it. After it&#8217;s done installing, it prompts you if you&#8217;d like to customize it (import bookmarks, set as default browser, etc.):</p>
<div class="center">
<a href="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_1.jpg"><img src="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_1-300x168.jpg" alt="" title="Customize Google Chrome?" width="300" height="168" class="alignnone size-medium wp-image-556" /></a>
</div>
<p>You can specify which customizations you&#8217;d like, and it&#8217;s nice that Google unchecked it from making it the default browser:</p>
<div class="center">
<a href="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_2.jpg"><img src="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_2-300x194.jpg" alt="" title="Google Chrome Advanced Customization" width="300" height="194" class="alignnone size-medium wp-image-557" /></a>
</div>
<p>Once finished with the installation, you finally get to see Google Chrome in all its glory with a UI that&#8217;s getting some mixed reception. Personally, I kind of like it:</p>
<div class="center">
<a href="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_3.jpg"><img src="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_3-300x180.jpg" alt="" title="Google Chrome First Screen" width="300" height="180" class="alignnone size-medium wp-image-559" /></a>
</div>
<p>If you open a new tab, you get a page similar to Opera&#8217;s speed dial of recently visited pages, and your bookmarks. It&#8217;s quite handy:</p>
<div class="center">
<a href="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_4.jpg"><img src="http://www.gosammy.com/wp-content/uploads/2008/09/google_chrome_4-300x220.jpg" alt="" title="Google Chrome New Tab" width="300" height="220" class="alignnone size-medium wp-image-561" /></a>
</div>
<h3>Browsing Experience</h3>
<p>With the half-hour I&#8217;ve been playing with it, I have to say I&#8217;m really liking how Google&#8217;s browser is shaping up. Some of the advantages it has over Firefox is that it does feel a lot faster, especially with javascript intensive pages (like a post from digg with comments) and it also feels a lot more lightweight in regards to its footprint. According to the <a href="http://www.google.com/googlebooks/chrome/#" title="Google Chrome Comic">comic</a> that Google released which is sort of like its instruction manual, memory usage will start of higher than most browsers but then in the long run use less memory because of its multi-process design.</p>
<p>On a sidenote, I was worried an introduction of a new browser would make my job as a web developer tougher as I first thought it would be another rendering engine I had to make compatible with, but its rendering engine is based on webkit (the same as Safari&#8217;s) so I&#8217;m happy about that.</p>
<p>Overall, it&#8217;s shaping up to be a really nice browser and I think if it proves to be stable to me, I will use it over Firefox every chance I get just because it&#8217;s much more speedy.</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2007/05/16/new-version-of-google-analytics/" title="New Version of Google Analytics">New Version of Google Analytics</a></li><li><a href="http://www.gosammy.com/2007/04/21/piclens-immerse-yourself-in-photos-on-the-web/" title="PicLens: Immerse Yourself in Photos on the Web">PicLens: Immerse Yourself in Photos on the Web</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2008/09/02/first-impressions-of-googles-new-browser-chrome/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>everystockphoto</title>
		<link>http://www.gosammy.com/2008/08/18/everystockphoto/</link>
		<comments>http://www.gosammy.com/2008/08/18/everystockphoto/#comments</comments>
		<pubDate>Mon, 18 Aug 2008 18:50:40 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Photography]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[stock photography]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=523</guid>
		<description><![CDATA[Just yesterday, I found <a href="http://www.everystockphoto.com/" title="everystockphoto">everystockphoto</a> which is a search engine for free photos. This is a brilliant idea for a search engine as there are free photos on flickr too but searching the photos with those specific creative commons attributes isn't as easily accessible as everystockphoto provides.]]></description>
			<content:encoded><![CDATA[<p>During the design process, I&#8217;ve become more accepting towards utilizing stock photography which is quite accessible through the web. One site that I&#8217;ve primarily used is <a href="http://sxc.hu" title="stock.xchng">stock.xchng</a> as the photos are free and usually come with close to hassle-free licensing. I&#8217;ve also used <a href="http://istockphoto.com" title="iStockphoto">iStockphoto</a> recently which contains more higher quality stock photos for cheap prices. </p>
<p><a href="http://everystockphoto.com" title="everystockphoto"><img src="http://www.gosammy.com/wp-content/uploads/2008/08/screenshot2-300x204.jpg" alt="everystockphoto" title="everystockphoto" width="300" height="204" class="size-medium alignright" /></a>Just yesterday, I found <a href="http://www.everystockphoto.com/" title="everystockphoto">everystockphoto</a> which is a search engine for free photos. This is a brilliant idea for a search engine as there are free photos on flickr too but searching the photos with those specific creative commons attributes isn&#8217;t as easily accessible as everystockphoto provides. Not only that, but sxc.hu and flickr aren&#8217;t everystockphotos only sources, there are even more sites that everystockphoto pulls results from making it easier to find that perfect stock photo (for free!) that you&#8217;re looking for.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2008/08/18/everystockphoto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Improving the Archive Navigator; Graceful Degradation</title>
		<link>http://www.gosammy.com/2008/06/11/improving-the-archive-navigator-graceful-degradation/</link>
		<comments>http://www.gosammy.com/2008/06/11/improving-the-archive-navigator-graceful-degradation/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 17:50:39 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=450</guid>
		<description><![CDATA[In this post, I will follow up on some of the comments and requests that generated around my newly popular post, <a href="/2008/04/08/how-to-create-your-very-own-archive-navigator/" title="How to Create Your Very Own Archive Navigator">How to Create Your Very Own "Archive Navigator"</a>. I'll cover graceful degradation (for non-javascript), and how to achieve tabs like I did.]]></description>
			<content:encoded><![CDATA[<p>In this post, I will follow up on some of the comments and requests that generated around my newly popular post, <a href="/2008/04/08/how-to-create-your-very-own-archive-navigator/" title="How to Create Your Very Own Archive Navigator">How to Create Your Very Own "Archive Navigator"</a>. It might be handy to have that post open up in a second tab as I make a lot of references to it.</p>
<h3>Graceful Degradation for Non-Javascript Users</h3>
<p>When you build a solution with javascript, you should always try your best to make it accessible for non-javascript users. The non-javascript version doesn't need to be as fancy or even attempt to mimic what can be done with javascript, <i>it just needs to be accessible</i>. Case in point, turn javascript off and take a look at what happens to the archive navigator to the right. The tabs won't work, the box won't slide, but at least you can still access all the content inside the box. </p>
<p>Now if you took the code I wrote in last post and just pasted it, it's not degradable. If you were to view it without javascript, you'd see something like the following:</p>
<div class="center">
<a href='/wp-content/uploads/2008/05/archive_navigator1.html'><img src="http://www.gosammy.com/wp-content/uploads/2008/05/archive-navigator-1-220x300.gif" alt="Barebones 'Archive Navigator'" title="archive-navigator-1" width="220" height="300" class="size-medium wp-image-451" /></a><br />
<small>It's what you'd see with javascript, but the buttons won't work.<br />Click above image for demo.</small>
</div>
<p>If you recall from the last post, there were three divs. One saying 'Hello World', another saying 'Hello Earth', and the last saying 'Hello Planet'. If a person browsing with javascript disabled saw this, the other two divs are hidden from them. And the reason for this is the CSS property we assigned to the parenting div: <i>overflow: hidden;</i></p>
<p>When I thought about the easiest way to make my archive navigator accessible without javascript, altering the CSS was the simplest option as it required the least modifications. The most important modification of course is to remove that overflow:hidden; CSS property. What I did was replace it with: <i>overflow:auto;</i>. This allows the div to display scrollbars when given specific dimensions smaller than the inner contents. To restore the overflow:hidden; CSS property for javascript users, we can easily make that assignment <a href="http://docs.jquery.com/CSS/css#namevalue">using jQuery</a>:</p>
<div class="codesnip-container" >
<div class="codesnip">$<span class="br0">&#40;</span><span class="st0">".crop"</span><span class="br0">&#41;</span>.<span class="me1">css</span><span class="br0">&#40;</span><span class="st0">"overflow"</span>,<span class="st0">"hidden"</span><span class="br0">&#41;</span>;</div>
</div>
<p>By doing the above, the archive navigator is accessible by those browsing with javascript disabled.</p>
<h3>How To Make Tabs Like I Did</h3>
<p>From the comments in last post, a lot of people wondered how I made the tabs in my archive navigator and how I got them to change style when clicked. First off, I did not use buttons, I used an unordered list:</p>
<p>Here is the HTML for my tabs:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/ul.html"><span class="kw2">&lt;ul&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/li.html"><span class="kw2">&lt;li</span></a> <span class="kw3">id</span>=<span class="st0">"btn-popular"</span> <span class="kw3">class</span>=<span class="st0">"tab"</span><span class="kw2">&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/a.html"><span class="kw2">&lt;a</span></a> <span class="kw3">href</span>=<span class="st0">"javascript:;"</span><span class="kw2">&gt;</span></a></span>Popular<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span><span class="sc2"><span class="kw2">&lt;/li&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/li.html"><span class="kw2">&lt;li</span></a> <span class="kw3">id</span>=<span class="st0">"btn-latest"</span> <span class="kw3">class</span>=<span class="st0">"tab"</span><span class="kw2">&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/a.html"><span class="kw2">&lt;a</span></a> <span class="kw3">href</span>=<span class="st0">"javascript:;"</span><span class="kw2">&gt;</span></a></span>Latest<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span><span class="sc2"><span class="kw2">&lt;/li&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/li.html"><span class="kw2">&lt;li</span></a> <span class="kw3">id</span>=<span class="st0">"btn-categories"</span> <span class="kw3">class</span>=<span class="st0">"tab"</span><span class="kw2">&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/a.html"><span class="kw2">&lt;a</span></a> <span class="kw3">href</span>=<span class="st0">"javascript:;"</span><span class="kw2">&gt;</span></a></span>Categories<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span><span class="sc2"><span class="kw2">&lt;/li&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/ul&gt;</span></span></div>
</div>
<p>If you're wondering about the &lt;a href=&quot;javascript:;&quot;&gt;&lt;/a&gt; tags wrapping the text, it is meant to make the cursor change to make it look like it's clickable (the hand). I'm aware you can do this in CSS, but IE does not follow it. Also, instead of making href point to "#", I assign "javascript:;" instead so that the page will not scroll back to the top. It's a bit hacky, but it works.</p>
<p>Next, it's all jQuery. I created handlers for the three different li elements: #btn-popular, #btn-latest, and #btn-categories. Here's a sample of the handler I wrote for #btn-popular:</p>
<div class="codesnip-container" >
<div class="codesnip">$<span class="br0">&#40;</span><span class="st0">"#btn-popular"</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>currentView != <span class="st0">"popular"</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">"#btn-popular"</span><span class="br0">&#41;</span>.<span class="me1">toggleClass</span><span class="br0">&#40;</span><span class="st0">"selectedView"</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Navigator.<span class="me1">changeTabStyle</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; Navigator.<span class="me1">goToPopular</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; currentView = <span class="st0">"popular"</span>;<br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</div>
<p>And now the breakdown of the code snippet above:</p>
<ol>
<li>For this handler, I want something to happen when #btn-popular is <i>clicked</i>. Hence the first line.</li>
<li>Next I check if the user is already viewing the first div (which is the popular posts). I have a global variable called currentView which stores which div is currently being viewed. If it is not on the first div, the code inside this if statement is executed.</li>
<li>In the if statement, I tell the #btn-popular li element to change its class to "selectedView". This class is defined in my stylesheet which gives it a white background and bolds the text. In other words, it makes it look like it's active. On the next line, I call a function called "changeTabStyle" which basically tells all other li elements (besides #btn-popular) to go back to their default class so that they no longer look active.</li>
<li>In the next line of code, I call a function which moves the wide area to scroll to the first div (popular).</li>
<li>Lastly, I assign the global variable to "popular" so that when another handler is executed, it can check what the user is currently viewing (as demonstrated in point 2).</li>
</ol>
<h3>Final Words</h3>
<p>If you're going to take anything away from this post, it should be this: <i><b>Develop for non-javascript users, then add javascript functionality later</b></i>.</p>
<p>Why bother? It's true that it could just be a handful of people browsing without javascript, but think about the benefits; by making your sites, widgets or applications accessible, it becomes SEO friendly. With that said, people browsing with screen readers will not be missing anything either.</p>
<p>If you'd like a quick way to test your work with javascript disabled, I highly recommend the <a href="https://addons.mozilla.org/en-US/firefox/addon/60" title="Web Developer Firefox Extension">Web Developer Firefox Extension</a>. There is a "Disable" menu which allows you to disable javascript in two clicks! Also, if you don't have Firebug already...<a href="https://addons.mozilla.org/en-US/firefox/addon/1843" title="Firebug">get it</a>.</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2008/04/08/how-to-create-your-very-own-archive-navigator/" title="How to Create Your Very Own &#8220;Archive Navigator&#8221;">How to Create Your Very Own &#8220;Archive Navigator&#8221;</a></li><li><a href="http://www.gosammy.com/2010/07/23/six-tips-for-optimizing-your-websiteweb-application/" title="Six Tips for Optimizing Your Website/Web Application">Six Tips for Optimizing Your Website/Web Application</a></li><li><a href="http://www.gosammy.com/2011/07/15/a-new-portfolio/" title="A New Portfolio">A New Portfolio</a></li><li><a href="http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/" title="Using Git Between Mac and Windows">Using Git Between Mac and Windows</a></li><li><a href="http://www.gosammy.com/2011/04/11/bbm-probably-wont-be-available-to-iphoneandroid/" title="BBM Probably Won&#8217;t Be Available to iPhone/Android">BBM Probably Won&#8217;t Be Available to iPhone/Android</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2008/06/11/improving-the-archive-navigator-graceful-degradation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating a Facebook Application: Getting Started</title>
		<link>http://www.gosammy.com/2008/04/26/creating-a-facebook-application-getting-started/</link>
		<comments>http://www.gosammy.com/2008/04/26/creating-a-facebook-application-getting-started/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 18:09:54 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[linkedin]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=436</guid>
		<description><![CDATA[Developing a Facebook application is a great starting point in learning to develop database driven web applications. Prior to developing the Wii Friend Number app, I was mostly a front end developer. After releasing it, I felt I was a more well-rounded developer now that I understood the basics of back end development.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been nearly 10 months since I released <a href="/2007/07/06/wii-friend-number-facebook-app-released/" title="Wii Friend Number - Facebook App Released">my first Facebook application</a>, and since then, the platform has really been growing. The great thing about the Facebook platform is that by developing an application for it, you have the potential to tap into a vast audience quite easily. If you&#8217;re looking to develop an application and have it become popular quickly, it&#8217;s a great place.</p>
<p>Developing a Facebook application is also a great starting point in learning to develop database driven web applications. Prior to developing the Wii Friend Number app, I was mostly a front end developer. After releasing it, I felt I was a more well-rounded developer now that I understood the basics of back end development.</p>
<h3>So How Do I Get Started?</h3>
<p>First off, it&#8217;s given that you need a Facebook account. You will also need a hosting environment which supports the technology you choose to develop for, so for PHP, a <a href="http://en.wikipedia.org/wiki/LAMP_(software_bundle)" title="LAMP (software bundle)">LAMP</a> stack works. Next, add the <a href="http://www.facebook.com/developers/" title="Facebook Developers">Developer application</a>. The Developer application will be where you do most of the administrative stuff such as applying for an API key.</p>
<p>After adding the Developer application, navigate to it and press <b>Set Up New Application</b>:</p>
<p><img src="http://www.gosammy.com/wp-content/uploads/2008/04/create_new_app.jpg" alt="" title="create_new_app" width="452" height="123" class="center size-full wp-image-437" /></p>
<p>It will bring you to a form where you will fill out information about the application you will create. There are optional fields you can fill out but you don&#8217;t need to worry about them, most of it can be modified after you&#8217;ve created your app. Hopefully you have an idea of an application at this point, otherwise, spend some time thinking about it. I don&#8217;t think you can change the name of it after it&#8217;s created.</p>
<p>Since I&#8217;ve developed my app, Facebook has made it super easy to start now. There will be link to some sample code:</p>
<p><img src="http://www.gosammy.com/wp-content/uploads/2008/04/sample_code.jpg" alt="" title="sample_code" width="265" height="38" class="center size-full wp-image-438" /></p>
<p>Upon clicking it, you will receive instructions on how to begin developing your app within 3 steps if you choose to develop it in PHP (recommended). Also on this page are sample applications and links to documentation on the platform.</p>
<p>If you choose to develop your app in Java, a link to the Java client library is provided. Be sure to note the API and Secret keys listed on this page as well as you&#8217;ll need those when you edit your config file.</p>
<h3>What Do I Do Once I&#8217;m Finished?</h3>
<p>After you&#8217;ve finished developing your application, you&#8217;ll want to submit it to the Facebook Application Directory (link accessible from Developer application):</p>
<p><img src="http://www.gosammy.com/wp-content/uploads/2008/04/app_submit-1.jpg" alt="" title="app_submit-1" width="347" height="52" class="aligncenter size-full wp-image-439" /></p>
<p>This allows your app to be searched by Facebook users. You&#8217;ll also want to allow your app to be added by people other then just yourself:</p>
<p><a href='http://www.gosammy.com/wp-content/uploads/2008/04/edit_settings.jpg'><img src="http://www.gosammy.com/wp-content/uploads/2008/04/edit_settings.jpg" alt="" title="edit_settings" width="166" height="138" class="alignnone size-medium wp-image-440" /></a> <a href='http://www.gosammy.com/wp-content/uploads/2008/04/add_app.jpg'><img src="http://www.gosammy.com/wp-content/uploads/2008/04/add_app.jpg" alt="" title="add_app" width="470" height="39" class="alignnone size-full wp-image-441" /></a></p>
<h3>Additional Resources</h3>
<ul>
<li><a href="http://developers.facebook.com/" title="Facebook Developers">Facebook Developers Site</a></li>
<li><a href="http://facebook-developer.net/2007/10/18/building-your-first-facebook-application-with-cakephp/" title="Building Your First Facebook Application with CakePHP">Building Your First Facebook Application with CakePHP</a></li>
<li><a href="http://gotads.blogspot.com/2007/07/finding-sample-code-for-facebook-apps.html" title="Finding Sample Code for Facebook Apps">Finding Sample Code for Facebook Apps</a></li>
</ul>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2008/06/06/what-ive-been-up-to-wii-friend-number-facebook-app-2/" title="What I&#8217;ve Been Up To: Wii Friend Number Facebook App 2">What I&#8217;ve Been Up To: Wii Friend Number Facebook App 2</a></li><li><a href="http://www.gosammy.com/2011/07/15/a-new-portfolio/" title="A New Portfolio">A New Portfolio</a></li><li><a href="http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/" title="Using Git Between Mac and Windows">Using Git Between Mac and Windows</a></li><li><a href="http://www.gosammy.com/2011/04/11/bbm-probably-wont-be-available-to-iphoneandroid/" title="BBM Probably Won&#8217;t Be Available to iPhone/Android">BBM Probably Won&#8217;t Be Available to iPhone/Android</a></li><li><a href="http://www.gosammy.com/2010/11/18/next-stop-an-iphone-app-for-calgary-transit/" title="Next Stop: An iPhone App for Calgary Transit">Next Stop: An iPhone App for Calgary Transit</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2008/04/26/creating-a-facebook-application-getting-started/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>How to Create Your Very Own &#8220;Archive Navigator&#8221;</title>
		<link>http://www.gosammy.com/2008/04/08/how-to-create-your-very-own-archive-navigator/</link>
		<comments>http://www.gosammy.com/2008/04/08/how-to-create-your-very-own-archive-navigator/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 04:21:29 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/?p=426</guid>
		<description><![CDATA[Last week I received an email from fellow reader Jaap asking if I could provide a link to a plugin that would implement something like my very cool Archive Navigator you see to the right. I've provided a link to a plugin which looks to achieve a similar effect and wrote a mini-tutorial for those who want to take a stab at developing it themselves.]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.gosammy.com/wp-content/uploads/2008/04/archive_nav-leadimg.jpg'><img src="http://www.gosammy.com/wp-content/uploads/2008/04/archive_nav-leadimg.jpg" alt="Archive Navigator Title Image" title="archive_nav-leadimg" width="565" height="145" class="alignnone size-full wp-image-427" /></a></p>
<div class="alert">Be sure to check out <a href="/2008/06/11/improving-the-archive-navigator-graceful-degradation/" title="Improving the Archive Navigator; Graceful Degradation">part two</a> of this tutorial afterwards!</div>
<p>Last week I received an email from fellow reader Jaap asking if I could provide a link to a plugin that would implement something like my very cool Archive Navigator you see to the right.</p>
<p>I did some searching and found a <a href="http://www.jquery.com" title="jQuery">jQuery</a> plugin that is capable of the same effect called <a href="http://www.ndoherty.com/demos/coda-slider/1.1.1/" title="Coda-Slider">Coda-Slider</a>. The reason this plugin is called 'Coda-Slider', is because this effect was made popular on Panic's product site for their web development software called <a href="http://www.panic.com/coda/" title="Coda - One Window Web Development">Coda</a>. </p>
<div class="center">[See post to watch Flash video]</div>
<p>If you're looking for a quick solution to pull this off, head on over to <a href="http://www.ndoherty.com/blog/category/coda-slider" title="Niall Doherty - Archive for the Coda-Slider Category">Niall Doherty's blog</a> (the author of the Coda-Slider plugin) and download it. There's enough documentation there to pull off the effect in a matter of minutes if you know what you're doing. </p>
<p>But if you're looking to improve on your web developing skills, I'll show you how to pull this off from scratch and customize it for WordPress using just the jQuery library.</p>
<div class="warning">
<b>Warning:</b> The following will require intermediate HTML and CSS knowledge.
</div>
<h3>Step 1: Building the Navigator</h3>
<p>First, we're going to build out the elements needed for the Navigator. Open up your <a href="http://macromates.com/" title="TextMate">favorite text editor</a> and create a couple of divs which will nest like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">class</span>=<span class="st0">"crop"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">class</span>=<span class="st0">"widearea"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">"divone"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hello World<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">"divtwo"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hello Earth<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">"divthree"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hello Planet<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
</div>
<p>With CSS, we will try to achieve a layout like the following diagram:<br />
<a href='/wp-content/uploads/2008/04/htmldiagram-lrg.gif'><img src="/wp-content/uploads/2008/04/htmldiagram.gif" alt="" title="Diagram of divs" width="565" height="226" class="alignnone size-full wp-image-430" /></a><br />
Here's some sample CSS code that will go along with the HTML above:</p>
<div class="codesnip-container" >
<div class="codesnip">div<span class="re1">.<span class="kw2">crop</span> </span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">width</span>: 300px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">height</span>: 400px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">overflow</span>: <span class="kw2">hidden</span>;<br />
<span class="br0">&#125;</span></p>
<p>div<span class="re1">.widearea </span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">width</span>: 1000px;&nbsp; <span class="coMULTI">/*make it as wide as needed to fit all child divs<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; in one row*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">height</span>: 400px;<br />
<span class="br0">&#125;</span></p>
<p>div<span class="re1">.widearea </span>div <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">width</span>: 300px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">height</span>: 400px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">display</span>: <span class="kw2">block</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">float</span>: <span class="kw1">left</span>;<br />
<span class="br0">&#125;</span></div>
</div>
<p>Since the .crop div is a parent div of the other divs, specifying fixed dimensions as well as assigning hidden to the overflow attribute will effectively crop out anything not inside its dimensions. Although this example only has three divs, you can create as many as you want as long as you make the .widearea div wide enough.</p>
<p>Next, we'll need to add some controllers available to the user so that they can interact with this. For simplicity's sake, let's add three buttons:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">class</span>=<span class="st0">"crop"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; ...<br />
<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></p>
<p><span class="sc2"><a href="http://december.com/html/4/element/button.html"><span class="kw2">&lt;button</span></a> <span class="kw3">id</span>=<span class="st0">"buttonone"</span><span class="kw2">&gt;</span></a></span>Go to divone<span class="sc2"><span class="kw2">&lt;/button&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/button.html"><span class="kw2">&lt;button</span></a> <span class="kw3">id</span>=<span class="st0">"buttontwo"</span><span class="kw2">&gt;</span></a></span>Go to divtwo<span class="sc2"><span class="kw2">&lt;/button&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/button.html"><span class="kw2">&lt;button</span></a> <span class="kw3">id</span>=<span class="st0">"buttonthree"</span><span class="kw2">&gt;</span></a></span>Go to divthree<span class="sc2"><span class="kw2">&lt;/button&gt;</span></span></div>
</div>
<p>Now that we've built out the HTML, we will start getting into the fun stuff.</p>
<h3>Effects with jQuery</h3>
<p>The first thing that needs to happen before we can start writing javascript for the jQuery library is to reference it. I recommend <a href="http://jquery.com" title="jQuery">downloading it</a> and referencing it off your own host rather than referencing it elsewhere.</p>
<p>Once you've dropped the library into your host, add a reference to it in your html like so:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/script.html"><span class="kw2">&lt;script</span></a> <span class="kw3">type</span>=<span class="st0">"text/javascript"</span> <span class="kw3">src</span>=<span class="st0">"jquery-1.2.3.min.js"</span><span class="kw2">&gt;</span></a></span><span class="sc2"><span class="kw2">&lt;/script&gt;</span></span></div>
</div>
<p>Next, create a new js file with your text editor. This will hold all the custom javascript we will write. Let's take a step back and try and figure out what our objectives are before we start writing code:</p>
<ol>
<li>Add a click event handler to our buttons</li>
<li>Create one (or more) functions which will produce the sliding effect</li>
</ol>
<p>So for the first objective, creating a click event handler (also known as onClick) is real simple using jQuery:</p>
<div class="codesnip-container" >
<div class="codesnip">$<span class="br0">&#40;</span><span class="st0">"#buttonone"</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; enter your <span class="kw2">function</span> here<br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</div>
<p>Hopefully it's intuitive enough that you clued in that to create the other click event handlers for the other two buttons, you just had to copy and paste that line of code and replace buttonone with buttontwo or buttonthree. To explain this a little better: we are targeting the button with id buttonone (as done with $("#buttonone")) and then assigning a click event handler which will call a function.</p>
<p>Next, we will create the functions inside these click event handlers which will "scroll" the .widearea div horizontally:</p>
<div class="codesnip-container" >
<div class="codesnip">$<span class="br0">&#40;</span><span class="st0">"#buttonone"</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">".widearea"</span><span class="br0">&#41;</span>.<span class="me1">animate</span><span class="br0">&#40;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marginLeft: <span class="st0">"0px"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>, <span class="nu0">500</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</div>
<p>In our function, we are instructing the .widearea div to animate to margin-left (note how jQuery's syntax is a little different from CSS) of 0. If you got this set up, you'll notice clicking on the button doesn't do anything, that's because by default, we are already seeing divone so there's no reason to move the .widearea div. Let's set it up for buttontwo:</p>
<div class="codesnip-container" >
<div class="codesnip">$<span class="br0">&#40;</span><span class="st0">"#buttontwo"</span><span class="br0">&#41;</span>.<span class="me1">click</span><span class="br0">&#40;</span><span class="kw2">function</span><span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; $<span class="br0">&#40;</span><span class="st0">".widearea"</span><span class="br0">&#41;</span>.<span class="me1">animate</span><span class="br0">&#40;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marginLeft: <span class="st0">"-300px"</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span>, <span class="nu0">500</span><span class="br0">&#41;</span>;<br />
<span class="br0">&#125;</span><span class="br0">&#41;</span>;</div>
</div>
<p>If you add this in and click on buttontwo, the .widearea div should move 300px to the left so that #divtwo is in view. If you're wondering what the "500" is for, it specifies how long the animation should last in milliseconds.</p>
<h3>Putting it all together now...</h3>
<p>Eventually, after coding everything up, you'd end up with something like this:</p>
<div class="codesnip-container" >
<div class="codesnip"><span class="sc2"><a href="http://december.com/html/4/element/html.html"><span class="kw2">&lt;html&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/head.html"><span class="kw2">&lt;head&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/title.html"><span class="kw2">&lt;title&gt;</span></a></span>Slider<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/style.html"><span class="kw2">&lt;style</span></a> <span class="kw3">type</span>=<span class="st0">"text/css"</span> <span class="kw3">media</span>=<span class="st0">"screen"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div.crop {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: 300px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height: 400px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; overflow: hidden;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div.widearea {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: 1000px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height: 400px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; div.widearea div {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; width: 300px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; height: 400px;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; display: block;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; float: left;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/style&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/body.html"><span class="kw2">&lt;body&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">class</span>=<span class="st0">"crop"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">class</span>=<span class="st0">"widearea"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">"divone"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hello World<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">"divtwo"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hello Earth<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">"divthree"</span><span class="kw2">&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Hello Planet<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/button.html"><span class="kw2">&lt;button</span></a> <span class="kw3">id</span>=<span class="st0">"buttonone"</span><span class="kw2">&gt;</span></a></span>Go to divone<span class="sc2"><span class="kw2">&lt;/button&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/button.html"><span class="kw2">&lt;button</span></a> <span class="kw3">id</span>=<span class="st0">"buttontwo"</span><span class="kw2">&gt;</span></a></span>Go to divtwo<span class="sc2"><span class="kw2">&lt;/button&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/button.html"><span class="kw2">&lt;button</span></a> <span class="kw3">id</span>=<span class="st0">"buttonthree"</span><span class="kw2">&gt;</span></a></span>Go to divthree<span class="sc2"><span class="kw2">&lt;/button&gt;</span></span></p>
<p><span class="sc2"><a href="http://december.com/html/4/element/script.html"><span class="kw2">&lt;script</span></a> <span class="kw3">type</span>=<span class="st0">"text/javascript"</span> <span class="kw3">src</span>=<span class="st0">"jquery-1.2.3.min.js"</span><span class="kw2">&gt;</span></a></span><span class="sc2"><span class="kw2">&lt;/script&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/script.html"><span class="kw2">&lt;script</span></a> <span class="kw3">type</span>=<span class="st0">"text/javascript"</span> <span class="kw3">charset</span>=<span class="st0">"utf-8"</span><span class="kw2">&gt;</span></a></span><br />
$(document).ready(function(){<br />
&nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#buttonone&quot;).click(function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;.widearea&quot;).animate({<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marginLeft: &quot;0px&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, 500);<br />
&nbsp; &nbsp; &nbsp; &nbsp; });<br />
&nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#buttontwo&quot;).click(function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;.widearea&quot;).animate({<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marginLeft: &quot;-300px&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, 500);<br />
&nbsp; &nbsp; &nbsp; &nbsp; });<br />
&nbsp; &nbsp; &nbsp; &nbsp; $(&quot;#buttonthree&quot;).click(function() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(&quot;.widearea&quot;).animate({<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; marginLeft: &quot;-600px&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, 500);<br />
&nbsp; &nbsp; &nbsp; &nbsp; });<br />
});<br />
<span class="sc2"><span class="kw2">&lt;/script&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/body&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></div>
</div>
<p>If you want, you can copy and paste the above into an html file, stick it in a directory with version 1.2.3 of the jQuery library (the latest stable version as of this post) and run it for a quick demo. It functions the exact same as my archive navigator.</p>
<p>Now, you'll notice something new in the javascript. There's this <i>$(document).ready(function(){</i> wrapping it all and it ensures that no javascript gets run until the page is fully loaded. It prevents any javascript errors getting thrown because if you didn't have this and this javascript gets executed before the button or div involved is loaded, it wouldn't work.</p>
<h3>Customizing it for WordPress</h3>
<p>If you've ever created or modified a WordPress theme before, you might have come across the <a href="http://codex.wordpress.org/Template_Tags" title="Template Tags">template tags</a>. You can use these inside the divs of .widearea to list categories, tags, and more. Here are a few examples:</p>
<ul>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_tag_cloud" title="Tag cloud">Tag cloud</a>:
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">&lt;?php</span> wp_tag_cloud<span class="br0">&#40;</span><span class="st0">''</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
</div>
</li>
<li><a href="http://codex.wordpress.org/Template_Tags/wp_list_categories" title="Categories">Categories listing</a>:
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">&lt;?php</span> wp_list_categories<span class="br0">&#40;</span><span class="st0">'arguments'</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span></div>
</div>
</li>
<li>Last five posts:
<div class="codesnip-container" >
<div class="codesnip"><span class="kw2">&lt;?php</span> query_posts<span class="br0">&#40;</span><span class="st0">'showposts=5'</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">while</span> <span class="br0">&#40;</span>have_posts<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#41;</span> : the_post<span class="br0">&#40;</span><span class="br0">&#41;</span>; <span class="kw2">?&gt;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;li&gt;&lt;a href=<span class="st0">"&lt;?php the_permalink() ?&gt;"</span> rel=<span class="st0">"bookmark"</span>&gt;&lt;?php the_title<span class="br0">&#40;</span><span class="br0">&#41;</span>; ?&gt;&lt;/a&gt;&lt;/li&gt;<br />
<span class="kw2">&lt;?php</span> <span class="kw1">endwhile</span>; <span class="kw2">?&gt;</span></div>
</div>
</li>
</ul>
<h3>Still with me?</h3>
<p>I tried to make this mini-tutorial as newbie friendly as possible but there are some advanced topics in here that might have gone over your head. If you have any questions, feel free to ask through the comments as I'm sure I might have not explained something very well or left out something.</p>
<p>And if you're a seasoned programmer, I know some of this stuff is bad practice (I realize that the javascript is anti-<a href="http://en.wikipedia.org/wiki/Object_oriented" title="Object oriented programming wiki">OO</a>), but I tried to make it accessible as possible.</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2010/07/23/six-tips-for-optimizing-your-websiteweb-application/" title="Six Tips for Optimizing Your Website/Web Application">Six Tips for Optimizing Your Website/Web Application</a></li><li><a href="http://www.gosammy.com/2008/06/11/improving-the-archive-navigator-graceful-degradation/" title="Improving the Archive Navigator; Graceful Degradation">Improving the Archive Navigator; Graceful Degradation</a></li><li><a href="http://www.gosammy.com/2007/08/30/integrating-flickr-into-your-wordpress-theme/" title="Integrating Flickr Into Your Wordpress Theme">Integrating Flickr Into Your Wordpress Theme</a></li><li><a href="http://www.gosammy.com/2008/02/27/gosammy-30/" title="goSammy 3.0">goSammy 3.0</a></li><li><a href="http://www.gosammy.com/2007/08/02/midnight-wptheme/" title="Midnight WordPress Theme">Midnight WordPress Theme</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2008/04/08/how-to-create-your-very-own-archive-navigator/feed/</wfw:commentRss>
		<slash:comments>54</slash:comments>
		</item>
		<item>
		<title>Automating Your mySQL Database Backup On Media Temple&#8217;s Grid-Server</title>
		<link>http://www.gosammy.com/2007/12/30/automating-your-mysql-database-backup-on-media-temples-grid-server/</link>
		<comments>http://www.gosammy.com/2007/12/30/automating-your-mysql-database-backup-on-media-temples-grid-server/#comments</comments>
		<pubDate>Mon, 31 Dec 2007 00:56:56 +0000</pubDate>
		<dc:creator>Sam Lu</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[automate]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[grid-server]]></category>
		<category><![CDATA[linkedin]]></category>
		<category><![CDATA[mediatemple]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[mysqldump]]></category>

		<guid isPermaLink="false">http://www.gosammy.com/2007/12/30/automating-your-mysql-database-backup-on-media-temples-grid-server/</guid>
		<description><![CDATA[In part one of this tutorial, <a href="/2007/12/23/automating-your-server-backups-on-media-temples-grid-server/" title="Automating Your Server Backups On Media Temple's Grid-Server">Automating Your Server Backups On Media Temple's Grid-Server</a>, I explained how to automate backups of your files on your grid-server. Unfortunately, not all your data was covered in those backups because it did not include your database. Now I will describe how you can utilize cron and mysqldump to automate database backups on the grid-server side.]]></description>
			<content:encoded><![CDATA[<p>In part one of this tutorial, <a href="/2007/12/23/automating-your-server-backups-on-media-temples-grid-server/" title="Automating Your Server Backups On Media Temple's Grid-Server">Automating Your Server Backups On Media Temple's Grid-Server</a>, I explained how to automate backups of your files on your grid-server. Unfortunately, not all your data was covered in those backups because it did not include your database. Now I will describe how you can utilize cron and mysqldump to automate database backups on the grid-server side.</p>
<h3>The Process</h3>
<p>Like the last tutorial, we will go about this in a similar fashion by creating a script which we will utilize as a cron job.</p>
<ol>
<li>Open up your favorite text-editor and copy and paste the following snippet:
<div class="codesnip-container" >
<div class="codesnip"><span class="co1">#!/bin/bash</span><br />
mysqldump --add-drop-table -h internal-db.s99999.gridserver.com -udb99999 -pPASSWORD database_name &gt; database_name.sql</div>
</div>
<p>We will need to replace a few things here though:</p>
<ul>
<li>Replace all the instances of '99999' with your gridserver account number.</li>
<li>Replace 'PASSWORD' with your mySQL password</li>
<li>Replace 'database_name' with the name of the database you'd like to backup</li>
</ul>
<p>If you've ever setup WordPress or some other CMS which needs a database, you've likely come across this info before. </p>
<p>You could test if your command works by first SSHing in and then entering in the command. If an sql file is created, it worked.</p>
<p>If you have more than one database you want to backup, just create another mysqldump command.</li>
<li>Now save this file as something like 'db-backup.sh'</li>
<li>Upload 'db-backup.sh' to your /data folder<br />
<small>I chose to put the script in this folder because when it runs, the .sql files are also dumped into this folder. This folder is nice because it is only accessible by you and you wouldn't want the public to accidentally stumble upon an entire dump of your database.</small></li>
<li>Now log into your Media Temple <a href="https://ac.mediatemple.net/login.mt" title="Media Temple Account Center">Account Center</a></li>
<li>Go to the admin section of your primary domain and click the Cron Jobs link<br />
<img src='http://www.gosammy.com/wp-content/uploads/2007/12/cron_jobs.jpg' alt='Cron Jobs Link' /></li>
<li>Click on the 'Add a new cron job' button<br />
<img src='http://www.gosammy.com/wp-content/uploads/2007/12/add_new_cron_job.jpg' alt='Add new cron job' /></li>
<li>Feel free to fill in your email address in the output email field if you'd like. This will send you emails whenever the cron job runs and will let you know if it was successful or not. However, the important field we need to fill out is Command to Run. In this field, enter:
<div class="codesnip-container" >/home/99999/data/db-backup.sh</div>
<p>Again, replace the '99999' with your grid-server account number (it's actually listed below 'Command to Run')</li>
<li>In the bottom half of the page, you can specify how often you'd like your script to run. This entire section is up to you. I've set mine to run daily at 2AM when traffic on my site is slower</li>
<li>Click Save and you're all done!</li>
</ol>
<h3>Now what about saving these mysql dumps to my local disk?</h3>
<p>If you've went through part one of this tutorial and successfully set up rsync, these dumps are now part of that synchronization. <img src='http://www.gosammy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Again, if something didn't make sense or you know of some way to improve these backup processes, please feel free to leave a comment!</p>
<h3>Related Post</h3><ul class="related_post"><li><a href="http://www.gosammy.com/2007/12/23/automating-your-server-backups-on-media-temples-grid-server/" title="Automating Your Server Backups On Media Temple&#8217;s Grid-Server">Automating Your Server Backups On Media Temple&#8217;s Grid-Server</a></li><li><a href="http://www.gosammy.com/2011/07/15/a-new-portfolio/" title="A New Portfolio">A New Portfolio</a></li><li><a href="http://www.gosammy.com/2011/06/14/using-git-between-mac-and-windows/" title="Using Git Between Mac and Windows">Using Git Between Mac and Windows</a></li><li><a href="http://www.gosammy.com/2011/04/11/bbm-probably-wont-be-available-to-iphoneandroid/" title="BBM Probably Won&#8217;t Be Available to iPhone/Android">BBM Probably Won&#8217;t Be Available to iPhone/Android</a></li><li><a href="http://www.gosammy.com/2010/11/18/next-stop-an-iphone-app-for-calgary-transit/" title="Next Stop: An iPhone App for Calgary Transit">Next Stop: An iPhone App for Calgary Transit</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://www.gosammy.com/2007/12/30/automating-your-mysql-database-backup-on-media-temples-grid-server/feed/</wfw:commentRss>
		<slash:comments>45</slash:comments>
		</item>
	</channel>
</rss>

