<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Wes Bos</title>
	
	<link>http://wesbos.com</link>
	<description>Designer, Developer &amp; Entrepreneur making the web an awesome place.</description>
	<lastBuildDate>Fri, 22 Mar 2013 18:13:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/wesbos/ZXAx" /><feedburner:info uri="wesbos/zxax" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Learn Sublime Text line bubbling in 2 minutes ☰</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/uX85ELmsBFE/</link>
		<comments>http://wesbos.com/learn-sublime-text-line-bubbling-in-2-minutes/#comments</comments>
		<pubDate>Tue, 12 Mar 2013 03:13:47 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Sublime Text]]></category>
		<category><![CDATA[Text Editors]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=777</guid>
		<description><![CDATA[As I’ve been writing the Sublime Text Power User book over the last few months, I’ve had some interesting conversations around favourite features of ST. The one feature that I constantly surprise people with is called line bubbling &#8211; moving &#8230; <a href="http://wesbos.com/learn-sublime-text-line-bubbling-in-2-minutes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>As I’ve been writing the Sublime Text Power User book over the last few months, I’ve had some interesting conversations around favourite features of ST. The one feature that I constantly surprise people with is called line bubbling &#8211; moving lines of code up and down a document without cutting and pasting them.</p>
<p><img class="size-full wp-image-778" alt="linebubble.mov" src="http://wesbos.com/wp-content/uploads/2013/03/linebubble.mov.gif" /></p>
<p>It’s an extremely simple feature but will save you lots of time and potentially lost code.</p>
<p>Let’s take this list as a very basic example. This list could be any block of code that you want to move up or down &#8211; they are only numbered as a visual.<br />
<img class="aligncenter size-medium wp-image-783" alt="ss 2013-03-11 at 11.14.30 PM" src="http://wesbos.com/wp-content/uploads/2013/03/ss-2013-03-11-at-11.14.30-PM-300x189.png" width="300" height="189" /><br />
How do we move them up and down to end up in the correct order? We could cut and paste, but line bubbling is much faster.</p>
<p>In Sublime Text, hold down <code>⌘</code> + <code>control</code> (<code>CTRL</code> + <code>SHIFT</code> on Windows) and use your <strong>↑ up</strong>* and <strong>↓ down</strong> arrow keys to move the lines around. This works for single and multiple lines.</p>
<p>Check out the video for a visual:</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/AXbCm3ymDzM?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<p>Easy! Want to learn more, sign up below and I&#8217;ll let you know when my book comes out.</p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/uX85ELmsBFE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/learn-sublime-text-line-bubbling-in-2-minutes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://wesbos.com/learn-sublime-text-line-bubbling-in-2-minutes/</feedburner:origLink></item>
		<item>
		<title>Sublime Text 3: First Look</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/39TeWq3-x-M/</link>
		<comments>http://wesbos.com/sublime-text-3-first-look/#comments</comments>
		<pubDate>Tue, 29 Jan 2013 18:51:41 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Sublime Text]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=748</guid>
		<description><![CDATA[I woke up to a real treat this morning: Sublime Text 3! Sublime Text development has always moved at an incredible pace and now just a few months after 2.0 was released, 3.0 peaks around the corner. ST3 isn&#8217;t at &#8230; <a href="http://wesbos.com/sublime-text-3-first-look/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I woke up to a real treat this morning: Sublime Text 3! Sublime Text development has always moved at an incredible pace and now just a few months after 2.0 was released, 3.0 peaks around the corner. ST3 isn&#8217;t at the point where it can be your daily editor &#8211; you will still be using ST2 for some time &#8211; but its exciting to take a look at what ST3 has in store for us!</p>
<p>ST3 is only available to registered ST2 owners, you will be reqired to input your license key upon launch. If you forget where you put your license key, go to <code>Preferences → Browse Packages</code> and then open the <code>settings</code> folder and look for <code>License.sublime_license</code></p>
<p><img alt="" src="http://wes.io/MWo1/content" /></p>
<h3>What&#8217;s new</h3>
<p>You can read all the new features over at the <a href="http://www.sublimetext.com/blog/articles/sublime-text-3-beta" target="_blank">Sublime Blog</a>, here are the main features along with some explanation and commentary.</p>
<h4>It&#8217;s even faster!</h4>
<p>Sublime has always been a blazing fast editor and Jon Skinner has outdone himself with this. The editor starts and opens up my last project in less than a second. On OSX the icon doesn&#8217;t even reach the top of the bounce before it has loaded.</p>
<h4>Python 3.3 &amp; Packages API</h4>
<p>Sublime has now switched to Python 3.3. If you aren&#8217;t familar, Python is the programming language that Sublime Text uses to expose it&#8217;s API. It is how we get all those great packages. Python 3.3 has been out for a while, but many developers have been dragging their heels in upgrading as many of the packages haven&#8217;t been ported over. I&#8217;m not a Python developer, but according to the <a href="https://python3wos.appspot.com/" target="_blank">Python Wall of Superpowers</a> things are looking better lately.</p>
<p>The downside to this is that most Sublime Text packages will need to be ported to ST2/Python 3.3. The author of Sublime Text says porting to the new API involve minimal work.</p>
<p>Sublime Text package manager doesn&#8217;t work yet, but the author <a href="https://twitter.com/wbond" target="_blank">Will Bond</a> says work is already underway. Will also has a number of popular packages so I would watch his <a href="https://github.com/wbond/" target="_blank">github</a>, <a href="https://twitter.com/wbond" target="_blank">twitter</a> and <a href="http://wbond.net/sublime_packages" target="_blank">site</a> for his experiences with porting everything over.</p>
<p><strong>UPDATE: </strong>Will Bond has updated package manage to work with Sublime Text 3. See his <a href="http://wesbos.com/sublime-text-3-first-look/#comment-1511">commend below</a>.</p>
<h4>Pane Management</h4>
<p>Previously sublime text only allowed you to split your editor into 1-3 columns, 1-3 rows or a grid of 4. This has changed in Sublime Text 3 which exposes controls for splitting panes indefinitely.</p>
<p>I played around with the commands and keyboard shortcuts for a bit but I will be sticking with <a href="https://github.com/SublimeText/Origami" target="_blank">Origami</a> to manage my panes as I find the commands for moving files splitting panes to be more natural.</p>
<h4>Symbol Indexing</h4>
<p><img alt="" src="http://wes.io/MWQc/content" /><br />
ST3 introduces project wide Goto Symbol and Goto Definition. Previously Goto symbol fuzzy search only worked when you specifically noted which file you wanted to look in. In the example above I&#8217;m able to see everywhere the post_render function is called in Octopress. This is a really big step up for Sublime that may have a few IDE-lovers jumping ship.</p>
<h3>Themes and colour schemes</h3>
<p>The UI of Sublime hasn&#8217;t changed at all other than a few animations when hiding/showing the sidebar. I&#8217;ve tested ST3 with my <a href="https://github.com/wesbos/cobalt2/" target="_blank">Cobalt2 theme and color scheme</a> and I&#8217;m happy to report that everything worked flawlessly.</p>
<h3>Prices</h3>
<p>Sublime text 3 will go for $70 or a $30 upgrade from ST2 ($15 if you purchased it recently, so don&#8217;t hold off buying ST2).  Money extremely well spent.</p>
<h3>Wishlist</h3>
<p>This is just the beginning of ST3 and I&#8217;m excited to see what it has in store for the future. A few things that are on my wishlist:</p>
<ul>
<li><span style="line-height: 13px;">Full blown terminal integration</span></li>
<li>Binary file display  - One thing Coda does really well. If I click an image, I&#8217;m able to preview it and get its dimensions.</li>
<li>Find/Replace Macros &#8211; being able to record a find/replace and play it back or run with arguments would be very handy.</li>
<li>Sidebar icons &#8211; Sublime excells in its simple interface but having icons for folders/filetypes is something that has always been on my list</li>
<li><strong>What is yours? </strong>- Post in the comments what you hope Sublime Text 3 will bring</li>
</ul>
<h3>The Book</h3>
<p>Of course all of this information will be in my upcoming book on Sublime Text. I&#8217;m making excellent progress and will have a release date for you all soon. Drop your email below and I&#8217;ll give you a hoot when it&#8217;s launched.</p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/39TeWq3-x-M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/sublime-text-3-first-look/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://wesbos.com/sublime-text-3-first-look/</feedburner:origLink></item>
		<item>
		<title>How to test localhost from any device on your network</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/RK4Vx_z-_-s/</link>
		<comments>http://wesbos.com/localhost-mobile-device-testing/#comments</comments>
		<pubDate>Fri, 25 Jan 2013 17:55:48 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[Mobile]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=718</guid>
		<description><![CDATA[If you do any sort of web development locally you have probably run into at least one of the following problems: I can&#8217;t access my local sites/apps on my mobile devices I can&#8217;t access localhost inside of my virtual machines &#8230; <a href="http://wesbos.com/localhost-mobile-device-testing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you do any sort of web development locally you have probably run into at least one of the following problems:</p>
<ol>
<li>I can&#8217;t access my local sites/apps on my mobile devices</li>
<li>I can&#8217;t access localhost inside of my virtual machines</li>
<li>My teammates can&#8217;t access my local site to view it</li>
<li>I need to test IE6 on my Toshiba crapbook</li>
</ol>
<p>Pushing your site to a server isn&#8217;t ideal, especially when you are debugging a problem and have a longer deploy process.</p>
<p>I develop everything locally and have to test my sites/apps on a variety of mobile devices as well as a few different installs of windows which I run on Virtual Box. This is how I run a single development domain that is available to every device on my wireless network as well as on my laptop, regardless of the wifi network I&#8217;m on.</p>
<p><span id="more-718"></span></p>
<h3>My Setup</h3>
<p><img class="size-large wp-image-743 alignleft" alt="photo (2)" src="http://wesbos.com/wp-content/uploads/2013/01/photo-2-650x487.jpg" width="640" height="479" /></p>
<p>Before we get started, I should say that is works for any programming language that runs a local server. My setup looks something like this:</p>
<p>http://test.com is my domain that I map everything to. I can access test.com on any device on my network. It obviously not the real test.com, but as you will see it resolves to <strong>localhost. </strong>This domain could be anything &#8211; some devs like to run something like http://wes.dev/ but I find using a .com works better as sometimes browsers think I&#8217;m searching for wes.dev instead of going to wes.dev.</p>
<p>I run MAMP to serve up both my static files and my static files. I usually have mamp serving up my entire web devleopment folder so I can easily just surf to something like http://test.com/demos/webrtc-demo/ on any device. This is most common for me, so I run this on the default web traffic port 80. If you don&#8217;t do PHP development, I reccomend using pythons simplehttpserver as MAMP or WAMP are a pain to get up and running properly.</p>
<p>I run node.js apps on various ports. Express apps run on port 3000 by default so I just need to surf to http://test.com:3000 on any device.</p>
<p>I also have clients who have ruby and python/app engine backends. I usually run these on ports that are easy to remember like 8888. I keep these ports unique for each app so my browser history know the difference between http://test.com:8888 and http://test.com:9000</p>
<p><strong>Just use an IP! What about  localtunnel?! </strong></p>
<p>I posted on twitter that I was writing this article and I got quite a few people asking why I didn&#8217;t just use an IP address or localtunnel. Using an IP isn&#8217;t ideal because many times applications I run depend on having a consistent domain name. With many CMS systems such as WordPress, I can&#8217;t really develop on localhost  and then view the site on 192.168.1.32. I use a few browser plugins that send my current site to my devie and having the exact same domain name is key here.</p>
<p>Services like <a href="http://progrium.com/localtunnel/">localtunnel</a> and <a href="http://pagekite.net/">PageKit</a> are fantastic for quickly exposing your localhost and are invaluable when working on a remote team. However, we still run into the problem of  having different domains for your machine vs the device. So, you may still require these services and thats great, it just doesn&#8217;t replace what we are trying to do here.</p>
<h3>Local Setup &#8211; edit your hosts file</h3>
<p>This is the easy part. We want to edit a file on our computer called the <strong>hosts file.  </strong>This file tells your computer to resolve <strong>names </strong>to <strong>IP Addresses. </strong>So, anytime your computer requests a name &#8211; say test.com &#8211; it will check the <strong>hosts file</strong> to see if there is an IP it should resolve to.  Otherwise it carries on with its business and tries to load the web page.</p>
<p>Your hosts file is just a text file so you don&#8217;t need any special program.  Just open up the following file:</p>
<p><strong>OSX: </strong>open terminal (applications → utilities → terminal) and type <code>sudo open /etc/hosts</code>. You will be asked to enter your password and then the file will open up in your text editor of choice.<br />
<strong>Windows:</strong> Start → Run → paste <code>notepad c:\windows\system32\drivers\etc\hosts</code> into the box.</p>
<p>Now we just need to map a domain to localhost. We use the IP address <strong>127.0.0.1</strong> because that is the IP for your computer&#8217;s localhost.</p>
<p>Go ahead and pop the following line anywhere in your hosts file:</p>
<p><strong>127.0.0.1 test.com</strong></p>
<p>Give it a save (you may be asked to enter your password)</p>
<p><img class="aligncenter size-large wp-image-741" alt="ss 2013-01-25 at 12.45.17 PM" src="http://wesbos.com/wp-content/uploads/2013/01/ss-2013-01-25-at-12.45.17-PM-650x114.png" width="640" height="112" /></p>
<p>You can map <strong>any domain name </strong>to an alternate IP address. So, if you wanted to play a prank on a co-worker or block your wife from pinterest, you could easily tell it to resolve to any other IP. This is how those &#8216;self control&#8217; apps work as well.</p>
<p># Map Pinterest to google.com<br />
74.125.224.72 pinterest.com</p>
<p># Disable facebook.com<br />
0.0.0.0 facebook.com</p>
<p>Now when you visit http://test.com you should see your localhost instead on whatever used to be on test.com. If you don&#8217;t see it, you can flush your DNS cache:</p>
<p>OSX Paste the following into terminal <code>sudo killall -HUP mDNSResponder</code><br />
Windows: Start → run → cmd (right click, run as admin): <code>ipconfig /flushdns</code></p>
<h3>Router Level Setup</h3>
<p>The above has set you up for a local domain resolution of test.com &#8211; but what about when you want to visit test.com on another device? I have at least 20 different devices/vms to test and some of them, like the iPhone, don&#8217;t even allow you to edit the hosts file!</p>
<p>The answer is setting up a similar resolution, but at the router level. We will tell the router to resolve all requests for test.com to the IP address of your computer. When I first set out to do this, I thought I had to do some serious hacking &#8211; I was telneting into my router and trying to edit my hosts file. Turns out, it is a lot easier than I thought. This part could vary depending on your router &#8211; I run a custom firmware on my router called <a href="http://www.dd-wrt.ca/site/index">dd-wrt</a>  and there are a few others available like <a href="http://www.polarcloud.com/tomato">Tomato</a> and <a href="https://freewrt.org/">FreeWRT</a>. If you have any sort of dlink or linksys router, you are probably able to run a custom firmware &#8211; check into it.</p>
<p>The peice of the puzzle that we need on your router is called <strong>DNSmasq.</strong> If you are running a router with vanilla firmware, you will have to take a look and see if if it supports DNSmasq or some other version DNS masking. Please share in the comments if you know of a way for a specific router.</p>
<p>First thing we need to do is grab our computers <strong>local </strong>IP address. You can get this by going back into terminal/cmdline and typing <code>ipconfig</code> (<code>ifconfig</code> on mac). and looking for something that looks like 192.168.x.x. If your computer changes IP addresses frequently you may need to set a static IP for your home network, I&#8217;ve run this setup for over a year, event reformatting my mbp once and I&#8217;ve never had to set a static IP. <a href="http://www.howtogeek.com/howto/22161/how-to-set-up-a-static-ip-in-mac-os-x/" target="_blank">[osx guide]</a> <a href="http://blog.mclaughlinsoftware.com/2009/11/26/windows-7-static-ip/" target="_blank">[windows guide]</a></p>
<p>With your computer&#8217;s IP handy, Go ahead and log into your router (usually 192.168.1.1 unless you have changed it) and look around for <strong>DNSmasq.</strong> in DD-WRT its located under <strong>services.</strong> Then you simply need to type the following into the box and make sure your settings line up with mine:</p>
<p><code>address=/test.com/192.168.124.110</code></p>
<p><img class="aligncenter size-full wp-image-737" alt="ss 2013-01-25 at 12.14.45 PM" src="http://wesbos.com/wp-content/uploads/2013/01/ss-2013-01-25-at-12.14.45-PM.png" width="626" height="202" /></p>
<p>Save your settings and you are ready to start testing your devices on your local network! I&#8217;ve been running this setup for about a year now and I&#8217;m really happy with it &#8211; would love to hear any other tips/tools you use that might make this easier to the average Joe. Good luck!</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/RK4Vx_z-_-s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/localhost-mobile-device-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://wesbos.com/localhost-mobile-device-testing/</feedburner:origLink></item>
		<item>
		<title>Korean 27″ Apple IPS Displays and a Macbook Pro: Everything you need to know</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/2-sT1ZLRm_I/</link>
		<comments>http://wesbos.com/korean-27-monitor-macbook-pro/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 19:00:37 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[developer]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=689</guid>
		<description><![CDATA[If you haven&#8217;t heard, there are beautiful 27&#8243; IPS monitors coming out of Korea that use the same panels as the Apple Thunderbolt display. Turns out that Apple buys its panels from LG and any panels that aren&#8217;t absolutely perfect &#8230; <a href="http://wesbos.com/korean-27-monitor-macbook-pro/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img class="aligncenter size-large wp-image-699" alt="photo" src="http://wesbos.com/wp-content/uploads/2013/01/photo-650x487.jpg"   />If you haven&#8217;t heard, there are beautiful 27&#8243; IPS monitors coming out of Korea that use the same panels as the Apple Thunderbolt display. Turns out that Apple buys its panels from LG and any panels that aren&#8217;t absolutely perfect get rejected. Enterprising companies in Korea are then buying these panels and putting them into their own monitor housing. You don&#8217;t get the apple looks, nor the docking ports at the back, but at $300-400, these monitors are attractive to many who just want a high quality panel without the $1000+tax price tag an Apple display. This isn&#8217;t a $300 best buy special with a 1080 resolution, its a serious monitor pushing out 2560&#215;1440.</p>
<p>Before we go any further, if you are on team $1000 apple thunderbolt display. We get it, apple displays are perfect &nbsp;and worth every penny to you. Pretty much everyone would kill for a thunderbolt display. This is my story how I got the exact same quality display for half the price.</p>
<p>There are <a href="http://techreport.com/review/23291/those-27-inch-ips-displays-from-korea-are-for-real" target="_blank">tons</a> and <a href="http://www.codinghorror.com/blog/2012/07/the-ips-lcd-revolution.html" target="_blank">tons</a>&nbsp;of articles that will catch you up to speed on these monitors, I suggest you read them if you want to know more. Here is the short and skinny:</p>
<ol>
<li>There are many different brands that package the same panel and the prices vary. Some have poor build quality (including the circuitry) and other have really nice stands. The three big names are Yamakasi Catleap, Achieva Shimian and&nbsp;&nbsp;Crossover. Do your research by reading the forums &#8211; there are literally thousands of pages of &nbsp;information on this.</li>
<li>Most of these monitors are sold on ebay. Monoprice recenrly started to sell their own brand. I bought mine off a seller called &#8216;Dream Seller&#8217; who shipped it free from Korea in a shocking 3 days.</li>
<li>You run the risk of getting a few dead pixels or back light bleeding. I paid an extra ~$25 for a pixel perfect version and I have zero dead pixels and no backlight bleed. Many buyers risk the dead pixels and end up with perfect displays, others have a few dead pixels.</li>
<li>These are barebones as it gets, DVI only and no on screen display.</li>
</ol>
<p>I bought a Crossover Q27 LED because it has the best build quality with a metal bezel and stand. I replaced the stand with a monoprice arm because I found it less bulky. If you are considering the&nbsp;Crossover Q27 LED and have neck problems, go for the&nbsp;Crossover Q27 LED<strong>-P&nbsp;</strong>which has a stand that allows for pivoting and moving up/down.</p>
<p><img class="aligncenter size-large wp-image-698" alt="photo_3" src="http://wesbos.com/wp-content/uploads/2013/01/photo_3-650x487.jpg"   /></p>
<h3>Running it on a Macbook Pro</h3>
<p>Most of the forum posters are serious gamers so I found I had to do quite a bit of research about running it on my Macbook Pro. The biggest takeaway is that these monitors require a&nbsp;<strong>dual link dvi</strong> cable to hook it up. Those $10 mini display port / thunderbolt&nbsp;→ DVI connectors won&#8217;t work here. Because the resolution is so high, we can&#8217;t simply just convert the signal from our macbook to DVI like we do with other monitors &#8211; this is what we call <strong>passive conversion.&nbsp;</strong>As I understand it, we need an <strong>Active converter&nbsp;</strong>that will take the output from the macbook pro and kick it up to&nbsp;&nbsp;2560&#215;1440.</p>
<p><img class="aligncenter size-full wp-image-692" alt="DV019_Jpg_Regular_501043" src="http://wesbos.com/wp-content/uploads/2013/01/DV019_Jpg_Regular_501043.jpg"   /></p>
<p>The above is Apple&#8217;s version, and it doesn&#8217;t come cheap at around $150. There are other companies including StarTech and Monoprice that put out cheaper, and&nbsp;supposedly&nbsp;better, adaptors for around $100-120. No cheap, so keep this in mind when factoring in the price of the monitor. These adaptors require a USB port, which is purely for power. The apple one gives you a passthrough so you don&#8217;t lose a precious port. I plugged mine into a powered hub and it works fine.</p>
<p>I&#8217;m running this on a mid 2010 macbook pro. It&#8217;s important to note here that even if you have a newer model with thunderbolt, you still need to buy this adaptor. I found a cheap one on Craigslist.</p>
<h3>Power</h3>
<p>This is another thing to pay serious attention to. Most of the monitors come with Korean power bricks which operate at 110-240V. North America runs on 120v, so I was safely inside that voltage. The only thing I needed to do was swap the korean plug for a north american on. Its the same plug as printers/scanners/monitors use, so I could just unplug the korean wall plug version and swap it out with mine.</p>
<p>If you live in a european country that runs on 250V &#8211; you need to make sure you buy a proper power pick. Do not fry your monitor!</p>
<h3>Calibration</h3>
<p>Out of the box, the colour was almost bang on and I only had to do a little bit of calibration. These&nbsp;monitors&nbsp;only come with two buttons: brightness UP and brightness DOWN. No problem here though, OSX comes with a very nice colour calibration wizzard which allowed me to make everything look 1:1 to my macbook pro.</p>
<p><strong>Warranty</strong></p>
<p>There isn&#8217;t much of a warranty with these things past the&nbsp;initial&nbsp;delivery, this is one of the major downsides. There is no Apple store appointments for these monitors. Luckily, I was able to pop my ebay listing # into <a href="http://www.squaretrade.com/">SquareTrade</a>&nbsp;and they sold me a 3 year warranty for $50. Totally worth the peace of mind.</p>
<p>Overall Prices</p>
<p>Monitor $380</p>
<p>Display port to Dual link DVI Converter&nbsp;$60 (craigslist)</p>
<p>Monoprice Monitor Arm &#8211; $20 off craigslist</p>
<p>Duty &#8211; $60 (I was one of the only instances I could find online where poeple got nailed by customs. Oh well, oh Canada).</p>
<p><strong>Total: $520 taxes in</strong></p>
<p>Hope this was helpful and saves you hours of searching. In the picture above, I&#8217;m also using a USB to DVI converter from displaylink to run the third display.</p>
<p>&nbsp;</p>
<p><a href="http://wesbos.com/wp-content/uploads/2013/01/photo_2-e1358189928992.jpg"><img class=" wp-image-697 alignleft" alt="photo_2" src="http://wesbos.com/wp-content/uploads/2013/01/photo_2-e1358189928992-650x866.jpg"   /></a><a href="http://wesbos.com/wp-content/uploads/2013/01/photo_1.jpg"><img class="size-medium wp-image-696" alt="photo_1" src="http://wesbos.com/wp-content/uploads/2013/01/photo_1-300x225.jpg"   /></a></p>
<p>Please leave any tips or questions in the commends below.</p>
<style>.entry-utility {clear:both;}</style>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/2-sT1ZLRm_I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/korean-27-monitor-macbook-pro/feed/</wfw:commentRss>
		<slash:comments>40</slash:comments>
		<feedburner:origLink>http://wesbos.com/korean-27-monitor-macbook-pro/</feedburner:origLink></item>
		<item>
		<title>5 more Sublime Text tweaks &amp; tips</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/cL0purwNONo/</link>
		<comments>http://wesbos.com/5-sublime-text-tweaks-tips/#comments</comments>
		<pubDate>Mon, 14 Jan 2013 04:09:51 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Sublime Text]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=678</guid>
		<description><![CDATA[I&#8217;m working hard on my Sublime Text Book and have received fantastic response for everything so far &#8211; very motivating. The last post was so well received that I&#8217;ve decided to post a few more of my favourite tips. 1. &#8230; <a href="http://wesbos.com/5-sublime-text-tweaks-tips/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m working hard on my Sublime Text Book and have received fantastic response for everything so far &#8211; very motivating. The <a href="http://wesbos.com/sublime-text-5-visual-tweaks/" target="_blank">last post</a> was so well received that I&#8217;ve decided to post a few more of my favourite tips.</p>
<h3>1. Save on focus lost</h3>
<p>Chronic ⌘+S’er? This tip is particularly helpful when working with CSS/LESS/SASS and switching between your editor and browser. Instead of saving on every tiny little change, tell Sublime to automatically save your files when you tab away from the editor.</p>
<p>I find this is super handy when working with extensions like Live Reload or compiled languages like coffeescript that watch for file saves. Put this in your settings file at <code>Preferences</code> → <code>Settings - User</code></p>
<pre class="brush:js">"save_on_focus_lost": true</pre>
<p>If you work with other watch scripts that break and restart a process upon save (like supervisor or forever), this might not be ideal for you. No problem, only enable it for the languages you want &#8211; simply place the above setting in /Packages/User/[syntax].sublime-settings. For example, I put the above in <code>CSS.sublime-settings</code> and <code>LESS.sublime-settings</code></p>
<h3>2. Paste and Indent</h3>
<p>One of the best tricks I’ve ever learned in Sublime Text is <strong>paste and indent</strong>. If you have ever pulled a piece of code off the Internet and pasted it into your application, you’ll no doubt feel the pain of having it paste in all weird and have to go in and fix it.</p>
<p>Easy fix to this, instead of pressing the normal <code>cmd</code> + <code>v</code> to paste, simply switch to using <code>cmd</code> + <code>shift</code> + <code>v</code> to paste. This will automatically indent your code block.</p>
<p>Like that one? I loved it so I remapped my key combos to paste and indent by default on <code>cmd</code> + <code>v</code></p>
<p>Paste this little snippet into your key bindings file located at <code>Preferences</code> → <code>Key Bindings - User</code></p>
<pre class="brush:js">{ "keys": ["super+v"], "command": "paste_and_indent" },
{ "keys": ["super+shift+v"], "command": "paste" }</pre>
<h3>3. Reindent Keyboard shortcut</h3>
<p>Now, if for some reason you end up with either a block of code or an entire file filled with hard to ready, messy, poorly indented code, reindent is your best friend.</p>
<p>To automatically re-indent your code, simply select the code you want to indent and then from the menu <code>Edit</code> → <code>Line</code> → <code>Reindent</code></p>
<p>Sublime doesn’t ship a keyboard shortcut for this. No problem, let’s make our own. Pop this little snippet into the <code>Preferences</code> → <code>Key Bindings - User</code> file.</p>
<pre class="brush:js">{ "keys": ["super+shift+r"],  "command": "reindent" }</pre>
<h3>4. Highlight Modified Tab</h3>
<p>When making a change in sublime text, by default it changes the <strong>×</strong> to a circle of the same colour.</p>
<figure><img alt="" src="http://wes.io/M9aj/content" /></figure>
<p>Make it a little more obvious when you haven’t saved changes to a document by turning on the following:</p>
<pre class="brush:js">"highlight_modified_tabs": true</pre>
<figure><img alt="" src="http://wes.io/M9p8/contet" /></figure>
<p>The exact styling of your modified tabs will vary depending on your theme. It looks fantastic with my <a href="wesbos.com/cobalt2-theme-sublime-text-2/">cobalt2 theme for Sublime Text</a></p>
<p>I’m an instructor at <a href="http://hackeryou.com/courses/#intro-to-web-development">HackerYou</a> where we use Sublime Text extensively. This is a small, yet common, problem that we run into. Making it visually obvious cuts down on mistakes like this.</p>
<h3>5. Proper Fullscreen for Mac Users</h3>
<p>This one is only for those running Sublime Text on Mac OSX 10.7 or 10.8 with multiple monitors. You have probably realized that apple has really dropped the ball when using fullscreen, rendering the rest of multiple monitors into nothing but a linen backdrop.</p>
<p>If you like to code fullscreen yet still use your other monitors, go ahead and add the following to your preferences file:</p>
<pre class="brush:js">"use_simple_full_screen": true</pre>
<p>You’ll have to restart Sublime Text for this one.</p>
<h3>More?</h3>
<p>I’ve got plenty more tips as well as in-depth guides on the rest of Sublime Text coming up in my book. If you have a must-use tip or commends on any of the above, please feel free to leave a comment!</p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/cL0purwNONo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/5-sublime-text-tweaks-tips/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		<feedburner:origLink>http://wesbos.com/5-sublime-text-tweaks-tips/</feedburner:origLink></item>
		<item>
		<title>5 great visual tweaks for Sublime Text</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/yzd_DiUxB08/</link>
		<comments>http://wesbos.com/sublime-text-5-visual-tweaks/#comments</comments>
		<pubDate>Tue, 08 Jan 2013 16:38:46 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Sublime Text]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=637</guid>
		<description><![CDATA[I love tweaking Sublime Text. There are hundreds of settings you can change and I&#8217;ve blogged about a few of them before. Here are five visual changes you can use to make your text editor just right. You should place &#8230; <a href="http://wesbos.com/sublime-text-5-visual-tweaks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I love tweaking Sublime Text. There are hundreds of settings you can change and I&#8217;ve blogged about a few of them before.</p>
<p>Here are five visual changes you can use to make your text editor <em>just right</em>. You should place these items inside your User settings file which can be located at <code>preferences</code> → <code>Settings - User</code></p>
<h3>1. Change the caret style</h3>
<p>Who thought a caret could be sexy? Change your caret style to phase and it will fade in and out rather than blink.</p>
<pre class="brush:js">"caret_style": "phase"</pre>
<p>Other available options include &#8220;smooth&#8221;, &#8220;phase&#8221;, &#8220;blink&#8221;, &#8220;wide&#8221; and &#8220;solid&#8221;. I&#8217;ve been fond of &#8220;wide&#8221; which doesn&#8217;t blink and is clearly visible for screenshots in my new book.</p>
<h3>2. Highlight current Line</h3>
<p>This is one thing I wish Sublime Text enabled by default. Highlighting the current line is a subtle visual cue when jumping back and forth between a browser and code.</p>
<p>This is also super handy when you are dealing with long lines of code/text and you want to quickly know if the current line is wrapped or not.</p>
<pre class="brush:js">"highlight_line": true</pre>
<p><img class="aligncenter size-medium wp-image-641" alt="ss 2013-01-08 at 11.21.30 AM" src="http://wesbos.com/wp-content/uploads/2013/01/ss-2013-01-08-at-11.21.30-AM.png" /></p>
<h3>3. Increase the line height</h3>
<p>This trick adds just two pixels to each line, but increases the readability of code so much better. Might not be for everyone but I really enjoy this one.</p>
<pre class="brush:js"> "line_padding_bottom": 1,
  "line_padding_top": 1</pre>
<h3>4. Show Code folding arrows</h3>
<p><a href="http://wesbos.com/sublime-text-code-folding/">Code Folding in Sublime Text</a> is really great but I&#8217;ve noticed most people don&#8217;t use it as much as they do in editors because the arrows aren&#8217;t visible until you hover over the gutter.</p>
<p>Make them always visible and get folding!</p>
<pre class="brush:js">"fade_fold_buttons": false</pre>
<p><img class="aligncenter size-full wp-image-642" alt="ss 2013-01-08 at 11.27.27 AM" src="http://wesbos.com/wp-content/uploads/2013/01/ss-2013-01-08-at-11.27.27-AM.png" width="239" height="114" /></p>
<h3>5. Bold Folder Labels</h3>
<p>One of the downsides to Sublime Text is that the sidebar isn&#8217;t as strong as other editors. One visual cue that helps me out is bolding folders. This helps me quickly identify what is a folder and what is a file.</p>
<pre class="brush:js">"bold_folder_labels": true</pre>
<p><img class="aligncenter size-full wp-image-643" alt="ss 2013-01-08 at 11.28.45 AM" src="http://wesbos.com/wp-content/uploads/2013/01/ss-2013-01-08-at-11.28.45-AM.png" width="215" height="284" /></p>
<h3>More&#8230;</h3>
<p>I&#8217;ve got plenty more in a<strong> book I&#8217;m writing about Sublime Text.</strong> If you are interested in improving your text editor productivity, please sign up below and I&#8217;ll give you a hoot when it goes live!</p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/yzd_DiUxB08" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/sublime-text-5-visual-tweaks/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		<feedburner:origLink>http://wesbos.com/sublime-text-5-visual-tweaks/</feedburner:origLink></item>
		<item>
		<title>cobalt2: a theme for Sublime Text 2</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/TlQ9cy8XXNg/</link>
		<comments>http://wesbos.com/cobalt2-theme-sublime-text-2/#comments</comments>
		<pubDate>Fri, 04 Jan 2013 17:53:05 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Sublime Text]]></category>
		<category><![CDATA[Text Editors]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=620</guid>
		<description><![CDATA[I love huge text editor colour schemes. I&#8217;ve tried dozens of them over the years but always found myself coming back to trusty old cobalt. I liked this theme quite a but but I didn&#8217;t love it. So, over the &#8230; <a href="http://wesbos.com/cobalt2-theme-sublime-text-2/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I love huge text editor colour schemes. I&#8217;ve tried dozens of them over the years but always found myself coming back to trusty old cobalt. I liked this theme quite a but but I didn&#8217;t <em>love</em> it. So, over the years I&#8217;ve tweaked and tuned cobalt into a theme that I am very happy with. Its easy on the eyes, works well across many langages and takes note of those little UI elements like the caret, searches and bracket matching.</p>
<p>I have had quite a few friends use my theme and they seem to be sticking with it. So, I&#8217;ve decided to release it to the masses. To download it, head on over to the <a href="https://github.com/wesbos/cobalt2" target="_blank">github repo.</a> As always, would love to hear any feedback you may have <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Quick aside: I&#8217;m in the process of <strong>writing a book about Sublime Text.</strong> If you are interested in improving your text editor productivity, please sign up below and I&#8217;ll give you a hoot when it goes live.</p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<h1><a class="anchor" href="#cobalt2" name="cobalt2"></a>cobalt2</h1>
<p>A Sublime Text theme based on our old blue friend cobalt.</p>
<p>A refined colour scheme that is easy on the eyes and takes small UI elements into account. Includes full sublime theme (sidebar, search, tabs, etc&#8230;).</p>
<p>See below for examples.</p>
<h2><a class="anchor" href="#installation" name="installation"></a>Installation</h2>
<p>Installation is easy, just follow these steps:</p>
<p>1. Open your Sublime Text packages directory <code>Preferences</code> → <code>Browse Packages</code></p>
<p>1. Drop in the <code>Theme - Cobalt2</code> directory here (Right into /Preferences/)<br />
1. Lastly, open <code>Preferences</code> → <code>Settings - User</code>. Add the following two lines:</p>
<pre><code>"color_scheme": "Packages/Theme - Cobalt2/cobalt2.tmTheme",
"theme": "Cobalt2.sublime-theme",
</code></pre>
<p>If these are the last two lines of your settings file, make sure to omit the trailing <code>,</code></p>
<h2><a class="anchor" href="#screenshots" name="screenshots"></a>Screenshots</h2>
<p><a href="https://a248.e.akamai.net/camo.github.com/018c56c1b2a6b252125ac3e63bc635592a6bc1e1/687474703a2f2f7765732e696f2f4d3438472f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/018c56c1b2a6b252125ac3e63bc635592a6bc1e1/687474703a2f2f7765732e696f2f4d3438472f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#indents-searches-current-line-and-folding" name="indents-searches-current-line-and-folding"></a>Indents, searches, current line and folding</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/62d3dbeb06ef13dcdf5ee75231320e003dd9f759/687474703a2f2f7765732e696f2f4c7758752f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/62d3dbeb06ef13dcdf5ee75231320e003dd9f759/687474703a2f2f7765732e696f2f4c7758752f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#tabs-spaces-and-comments" name="tabs-spaces-and-comments"></a>Tabs, spaces and comments</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/e0ad82bdf24bbe5f2248a5049e71214271c32587/687474703a2f2f7765732e696f2f4c7776452f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/e0ad82bdf24bbe5f2248a5049e71214271c32587/687474703a2f2f7765732e696f2f4c7776452f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#javascript" name="javascript"></a>JavaScript</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/7e0cde03deaa0e2bf027a88834e99cfcaaf47d93/687474703a2f2f7765732e696f2f4c7763362f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/7e0cde03deaa0e2bf027a88834e99cfcaaf47d93/687474703a2f2f7765732e696f2f4c7763362f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#css" name="css"></a>CSS</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/bd3005ca47bf9fb085a4ef3d6882666f4da4d86e/687474703a2f2f7765732e696f2f4c776b582f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/bd3005ca47bf9fb085a4ef3d6882666f4da4d86e/687474703a2f2f7765732e696f2f4c776b582f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#php" name="php"></a>PHP</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/5f965fecf9c5fa77d799d0fc94036e30992522d6/687474703a2f2f7765732e696f2f4c7757492f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/5f965fecf9c5fa77d799d0fc94036e30992522d6/687474703a2f2f7765732e696f2f4c7757492f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#ruby" name="ruby"></a>Ruby</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/f6219010840220da525db1865924b6114b7ab6f0/687474703a2f2f7765732e696f2f4c7831692f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/f6219010840220da525db1865924b6114b7ab6f0/687474703a2f2f7765732e696f2f4c7831692f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#python" name="python"></a>Python</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/3f1f88f69995140726951e644b91527b0f8d8602/687474703a2f2f7765732e696f2f4c7774322f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/3f1f88f69995140726951e644b91527b0f8d8602/687474703a2f2f7765732e696f2f4c7774322f636f6e74656e74" /></a></p>
<h3><a class="anchor" href="#markdown" name="markdown"></a>Markdown</h3>
<p><a href="https://a248.e.akamai.net/camo.github.com/718f5fa34adc72c759a2c74a1235e885f3a1f832/687474703a2f2f7765732e696f2f4c7775762f636f6e74656e74" target="_blank"><img style="max-width: 100%;" alt="" src="https://a248.e.akamai.net/camo.github.com/718f5fa34adc72c759a2c74a1235e885f3a1f832/687474703a2f2f7765732e696f2f4c7775762f636f6e74656e74" /></a></p>
<p><a href="https://twitter.com/idpro">Kyle Knight</a> for pushing cobolt2 past the code screen and styling the entire editor.</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/TlQ9cy8XXNg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/cobalt2-theme-sublime-text-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://wesbos.com/cobalt2-theme-sublime-text-2/</feedburner:origLink></item>
		<item>
		<title>Everything I wish I knew running a sole proprietorship business</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/QPbGApCmoos/</link>
		<comments>http://wesbos.com/sole-proprietorship-ontario/#comments</comments>
		<pubDate>Tue, 01 Jan 2013 23:02:08 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[business]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=599</guid>
		<description><![CDATA[2013 marks the beginning of a new fiscal year for many businesses so I thought I would share a few things I have picked up over the past few years. I&#8217;ve run my web consulting business as a proprietorship the &#8230; <a href="http://wesbos.com/sole-proprietorship-ontario/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>2013 marks the beginning of a new fiscal year for many businesses so I thought I would share a few things I have picked up over the past few years. I&#8217;ve run my web consulting business as a proprietorship the past three years and have picked up quite a few nuggets of useful information along the way. These things seem simple and almost laughable now, but as a greenhorn I wish I had known these before I started.</p>
<p>These tips are best if you are thinking about running a sole proprietorship (a business that is owned and run by a single person) in Canada but are helpful for other outside of the country.</p>
<h3>Hire a good Accountant</h3>
<p>I&#8217;m putting this one first because its by far the most important thing you should do when starting a business. My first year I paid someone $50 to do my taxes and I really got what I paid for. I had my taxes reassessed three times and had to pay the government more each time. The second year around I paid around $700 for the fantastic services of <a href="http://www.waterfordta.com/" target="_blank">Waterford Tax &amp; Advisory</a> who did an amazing job straightening everything out and giving me some fantastic advice which saved me tons in the long run. A good accountant will always be around to answer questions and give you advice. You can&#8217;t afford to use a cheap accountant, trust me.</p>
<h3>Ditch excel, use <a href="https://bostype.freshbooks.com/refer/www" target="_blank">Freshbooks</a></h3>
<p>This is a no-brainer for taking care of estimates, expenses and invoicing clients. At $33 a month, this is one of the more expensive services I subscribe to, but it is worth every penny. At the end of the year I&#8217;m able to export a few reports and send them off to my accountant &#8211; no dealing with spreadsheets. My clients love Freshbooks too &#8211; I often get compliments on both how easy it is to manage invoices and how professional my invoices look like.</p>
<h3>Understand taxes &#8211; Personal and HST</h3>
<p>Starting a business, you are probably coming from  a job where all your taxes are taken care of and at the end of the year, you get a nice little return from the government. Not so when you are on your own, take the time to educate yourself on what sort of taxes you need to pay in your area.</p>
<p><strong>Personal Income Taxes: </strong>Running a sole proprietorship in Canada means you get taxed at the same rates as everyone else who isn&#8217;t self-employed. There are both provincial and federal tax rates that vary depending on how much income you bring in. You can run your numbers for both at the <a href="http://www.cra-arc.gc.ca/tx/ndvdls/fq/txrts-eng.html" target="_blank">CRA website</a>.</p>
<p><strong>HST: </strong>I run my business in Ontario, and I need to charge all my clients who live in Ontario 13% HST &#8211; your province or state will have something similar setup. If you are making more than <strong>$30,000 a year  </strong>you will need to register for a HST number and start collecting.</p>
<p>So, the biggest lesson learned here is <strong>you need to pay a ton of taxes.</strong> As soon as you get a cheque, you should cut out anywhere from <strong>35-50% </strong>(13% HST, 22-37% income tax)  - depending on how high your taxable income is &#8211; and placing it in another account to pay the tax man at the end of the year.</p>
<h3>Keep every receipt and expense everything</h3>
<p>The best thing you can do to reduce how hard you get hit by taxes is to expense every single dollar you pay to run your business. Again, this may seem like easy stuff to some, but its worth noting how this stuff works.</p>
<p>You only get taxed on <strong>net income</strong>, not gross income. So, if you get paid $1,000 for a project, but spent $200 on hosting for it, you will only be taxes on $800.</p>
<p>So, think of every little thing you use to run your business. Buying a new laptop, conference tickets + flights, printer ink, online subscriptions, software licenses&#8230; It all adds up quickly and can really help you reduce your taxable income.</p>
<p>As a business, you also don&#8217;t have to pay HST. So any receipt you have that includes 13% HST, you will get that back from the government when you pay your taxes.</p>
<p><strong>Max out your RRSP</strong></p>
<p>This is a good tip for anyone around tax time. Up until the end of February, you can contribute to the previous years RRSP. Anything you contribute to your RRSP is not taxed, so you can treat it as a huge expense. The amount you con contribute depends on your previous years income, but it could be as much as around $20,000. In Canada, this money is meant to only be taken out at retirement, but there is a special clause that lets you cash it out, without penalty, when you buy your first house.</p>
<h3>Health Insurance is cheap</h3>
<p>My wife recently <a href="kaitbos.com/i-quit/" target="_blank">quit her job</a> to work independently beside me. While we are super happy with that decision, we lost the perk of health benefits. In Canada residents are covered for the big stuff like surgeries and doctors appointments, but not things like medicine, dental work and eyeglasses. Insurance plans are surprisingly affordable, starting at $60 for basic coverage. Kait and I went for pretty good dental, eye and prescription coverage and it was around $160/month.</p>
<p>One other thing, we shopped around on the net for insurance and we didn&#8217;t find any good rates, only after getting in touch with a broker did we find out its much cheaper to have a human do it for you.</p>
<h3>Incorporate to save $$</h3>
<p>Coming full circle to having a good acceptance, mine suggested that once you start earning decent income or are working in an arrangement like Kait and I are, it would make sense to ditch the sole proprietorship and incorporate as a business. Its more expensive to incorporate a business (~$500 vs $60) and its a more work to get up and running, but its well worth the tax savings in long run. I&#8217;m only beginning to explore this world but I&#8217;ll be sure to follow up with a post after a few months.</p>
<h3>That&#8217;s it</h3>
<p>TL;DR : Hire a good accountant and explore every possible way that you can reduce your taxable income. Starting to run your own business can be confusing so hopefully these tips can help you.</p>
<p><strong>Update</strong>: Check <a href="http://wesbos.com/sole-proprietorship-ontario/#comment-951">this comment</a> for a lot more useful tips, thanks Martin</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/QPbGApCmoos" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/sole-proprietorship-ontario/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		<feedburner:origLink>http://wesbos.com/sole-proprietorship-ontario/</feedburner:origLink></item>
		<item>
		<title>Remote Debugging with Chrome for Android [video + tut]</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/V9aFY04oGMM/</link>
		<comments>http://wesbos.com/remote-debugging-mobile-chrome-android/#comments</comments>
		<pubDate>Mon, 13 Feb 2012 14:32:21 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=522</guid>
		<description><![CDATA[Be sure to Follow @wesbos on twitter for more like this Earlier this week Chrome for Android was finally announced and web developers everywhere celebrated. Not only did we have one of the best browsers now on our phones, but &#8230; <a href="http://wesbos.com/remote-debugging-mobile-chrome-android/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Be sure to <a href="http://twitter.com/wesbos" target="_blank">Follow @wesbos on twitter</a> for more like this <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>Earlier this week Chrome for Android was finally announced and web developers everywhere celebrated. Not only did we have one of the best browsers now on our phones, but we had access to remote debugging, which we have been waiting for and talking about <em>forever</em>.</p>
<p>Remote debugging allows a developer to use the browsers developer tools from a desktop computer while inspecting and manipulating the website on the mobile device &#8211; all in real time! This means you no longer have to use alert boxes to debug a problem that only reproduces on the phone.</p>
<p>So, while there have been a <a href="http://phonegap.github.com/weinre/" target="_blank">few</a> <a href="http://www.opera.com/dragonfly/documentation/remote/" target="_blank">earlier</a> <a href="http://devblog.blackberry.com/2011/06/debugging-blackberry-web-apps/" target="_blank">implementations</a> of something similar, Chrome for android brings us the rock solid experience that we have been waiting for. Without further ado, here is a quick tutorial on how to get remote debugging up and running.</p>
<p>Update: I&#8217;d like to specifically point out that Opera Mobile has has this functionality for quite some time now and you&#8217;re able to do it without USB or a SDK (<a href="http://twitter.com/#!/miketaylr" target="_blank">miketaylr</a> had an awesome presentation on it at jQuer conf). So, develop in whatever browser you prefer and use both these tools when you&#8217;re debugging that specific mobile browser.<br />
<span id="more-522"></span></p>
<h3>What you&#8217;ll need</h3>
<ol>
<li>An android phone that runs Ice Cream Sandwhich</li>
<li>Google Chrome beta from the Android Market</li>
<li>A USB to plug in your phone </li>
<li>The <a title="Android SDK with Remote Debugging" href="http://developer.android.com/sdk" target="_blank">Android SDK </a>if you haven&#8217;t already installed it.</li>
</ol>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/n_7Wyj6DciY?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h3>Installing the Android SDK</h3>
<p>This step is really quick because you either already have the android SDK installed or if you need to install it, we just need a tiny little part of it &#8211; nothing related to the native android development. These instructions are for OSX but they are very similar to Windows, the one differnce being that Windows users must install the <a href="http://developer.android.com/sdk/win-usb.html" target="_blank">USB Driver</a>. Go ahead and download the SDK, unzip it, and put the entire <code>android-sdk-macosx</code> folder somewhere other than your downloads folder. I reccomend keeping it in in <code>/Developer/android-sdk-macosx/</code>. Double click <code>android</code> file and the Android SDK manager will open up. Uncheck everything except the &#8220;Android SDK Platform-tools&#8221; and click &#8220;Install 1 Package&#8221;</p>
<p><img src="http://wesbos.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-11-at-11.30.02-AM3-650x464.png" alt="" title="Screen Shot 2012-02-11 at 11.30.02 AM" width="640" height="456" class="aligncenter size-large wp-image-533" /></p>
<p>You&#8217;ll also probably want to add the <code>/platform tools/</code> to your $PATH so you can access the <code>adb</code> command from any folder rather than just in the platform tools folder. Run the following command  from your terminal.</p>
<p><code>export PATH=$PATH:/Developer/android-sdk-macosx/platform-tools</code></p>
<h3>Preparing your phone</h3>
<p>There are two things you need to enable to make remote debugging. Plug your phone in via USB and set the following two options.</p>
<ol>
<li>Check the box for <code>Settings</code> &rarr; <code>Developer options</code> &#038;rarrl <code>USB debugging</code></li>
<li>Open Chrome on your phone &rarr; <code>Settings</code> &rarr; <code>Developer Tools</code> &rarr; <code>check Enable USB Web debugging</code></li>
</ol>
<h3>Starting the remote debugging!</h3>
<p>Now that we have everything in place and our phone is plugged in, we can start the remote debugging server. Fire open your terminal and type the following command and hit enter:</p>
<p><code>adb forward tcp:9222 localabstract:chrome_devtools_remote</code></p>
<p>Occasionally I&#8217;ll either get no response or a &#8220;device not found&#8221; error. I&#8217;ve found that running the command <code>adb kill-server</code> and then the code above resurrects the situation.</p>
<p><img src="http://wesbos.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-11-at-12.07.17-PM.png" alt="" title="adb forward tcp:9222 localabstract:chrome_devtools_remote" width="562" height="170" class="aligncenter size-full wp-image-538" /></p>
<p>Now browse to <a href="http://localhost:9222" target="_blank">http://localhost:9222</a> on your desktop version of chrome and you will see a list of currently open tabs on your phone, clicking one of them will reveal the Chrome dev tools interface that you&#8217;re used to. Instead of having the window above the tools, its on your phone!</p>
<p><img src="http://wesbos.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-11-at-12.39.28-PM-650x373.png" alt="" title="Chrome Remote Debugging" width="640" height="367" class="aligncenter size-large wp-image-540" /></p>
<p>You can use it just as if you were using your regular dev tools. Go ahead change the CSS background colour or send an alert over the console.</p>
<p><img src="http://wesbos.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-11-at-12.44.50-PM-300x284.png" alt="" title="Remote Debugging Alert" width="300" height="284" class="alignleft size-medium wp-image-541" /><br />
<img src="http://wesbos.com/wp-content/uploads/2012/02/Screenshot_2012-02-11-12-54-40-180x300.png" alt="" title="Screenshot_2012-02-11-12-54-40" width="180" height="300" class="alignright size-medium wp-image-542" /></p>
<div class="clear"></div>
<h3>Thats all folks!</h3>
<p>Thats all, its an incredible useful tool that we have all been looking forward to. Now we wait with baited breath for Safari on IOS to turn on remote debugging.</p>
<p>If you liked this tutorial, be sure to give me a <a href="http://twitter.com/wesbos" target="_blank">follow on twitter</a> <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/V9aFY04oGMM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/remote-debugging-mobile-chrome-android/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://wesbos.com/remote-debugging-mobile-chrome-android/</feedburner:origLink></item>
		<item>
		<title>What I learned interviewing with Google</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/k-nLlaQb6wk/</link>
		<comments>http://wesbos.com/interviewing-with-google/#comments</comments>
		<pubDate>Thu, 09 Feb 2012 05:29:59 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=508</guid>
		<description><![CDATA[Over the last few weeks I&#8217;ve been interviewing with Google for a job doing primarily JavaScript development. I didn&#8217;t end up getting the job but I thought I would share the process of interviewing for Google as it was both &#8230; <a href="http://wesbos.com/interviewing-with-google/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Over the last few weeks I&#8217;ve been interviewing with Google for a job doing primarily JavaScript development. I didn&#8217;t end up getting the job but I thought I would share the process of interviewing for Google as it was both very exciting and a humbling experience. I can&#8217;t reveal everything as I&#8217;m under a few NDAs. I&#8217;m not going to mention the products or teams that I was interviewing for but you may be able to guess.</p>
<p>For those that don&#8217;t know me, I&#8217;m an independent developer/designer. A majority of my work falls into the four categories of JavaScript development, WordPress development, HTML5/CSS3 or UI/UX design. I absolutely love running my own show and it would take quite a bit to get me to switch out.</p>
<p><strong>In the beginning</strong></p>
<p>So, a few months ago I had a Google employee ask me if I was interested in joining their team. As I said, I&#8217;m super happy with what I&#8217;m doing at the moment but I didn&#8217;t want to turn down the chance to interview or even work for Google. I happily passed along my resume and that was the end of that for about 5-6 months.<br />
<span id="more-508"></span><br />
Cut to about 3 weeks ago, I received an email from a Google recruiter asking if I was interested in a software engineer job down in Boston. I told her I was and we arranged a phone interview.</p>
<p>At this point I was really excited because its always been a bit of a dream of mine to work for Google but I have always assumed two things:</p>
<ul>
<li>Google only hires those with an educational background in Computer Science</li>
<li>Google only hires people with a well versed background in many programming languages.</li>
</ul>
<p>I went to school for Information Technology Management at Ryerson University where I graduated with a bComm. My schooling was more about development methodologies, project management, systems analysis and other high level IT skills combined with way too much math and management approaches. I took one course on development which gave me an excellent primer to C and Unix but it was far from what those in Computer science learn. I&#8217;ve been coding since I can remember and have just picked up my chops along the way mainly focusing on PHP development and the last few years, JavaScript.</p>
<p>So, needless to say I wasn&#8217;t as well versed in some algorithms and big O as someone who spent 4 years in Comp Sci but I have a pretty good handle on the languages I do know.</p>
<p><strong>The First Interview</strong></p>
<p>The first interview was over the phone with a Google HR rep. It was a fairly quick 20 minute interview where I talked about what sort of projects I liked to work on, what langages were my favourite and my background in both employment and schooling. I also told her I&#8217;d be willing to move down to Boston but would love a spot at their Waterloo office (which is about a 1.5 hour drive from Toronto). She told me they primarily hire strong C++ and Java developers, something which I have very little experience with. After I talked about how much I enjoyed front end devleopment, she said that I would be a good fit for a spot in their waterloo office.</p>
<p>We arranged to do two interviews in one day in about a week and a half. The HR rep sent over an email with some guidelines and things to brush up on which included comp sci 101 things such as sorting algos, hash tables, binary trees and so on. I was familiar with a few things on the list, but I definitely had to do a lot of reading in the week and a half before my interview.</p>
<p><strong>Meeting with Google engineers and coding on a whiteboard</strong></p>
<p>After a few late, panicked nights and handfulls of really fun Javascript problems from my good friend <a href="http://darcyclarke.me" target="_blank">Darcy Clarke</a> who did his best to prepare me, I was ready for my two interviews with the engineers.</p>
<p>My first interview was with a mobile developer and it lasted around an hour. He started off discussing different types of sorts, explaining what algorithms would be more performant, which situations I would use a specific algorithm and a whole smattering of comp sci terminology which I had to explain. I tripped over quite a few of these and felt pretty embarrassed. After that we moved onto talking about JavaScript performance, I wish I could say more here but not revealing the questions asked was a large part of the NDA. After that we moved into talking about design for mobile devices. After this and the JavaScript questions I started to feel pretty good about it. We ended the interview with a 25 minute coding question that had to do with efficiently sorting arrays. I had never coded on a whiteboard before and I felt like I made a few stupid mistakes.</p>
<p>Next up was another mobile developer from another product that they work on in the Google Waterloo office. We started off talking JavaScript performance again and then jumped right into the coding problem on the whiteboard. I was pretty nervous at this point in time and I made a few more silly mistakes that I wouldn&#8217;t have done in a proper IDE. We finished the interview talking about some HTML5 video stuff I was working on and talked a little bit about typed javascript compression.</p>
<p>I left after that feeling that I totally slam dunked parts of the interview and bombed other parts.</p>
<p><strong>Whew, its over.</strong></p>
<p>A few days later I got a call from the HR person at Google and she told me in the nicest way possible that I wasn&#8217;t a fit for the position. She said she would keep me in mind for future positions, which is nice whether they meant it or not <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Coming out of this I&#8217;m not particularly bummed out, it was a fantastic experience to interview with Google, I&#8217;m honoured they had me come in and interview; its something I never would have thought would happen to me. I still have a really awesome job where I work on some really awesome projects and I have an incredible drive to keep learning more about web development. To sum it up what I learned in a few points:</p>
<ol>
<li>Comp sci problems are a ton of fun to solve in JavaScript. I practiced a lot with Nicholas Zakas&#8217; <a href="http://www.nczonline.net/blog/tag/computer-science/" target="_blank">computer science in JavaScript </a> posts.</li>
<li>Even if you aren&#8217;t a leet C++ or Java dev, Google still takes interest</li>
<li>Learning another language helps you become a more rounded developer. This experience hasn&#8217;t made me want to go back to writing C but I may take interest in another language that isn&#8217;t as forgiving as JavaScript.</li>
<li>Coding Chops &gt; Comp Sci degree</li>
<li>A Comp Sci degree is very helpful when trying to explain Hash tables, Vectors and Big O</li>
<li>Always be hustlin&#8217; A few years ago I would have never have thought I would be interviewing at google just 9 months fresh out of school. Anything can happen.</li>
</ol>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/k-nLlaQb6wk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/interviewing-with-google/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		<feedburner:origLink>http://wesbos.com/interviewing-with-google/</feedburner:origLink></item>
		<item>
		<title>HTML5 Shirt Giveaway!</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/-JA5LkKDaNc/</link>
		<comments>http://wesbos.com/html5-shirt-giveaway/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 16:36:13 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=471</guid>
		<description><![CDATA[Happy New Year! I hope everyone had an awesome holidays. To celebrate, I&#8217;m going to be giving away 5 of these kickass HTML5 shirts that the folks at Microsoft have kindly provided. These aren&#8217;t your regular HTML5 shirts, they come &#8230; <a href="http://wesbos.com/html5-shirt-giveaway/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Happy New Year! I hope everyone had an awesome holidays. To celebrate, I&#8217;m going to be giving away 5 of these kickass HTML5 shirts that the folks at Microsoft have kindly provided.</p>
<p>These aren&#8217;t your regular HTML5 shirts, they come from Canada so naturally they involve a polar bear, a beaver and a moose.</p>
<p><img class="aligncenter size-full wp-image-472" title="html53" src="http://wesbos.com/wp-content/uploads/2012/01/html53.png" alt="" width="650" height="400" /><img class="aligncenter size-full wp-image-474" title="html2" src="http://wesbos.com/wp-content/uploads/2012/01/html21.png" alt="" width="650" height="400" /></p>
<p><strong>How To Enter</strong></p>
<p>To enter, simply sent out a tweet with the hashtag #HTML5shirt and a link to this post.</p>
<p>&#8220;Win a #HTML5shirt from @wesbos http://wesbos.com/html5-shirt-giveaway&#8221;</p>
<p><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://wesbos.com/html5-shirt-giveaway/" data-text="Win a #HTML5shirt from @wesbos" data-size="large" data-related="wesbos">Tweet</a></p>
<p>I will be giving them away to 5 random tweeters and using <a href="http://twittertwitterchickendinner.com" target="_blank">twittertwitterchickendinner.com</a> to pick the winners. I&#8217;ll ship you the shirt anywhere in the world. I have them in most sizes but is first come first serve.</p>
<p>Thats it, good luck and if you so please, follow me on twitter for more on HTML5. <a href="https://twitter.com/wesbos" class="twitter-follow-button" data-show-count="false">Follow @wesbos</a></p>
<p><strong>Update: Winners!</strong><br />
First off, thanks to everyone who entered the draw, having almost 2,000 enter is pretty nuts! I&#8217;ll have to find a way I can do this again because you guys love your free shirts <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Drumroll please&#8230; The Winners are: </p>
<p>@steno, @sheppy, @csixty4, @oscargodson and @PatridgeDev</p>
<p>Congrats! Contact me wes@wesbos.com within 24 hours with a mailing address and shirt size to claim you prize.</p>
<p>Thanks again everyone, I have some really cool HTML5 stuff coming down the pipe so stay tuned!</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/-JA5LkKDaNc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/html5-shirt-giveaway/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://wesbos.com/html5-shirt-giveaway/</feedburner:origLink></item>
		<item>
		<title>Upcoming Talks and Workshops!</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/B9BulwQIXBk/</link>
		<comments>http://wesbos.com/upcoming-talks-and-workshops/#comments</comments>
		<pubDate>Thu, 10 Nov 2011 00:46:49 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[HTML5]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[devto]]></category>
		<category><![CDATA[ladies learning code]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=464</guid>
		<description><![CDATA[This November I have two development related talks coming up and I thought I would take a second to formally invite you! The first is an all day workshop on WordPress development which is being done with the great folks &#8230; <a href="http://wesbos.com/upcoming-talks-and-workshops/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This November I have two development related talks coming up and I thought I would take a second to formally invite you!</p>
<p>The first is an all day workshop on WordPress development which is being done with the great folks at <a href="http://ladieslearningcode.com/" target="_blank">Ladies Learning Code</a>. If you haven&#8217;t heard yet, LLC is an awesome initiative started by a few<a href="http://ladieslearningcode.com/about/" target="_blank"> Toronto ladies</a> with the purpose of creating a comfortable environment where women can learn basic web development skills. I will be leading the upcoming WordPress workshop where I will take you from installing WordPress to making your very own theme. The workshop is on Saturday, November 26 and costs $40. The first round of tickets sold out in a heart beat, so be sure to <a href="http://ladieslearningcodenov26.eventbrite.com/" target="_blank">sign up for the second round </a>if you&#8217;re interested!</p>
<p>The second is quick talk on HTML5 Canvas at the <a href="http://devto.ca/" target="_blank">#devTo</a> meetup. This event is held once a month and is open to anyone who is interested in chatting about development. I&#8217;ve been to the last few meetups and I&#8217;ve found them pretty awesome. There a good mix of designers, developers (of all languages) and industry folk which always allows for good conversation (the free pizza and beer aren&#8217;t bad either!). I&#8217;ll be doing a quick introduction to the HTML5 Canvas element, what it is, what we can do with it, how to work with it as well as showing a few examples of stuff I&#8217;ve done with it. Canvas really is one of the most exciting parts of HTML5 so I&#8217;m looking forward to sharing what I&#8217;ve done so far. This event is always super popular and has already sold out, so get on the <a href="http://atendy.com/event/240747" target="_blank">wait list</a> and cross your fingers!</p>
<p>Thats all for now, hope to see you at one of the upcoming events!</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/B9BulwQIXBk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/upcoming-talks-and-workshops/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://wesbos.com/upcoming-talks-and-workshops/</feedburner:origLink></item>
		<item>
		<title>Hide iOS5 Newsstand Icon on the iPhone</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/IE77IJJ8n1c/</link>
		<comments>http://wesbos.com/hide-newsstand-icon-iphone/#comments</comments>
		<pubDate>Thu, 13 Oct 2011 20:09:47 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[iphone]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=453</guid>
		<description><![CDATA[Many people, myself included, were annoyed that you aren&#8217;t able to put the new Newsstand Icon in a folder. Well a quick little hack I found today lets you do just that! Turns out you can trick iOS5 by creating &#8230; <a href="http://wesbos.com/hide-newsstand-icon-iphone/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Many people, myself included, were annoyed that you aren&#8217;t able to put the new Newsstand Icon in a folder. Well a quick little <a href="http://thecodingmassacre.wordpress.com/2011/10/13/newsstand-folder-no-jailbreak-ios-5/" target="_blank">hack</a> I found today lets you do just that! Turns out you can trick iOS5 by creating a folder with other icons and then quickly drag it into that folder.</p>
<p>This doesn&#8217;t require you to jail break, but it does take a quick finger! Watch this video to see how to do it:</p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/mSM1_gzi4yI?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h3>Note</h3>
<p>This should only be done if you are no using newsstand. Trying to launch newsstand from within a folder crashes springboard!</h3>
<p>Cool eh? Follow me on <a href="http://twitter.com/wesbos">Twitter</a> for more like this <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/IE77IJJ8n1c" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/hide-newsstand-icon-iphone/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://wesbos.com/hide-newsstand-icon-iphone/</feedburner:origLink></item>
		<item>
		<title>Code Folding in Sublime Text 2</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/WMVy6O-JC9g/</link>
		<comments>http://wesbos.com/sublime-text-code-folding/#comments</comments>
		<pubDate>Tue, 04 Oct 2011 03:20:08 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Sublime Text]]></category>
		<category><![CDATA[Text Editors]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=437</guid>
		<description><![CDATA[To continue on with my string of blog posts on Sublime Text 2, I&#8217;m going to show you a short but handy feature that was just pushed to the stable build. Code Folding! Unfortunately, collapsing of code in sublime text &#8230; <a href="http://wesbos.com/sublime-text-code-folding/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>To continue on with my string of blog posts on Sublime Text 2, I&#8217;m going to show you a short but handy feature that was just pushed to the stable build. Code Folding!</p>
<p>Unfortunately, collapsing of code in sublime text isn&#8217;t exactly the same as textmate, so you dont get the little arrows in the sidebar. The code is also folded into a single character which makes it easy to delete an entire block of folded code without noticing you have done so. This is the first iteration of code folding in sublime text 2, so I&#8217;m sure it will only get better. With those cautions in mind lets take a look at how to work code folding in Sublime.<br />
<span id="more-437"></span></p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/80UUPMUAP-g?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h3>Practice Code</h3>
<p>Code folding works in all languages. I&#8217;ve created a small snippet of JavaScript which we can use to practice. Copy and paste this into Sublime and set the document mode as JavaScript.</p>
<pre class="brush:js">var obj = {
	myStr: "Hello",
	myFunc : function() {
		console.log("hello");
		$('.someDiv').animate({height: 500}, function(){}
			// trigger the callback
			console.log('Done');
		});
	},
	myFunc2 : function() {
		return "Just another Level 2 function";
	},
	myNum : function() {
		return "Level 2 function";
	}
}</pre>
<h3>Folding Selected Text</h3>
<p>This is probably what you came here looking for. you want to select a few lines of text and fold them out of the way. Easy!</p>
<p>Select the text you want to fold and hit <code> Command + Option + [</code>. You'll now see you have a little icon indicating you have folded some code.</p>
<p><img class="alignleft size-full wp-image-423" title="Screen Shot 2011-10-03 at 5.32.13 PM" src="http://wesbos.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-03-at-5.32.13-PM.png" alt="" width="244" height="124" /></p>
<p>To unfold your code, hit the opposite <code> Command + Option + ]</code>.</p>
<p><strong>*Note:  Windows users, substitute command and option for CTRL + SHIFT</strong></p>
<h3>Block level code folding is where its at!</h3>
<p>Selecting the code you want to fold can be a pain. If you maintain nice, clean indenting within your document, you&#8217;ll be able to quickly fold and unfold several levels of code in just a few key strokes.</p>
<p>To fold a block, place your cursor anywhere within the block you want to fold. For our example, lets place it in the myFunc function. Now you just hit the folding keys to collapse that block.<br />
<code> Command + Option + [</code></p>
<p><img class="aligncenter size-full wp-image-424" title="Sublime Text Block Code Folding" src="http://wesbos.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-03-at-5.37.27-PM.png" alt="" width="432" height="245" /></p>
<h3>Fold Multiple blocks at once</h3>
<p>Another handy feature of Sublime Text 2 code folding is being able to fold all blocks that are indented with a certain level. For this example, I want to fold all the and just see the the properties/functions of <code>obj</code>.</p>
<p>The keyboard shortcut for this is a little different. We need to hold down <code>Command</code> and then tap <code>k</code>.<br />
While you are still holding down <code>Command</code> tap the level of code block you want to fold. In this case 2.</p>
<p>Confused? <code>CMD + K, CMD + 2</code></p>
<p>We now see that everything beyond 2nd level blocks are hidden. To unfold everything again, we do the same thing but with 0.</p>
<p><code>CMD + K, CMD + 0</code></p>
<h3>Folding Tag attributes</h3>
<p><img class="alignright size-full wp-image-427" title="Sublime Text Attribute Folding" src="http://wesbos.com/wp-content/uploads/2011/10/Screen-Shot-2011-10-03-at-5.50.54-PM.png" alt="" width="275" height="378" />When working with an HTML document that is heavy on attributes, it can be helpful to hide everything but the element type. This is extremely useful when working with something like jQuery UI that have long class names, titles, data, and aria attribues. Now, this one is all or nothing, so you can&#8217;t hide them case-by-case.</p>
<p>To hide:<br />
<code>CMD + K, CMD + T</code></p>
<p>To show again:<br />
<code>CMD + K, CMD + 0</code></p>
<p><br/></p>
<h4>You&#8217;re now a cold folding master</h4>
<p>Do each of these folding steps a few times to get the hang of it and you will find it very useful in your day to day development.</p>
<p>Let me know if you have any questions. If you like this stuff please <a href="http://twitter.com/wesbos">Follow Me on Twitter</a>.</p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/WMVy6O-JC9g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/sublime-text-code-folding/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		<feedburner:origLink>http://wesbos.com/sublime-text-code-folding/</feedburner:origLink></item>
		<item>
		<title>Sublime Text 2 Build System Scripts: CoffeeScript &amp; Node</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/JPB6aiTdVoI/</link>
		<comments>http://wesbos.com/sublime-text-build-scripts/#comments</comments>
		<pubDate>Thu, 29 Sep 2011 00:32:48 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[NodeJS]]></category>
		<category><![CDATA[Sublime Text]]></category>
		<category><![CDATA[Text Editors]]></category>
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=408</guid>
		<description><![CDATA[A really great feature of Sublime Text 2 is the ability to create your own build scripts. A build script is helpful when you are writing in a language that needs to be compiled or executed from terminal / command &#8230; <a href="http://wesbos.com/sublime-text-build-scripts/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>A really great feature of <a href="http://www.sublimetext.com/2" target="blank">Sublime Text 2</a> is the ability to create your own build scripts. A build script is helpful when you are writing in a language that needs to be compiled or executed from terminal / command line. I personally use build scripts to compile the current file into CoffeeScript as well as run the current file in Node JS.</p>
<p>Watch the tutorial or continue reading to learn how to make Sublime Text 2 build scripts.<br />
<span id="more-408"></span></p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/iejQvQF-vZo?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h3>Creating a Build Script</h3>
<p>To get started, go to <code>Tools->Build System -> New Build System... </code> and you will be presented with the boilerplate for a build script. </p>
<p>We have four lines to feed into our <code>.sublime-build</code> file:</p>
<ul>
<li><strong>cmd</strong> is an array of commends that will be run.
<li>
<li><strong>selector</strong> is an optional way to scope the build script to a specific filetype</li>
<li><strong>path</strong> is where the command is to be executed. Because sublime executes it in the python console, we need to specify where on our system the compliler we want to use lies.</li>
<li><strong>file_regex</strong> specifies where the error lines are and what to be returned.</li>
</ul>
<p>For a complete list of all the variables available within a build script, check the <a href="http://sublimetext.info/docs/en/reference/build_systems.html" target="_blank">variable reference</a>. </p>
<h3>CoffeeScript Build Script</h3>
<p>So, to create our CoffeeScript build file, we simply fill in the following three lines. Keep in mind that with the Node.js coffeescript compiler we would normally execute something similar to this in the terminal:</p>
<p><code>coffee -c /path/to/file.coffee</code></p>
<pre class="brush:js">
{
	"cmd": ["coffee","-c", "$file"],
	"selector" : "source.coffee",
	"path" : "/usr/local/bin"
}
</pre>
<p>Save your file in your user packages folder and restart Sublime Text. On OSX its located at:<br />
<code> ~/Library/Application Support/Sublime Text 2/Packages/User</code></p>
<p>Now every time we hit <strong>CMD + B</strong> our coffeescript file will be compiled with the build script. If you want to watch the file for changes after the first compile, simply switch the first line to <code>"cmd": ["coffee","-wc", "$file"],</code>. If anyone is using my <a href="https://github.com/wesbos/coffeescript-growl" target="_blank">CoffeeScript-Growl plugin</a>, change your first line to <code>"cmd": ["coffee", "-r", "coffeescript-growl", "-wc", "$file"],</code> to get growl notifications.</p>
<h3>Node.js Files</h3>
<p>Another use for Sublime Text build scripts is launching the nodejs file you are currently working on. Our build script now looks something like this:</p>
<pre class="brush:js">
{
	"cmd": ["node", "$file"],
	"selector" : "source.js",
	"path" : "/usr/local/bin"
}
</pre>
<h3>Thats is!</h3>
<p>Pretty simple, eh? There is a lot of room for expanding these builds and making them do a lot of the manual work for you. If you have anything to add, please post it in the comments and I&#8217;ll be sure to add it to the post.</p>
<p>As always be sure to <a href="http://www.twitter.com" target="_blank">Follow me on Twitter</a></p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/JPB6aiTdVoI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/sublime-text-build-scripts/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		<feedburner:origLink>http://wesbos.com/sublime-text-build-scripts/</feedburner:origLink></item>
		<item>
		<title>JavaScript Face Detection + Canvas + Video = HTML5 Glasses!</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/9Z7QJV7hCkE/</link>
		<comments>http://wesbos.com/html5-video-face-detection-canvas-javascript/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 02:50:19 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=388</guid>
		<description><![CDATA[This morning I saw this link on youtube which was a little mashup of some HTML5 technologies. I thought it would be funny if I could do the same, but with goofy pair of glasses. I&#8217;ve also been itching to &#8230; <a href="http://wesbos.com/html5-video-face-detection-canvas-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This morning I saw <a href="http://www.youtube.com/watch?v=EBxDyr--HIY" target="_blank">this</a> link on youtube which was a little mashup of some HTML5 technologies. I thought it would be funny if I could do the same, but with goofy pair of glasses. I&#8217;ve also been itching to put the <a title="JavaScript Face Detection" href="https://github.com/liuliu/ccv" target="_blank">CCV</a> JavaScript Face Detection library to use. This library shows a few examples on static images, but after a quick look at the code, it shows that the underlying element to the script is a canvas element. So instead of running it on a single image, I am running it on a feed of frames coming from an HTML5 video element.</p>
<p>I&#8217;ll go into the technical details further on in the post, but here is a demo as well as a youtube video showing the effect as it can be a little sluggish on older machines. Currently tested and working in Google Chrome 14 and Firefox 6.0. <span id="more-388"></span></p>
<p><a href="http://wesbos.com/demos/html5-face-detection/" target="_blank">Try the Demo</a>   |  <a href="https://github.com/wesbos/HTML5-Face-Detection" target="_blank">Download the Source</a></p>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/YYES9Qd094o?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h3>Setting up our document</h3>
<p>To get started, we dont really need that much. Only two of the files from the CCV Library are required are <a title="CCV.JS Face Detection" href="https://github.com/liuliu/ccv/blob/stable/js/ccv.js" target="_blank">CCV.js</a> which does the acutal detection of the the face, and <a href="https://github.com/liuliu/ccv/blob/stable/js/face.js" target="_blank">face.js</a> which holds the data for what faces look like. We will also need an empty canvas element, a HTML5 video element with .MP4 and .OGG encoded files  (I used <a href="http://www.mirovideoconverter.com/" target="_blank">Miro</a> to convert mine), and a blank scripts.js file. Things will look like this when we are setup:</p>
<pre class="brush:xml">&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
&lt;title&gt;HTML5 Face Detection&lt;/title&gt;
&lt;link rel="stylesheet" href="style.css"/&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class="wrapper"&gt;
	&lt;h1&gt;HTML5 GLASSES&lt;/h1&gt;
	&lt;p&gt;Created by &lt;a href="http://twitter.com/wesbos" target="_blank"&gt;Wes Bos&lt;/a&gt;. See full details &lt;a href=""&gt;here.&lt;/a&gt;&lt;/p&gt;
	&lt;!-- Our Main Video Element --&gt;
	&lt;video height="426" width="640" controls="false"&gt;
		&lt;source src="videos/wes4.ogg" /&gt;
		&lt;source src="videos/wes4.mp4" /&gt;
	&lt;/video&gt;

	&lt;!-- Out Canvas Element for output --&gt;
	&lt;canvas id="output"  height="426" width="640" &gt;&lt;/canvas&gt;

	&lt;!-- div to track progress --&gt;
	&lt;div id="elapsed_time"&gt;Press play for HTML5 Glasses!&lt;/div&gt;
&lt;/div&gt;
&lt;script type="text/javascript" src="scripts/ccv.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="scripts/face.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="scripts/scripts.js"&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</pre>
<p>&nbsp;</p>
<h3>Let&#8217;s write some JavaScript!</h3>
<p>The core of this application is just a single function called <code>html5glasses()</code> that runs every 200 miliseconds. The function grabs the current frame from the window, spits it onto the canvas and then lets the CCV JS library detect the face. When it  returns the data we loop through each of the found faces and and apply the silly glasses.</p>
<p>I should note that this isn&#8217;t the fastest thing in the world, and it is blocking. In the CCV examples, they provide a web worker example so we could do this asynchronously, but in my tests it was significantly slower. This is new technology and will only get better. On my computer I see a new frame about every 300 miliseconds, or 3 times a second.</p>
<h3>Setup the JavaScript Variables</h3>
<p>I&#8217;ve commented these inline.</p>
<pre class="brush:js">
var		
		// Store the first HTML5 video element in the document
		video = document.querySelector('video'),
		// We use this to time how long things are taking. Not that important..
		time_dump = document.getElementById("elapsed_time"),
		// Create a new image that will be our goofy glasses
		glasses = new Image(),
		// Store the canvas so we can write to it
		canvas = document.getElementById("output"),
		// Get the canvas 2d Context
		ctx = canvas.getContext("2d");
		// Finally set the source of our new glasses img element
		glasses.src = "i/glasses.png";
</pre>
<h3>Create our main html5glasses() function</h3>
<p>This is where all the magic happens. Read through each line and realize what is happening. Pay specific attenton to the <code>ccv.detect_objects()</code> function.</p>
<pre class="brush:js">
function html5glasses() {
	// Start the clock 
	var elapsed_time = (new Date()).getTime();

	// Draw the video to canvas
	ctx.drawImage(video, 0, 0, video.width, video.height, 0, 0, canvas.width, canvas.height);

	// use the face detection library to find the face
	var comp = ccv.detect_objects({ "canvas" : (ccv.pre(canvas)),
									"cascade" : cascade,
									"interval" : 5,
									"min_neighbors" : 1 });

	// Stop the clock
	time_dump.innerHTML = "Process time : " + ((new Date()).getTime() - elapsed_time).toString() + "ms";

	// Draw glasses on everyone!
	for (var i = 0; i < comp.length; i++) {
		ctx.drawImage(glasses, comp[i].x, comp[i].y,comp[i].width, comp[i].height);
	}
}
</pre>
<h3>Finally, trigger it!</h3>
<p>We trigger the detection when the video element is played and stop it when it reaches the end. </p>
<pre class="brush:js">
/* Events */ 

video.addEventListener('play', function() {
	vidInterval = setInterval(html5glasses,200); 
});

video.addEventListener('ended', function() {
	clearInterval(vidInterval);
	time_dump.innerHTML = "finished";
});
</pre>
<h3> Pretty cool, eh? </h3>
<p>I'm just getting into CCV, but the library can be extended to recognize much more than just faces. If you take at look at the github repo, they have examples for detecting all kinds of things.</p>
<h3>What else?</h3>
<p>Next time I'm in the mood for a little hack, I'll try and hook this up to a flash webcam app or <a href="http://mozillalabs.com/rainbow/" target="_blank">Mozilla's Rainbow</a> to stream the data right from the device itself, giving us realtime funny glasses!</p>
<p>Let me know if you have any ideas or questions. I'm <a href="http://twitter.com/wesbos" target="_blank">@wesbos on twitter</a> and have hosted the source on Git Hub</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/9Z7QJV7hCkE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/html5-video-face-detection-canvas-javascript/feed/</wfw:commentRss>
		<slash:comments>42</slash:comments>
		<feedburner:origLink>http://wesbos.com/html5-video-face-detection-canvas-javascript/</feedburner:origLink></item>
		<item>
		<title>5 Helpful Tips for moving to Sublime Text 2</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/VqIwlG8gbxI/</link>
		<comments>http://wesbos.com/sublime-text-2-tips/#comments</comments>
		<pubDate>Thu, 22 Sep 2011 20:54:03 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Sublime Text]]></category>
		<category><![CDATA[Text Editors]]></category>
		<category><![CDATA[Wes]]></category>
		<category><![CDATA[sublime]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=359</guid>
		<description><![CDATA[I&#8217;m a long time Coda user. A few months ago I, like everyone else, decided to switch over to vim. I really liked Vim but just couldn&#8217;t get the hang of it for whatever reason. After shamefully crawling back to &#8230; <a href="http://wesbos.com/sublime-text-2-tips/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m a long time <a href="http://www.panic.com/coda/" target="_blank">Coda</a> user. A few months ago I, like everyone else, decided to switch over to vim. I really liked Vim but just couldn&#8217;t get the hang of it for whatever reason. After shamefully crawling back to Coda, I found myself realizing that Coda fell short in a few areas. It was then I decided to give Sublime Text 2 a shot as it had been touted as the sucessor to Text Mate.  Its taken me a few weeks to get used to, but I can happily say I&#8217;m a Sublime Text 2 user now. Here are a few tips that make switching over easier.</p>
<p><span id="more-359"></span></p>
<h2>1. Install the command line utility</h2>
<p><img class="aligncenter size-full wp-image-364" title="Sublime Text 2 Command Line Utility" src="http://wesbos.com/wp-content/uploads/2011/09/Screen-Shot-2011-09-22-at-4.00.21-PM.png" alt="Sublime Text 2 Command Line Utility" width="634" height="440" /></p>
<p>If you do a lot of work in bash, its helpful to open up a file or entire folder in your editor right from the command line.</p>
<p><strong>To Install:</strong><br />
Run the following line in your terminal.<br />
<code>sudo ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /bin/subl</code><br />
This will then give you access to the bash command <strong>subl</strong> with a number of arguments.</p>
<p>The most basic usage is to open the current folder in Sublime Text 2. Simply Type <code>subl .</code></p>
<p><code>subl -ab tutorial.html </code> opens the file tutorial.html in the current window but keeps terminal in focus. This is handy if you need to traverse a few directories and cherry pick a number of files to be opened.</p>
<p><strong>Arguments</strong>:<br />
&#8211;project : Load the given project<br />
&#8211;command : Run the given command<br />
-n or &#8211;new-window:  Open a new window<br />
-a or &#8211;add:         Add folders to the current window<br />
-w or &#8211;wait:        Wait for the files to be closed before returning<br />
-b or &#8211;background:  Don&#8217;t activate the application<br />
-s or &#8211;stay:        Keep the application activated after closing the file<br />
-h or &#8211;help:        Show help (this message) and exit<br />
-v or &#8211;version:     Show version and exit</p>
<p>&nbsp;</p>
<h2>2. Open files in current sublime text window</h2>
<p>This was one of the biggest annoyances for me when switching over from coda. Whenever I would drag a file into the sublime dock icon it would open a brand new instance of sublime when I just wanted to view it along with the rest of my files. Turns out this is a super simple fix.</p>
<p>Hit<code>Command + Shift + P</code> to bring up the sublime launcher type <strong>&#8220;user global settings</strong> and hit enter. This file is similar to a .vimrc file and holds all of your custom settings. This file wont be written over when you upgrade like <strong>default global settings</strong>. Once you have this file open, add the following line:</p>
<p><code>"open_files_in_new_window": false</code></p>
<p>&nbsp;</p>
<h2>3. Get Code Hinting in Sublime Text 2</h2>
<p><img class="alignleft size-full wp-image-368" title="Sublime Text 2 Code Hinting" src="http://wesbos.com/wp-content/uploads/2011/09/Screen-Shot-2011-09-22-at-4.21.45-PM.png" alt="Sublime Text 2 Code Hinting" width="289" height="159" />One feature that Coda has just&nbsp;slam dunked&nbsp;is their code hinting. I rarely ever have to type entire key words. A solution for getting code completion working in Sublime Text is to install SublimeCodeIntel, a port of the Komodo editor code &nbsp;completion engine. It isn&#8217;t perfect,&nbsp;particularly&nbsp;in CSS file, but its pretty good and gets the job done. &nbsp;<a title="Sublime Code Completion" href="https://github.com/Kronuz/SublimeCodeIntel" target="_blank">Download the repo here </a> and drop it into your packages folder at<code> ~/Library/Applications/Sublime Text 2/Packages</code></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h2>4. Upload with Transmit shortcut</h2>
<p>If you are working on a code n&#8217; upload project you need to be able to edit a file and quickly FTP it up to your server. Since sublime doesn&#8217;t have this built in like Coda does, you&#8217;ll need to use the Transmit FTP client.</p>
<p>First, set up your project folders in transmit.</p>
<p>Next, install <a href="https://github.com/jeffturcotte/sublime_transmit_docksend" target="_blank">Sublime Transmit Docksend</a>, The way this package works is by simulating a docksend (drag and drop a linked local file) to transmit when a key combination is pressed.</p>
<p>Finally, when editing a local file that is linked up in transmit, hit<code>Command + Shift + U</code> and the file will upload. If you are editing /js/scripts.js locally, the file will be uploaded to /js/scripts.js on your server in split second.</p>
<h2>5. Create your own snippets!</h2>
<p>Its a given that you should have already installed <a title="Zen Coding for Sublime Text" href="http://code.google.com/p/zen-coding/" target="_blank">Zen Coding</a>, but there are always snippets that are developer specific that you use on a daily basis. For me, I use<code>j + tab&nbsp;</code> to expand into a jQuery selector <code>$(' ');</code> To setup your own snippets, go to tools->New Snippet. The XML markup is fairly straightforward so I wont go into it. Just plop your code inbetween <code><!--[CDATA[</code--></code> and <code>]]&gt;</code>. You can even set areas to tab through the snippet as well as defaults.</p>
<p>Here a basic snippet using the letter j as the tab trigger. When I tab, the cursor will be place inside the jQuery selector, tab again and I&#8217;m outside the selector ready to call a method on it.</p>
<pre class="brush:xml">&lt;snippet&gt;
	&lt;content&gt;&lt;![CDATA[\$('${1}')${2};]]&gt;&lt;/content&gt;
	&lt;tabTrigger&gt;j&lt;/tabTrigger&gt;
&lt;/snippet&gt;</pre>
<h3>Thats is!</h3>
<p>There is a lot more to Sublime Text 2 and many cool new features such as code folding and Vim support are currently in development. I will go into many more features in coming blog posts. Want to know how to do something? Just ask in the comments below! Be sure to also <a href="http://twitter.com/wesbos">Follow me on Twitter</a>.</p>
<div id="mc_embed_signup2">
<form class="validate" id="mc-embedded-subscribe-form" action="http://wesbos.us1.list-manage.com/subscribe/post?u=b18fd2807ed1a9249c7ea8961&amp;id=20fbc2c1a5" method="post" name="mc-embedded-subscribe-form" novalidate="" target="_blank">
<h4>Let me know when this book launches</h4>
<p>Enter your email address below and I’ll give you a hoot when its ready plus a discount code for being so great!</p>
<p><input class="email" id="mce-EMAIL" type="email" name="EMAIL" placeholder="email address" required="" value="" /><input class="button" id="mc-embedded-subscribe" type="submit" name="subscribe" value="Go!" /></p>
</form>
</div>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/VqIwlG8gbxI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/sublime-text-2-tips/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		<feedburner:origLink>http://wesbos.com/sublime-text-2-tips/</feedburner:origLink></item>
		<item>
		<title>Customizing the WordPress TinyMCE Editor for your clients</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/sAj3kpN5CkA/</link>
		<comments>http://wesbos.com/custom-wordpress-tinymce-wysiwyg-classes/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 03:21:32 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=342</guid>
		<description><![CDATA[We have all been there. You finish up the most beautiful design with perfectly picked colours, font sizes and page style and pass it off to the client. A few days later you check back at the site and they have happily splattered underlined &#8230; <a href="http://wesbos.com/custom-wordpress-tinymce-wysiwyg-classes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>We have all been there. You finish up the most beautiful design with perfectly picked colours, font sizes and page style and pass it off to the client. A few days later you check back at the site and they have happily splattered underlined neon green h1 tags with inline styles. Why why why? Because the WordPress WYSIWYG editor is hard to use and by default it temps you with a basic colour pallet and basic h1-h6 tags.<br />
<span id="more-342"></span><br />
Not to worry! With a few lines of code we can remove the harmful parts of TinyMCE and supply a few useful features! Pop open your theme&#8217;s functions.php file and create a basic function and hook like this:</p>
<pre class="brush:php">function make_mce_awesome( $init ) {
	// our Options will go here..
	return $init;
}

add_filter('tiny_mce_before_init', 'make_mce_awesome');</pre>
<h3>Only allow certain block level elements</h3>
<p>Out of the box WordPress has a bunch of elements which you can use to style your text. Chances are your client doesnt need most of them. Also, they certainly do not need access to h1 and h2 elements as they should be already coded into your theme.</p>
<pre class="brush:php">
$init['theme_advanced_blockformats'] = 'h3,h4,h5,h6,p';
</pre>
<h3>Remove Unnecessary Buttons</h3>
<p>This is totally up to you, but I like to remove the underline as its ugly, the spellchecker as this is now built into most browsers and the WordPress Help button. You can find the names of all the buttons by opening up dev tools and looking at the title attribute of each button.</p>
<pre class="brush:php">
	$init['theme_advanced_disable'] = 'underline,spellchecker,wp_help';
</pre>
<h3>Create a custom Colour Pallet based on the themes colours.</h3>
<p>Changes are the default colours in WordPress arent the same as your theme&#8217;s colours. Feed in a comma separated list of hex colours and you&#8217;re off the the races!</p>
<pre class="brush:php">
	$init['theme_advanced_text_colors'] = '0f3156,636466,0486d3';
</pre>
<h3>Add Custom Classes to mirror your CSS</h3>
<p>When you want to move past your basic heading and paragraph tags, it can be helpful to append custom classes to your elements from within TinyMCE. First you want to enable the style select drop down: </p>
<pre class="brush:php">
	$init['theme_advanced_buttons2_add'] = 'styleselect';
</pre>
<p>Then you can specify a list of labels and associated CSS classes. </p>
<pre class="brush:php">
$init['theme_advanced_styles'] = "bigTitle=bigTitle;Call To Action Button=ctaButton,Rounded Corners=rounded";
</pre>
<p>Our Final function looks like this:</p>
<pre class="brush:php">
function make_mce_awesome( $init ) {
	$init['theme_advanced_blockformats'] = 'h2,h3,h4,p';
	$init['theme_advanced_disable'] = 'underline,spellchecker,wp_help';
	$init['theme_advanced_text_colors'] = '0f3156,636466,0486d3';
	$init['theme_advanced_buttons2_add'] = 'styleselect';
   	$init['theme_advanced_styles'] = "bigTitle=bigTitle;Call To Action Button=ctaButton,Rounded Corners=rounded";
	return $init;
}

add_filter('tiny_mce_before_init', 'make_mce_awesome');
</pre>
<h3>Style the editor on the backend</h3>
<p>Your theme&#8217;s styles should mirror on the backend. You can add in a custom stylesheet for the backend with the following line. This is helpful for getting an accurate idea of what size/colour/alignment your page will have.</p>
<pre class="brush:php">
	add_editor_style('editor-style.css');
</pre>
<p>I found that passing in editor-style.css (which should be found in the root of your theme) busted any cache that add_editor_style() was giving me. </p>
<h3>Have more tips? </h3>
<p>I would love to hear them! Leave them in the comments below and I&#8217;ll update this list as we go along.</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/sAj3kpN5CkA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/custom-wordpress-tinymce-wysiwyg-classes/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		<feedburner:origLink>http://wesbos.com/custom-wordpress-tinymce-wysiwyg-classes/</feedburner:origLink></item>
		<item>
		<title>Realtime HTML5 Canvas Drawing with WebSockets, Node.JS &amp; Socket.io</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/zEB87JWsAMA/</link>
		<comments>http://wesbos.com/html5-canvas-websockets-nodejs/#comments</comments>
		<pubDate>Tue, 16 Aug 2011 03:46:34 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[NodeJS]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=320</guid>
		<description><![CDATA[Web sockets and Canvas are two really cool features that are currently being implemented into browsers. This tutorial will give you a short rundown of how they both work as well as create a realtime drawing canvas that is powered &#8230; <a href="http://wesbos.com/html5-canvas-websockets-nodejs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Web sockets and Canvas are two really cool features that are currently being implemented into browsers. This tutorial will give you a short rundown of how they both work as well as create a realtime drawing canvas that is powered by Node.js and web sockets. For simplicity&#8217;s sake, I&#8217;ll be writing all the code in coffeescript. If you prefer regular &#8216;ol JavaScript, take a look at the corresponding .js files. I&#8217;ve also left out the CSS for the same reason.</p>
<ul>
<li><a href="https://github.com/wesbos/websocket-canvas-draw" target="_blank">Download the code on GitHub</a> </li>
<li><a href="http://twitter.com/wesbos">Follow @wesbos on Twitter</a></li>
</ul>
<h3>Quick Screencast detailing tutorial</h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/n7wQsLu_k00?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h3>Cross Device / Browser compatibility </h3>
<p><span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/oI9AahO9vDY?version=3&#038;rel=1&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;wmode=transparent' frameborder='0'></iframe></span></p>
<h3>Server Side</h3>
<p>The first thing we need to do is create a web socket server. For this we will be using <a href="http://nodejs.org/" target="_blank">Node.js</a> and the module <a href="http://socket.io" target="_blank">Socket.io</a>. Socket.io makes its super easy to get a web socket server up and running. It even provides a flash fallback for browsers that don&#8217;t support native web sockets. In this tutorial we will only be working with browsers that support the canvas element.</p>
<p>If you don&#8217;t have Socket.io installed yet, make sure you do so by typing <code>npm install socket.io</code> into your terminal.</p>
<p>For now, lets just set up the web socket server. Create your <code>server.coffee</code> file with the following configuration. </p>
<pre class="brush:js">
io = require('socket.io').listen(4000)
io.sockets.on 'connection', (socket) ->
</pre>
<p>Compile your coffeescript and hop back into your terminal and type <code>node server.js</code>. You now have a web socket server running on port 4000.<br />
<img src="http://cl.ly/9F2H/Screen_Shot_2011-08-12_at_7.35.45_PM.png" alt="" /></p>
<p>If you go to localhost:4000 you&#8217;ll see the following:</p>
<p><img src="http://cl.ly/9Ez4/Screen_Shot_2011-08-12_at_7.36.08_PM.png" alt="" /></p>
<h3>Client Side</h3>
<p>First, lets quickly get our <code>index.html</code> file up and running. In addition to some bare bones markup, I&#8217;m also including jQuery, our Socket.io JS file which is now being served up from our server, a jQuery plugin for drag events, and our own scripts.js file which will hold all the magic.</p>
<pre class="brush:plain">&lt;!DOCTYPE HTML&gt;
&lt;html&gt;
&lt;head&gt;
	&lt;meta charset="UTF-8"&gt;
	&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="js/jquery.event.drag-2.0.js"&gt;&lt;/script&gt;
	&lt;script src="http://localhost:4000/socket.io/socket.io.js"&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt;
	&lt;link rel="stylesheet" href="style.css" /&gt;

	&lt;title&gt;HTML5 Canvas + Node.JS Socket.io&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
	&lt;article&gt;&lt;!-- our canvas will be inserted here--&gt;&lt;/article&gt;


	&lt;!-- Scripts required --&gt;
	&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="js/jquery.event.drag-2.0.js"&gt;&lt;/script&gt;
	&lt;script src="http://localhost:4000/socket.io/socket.io.js"&gt;&lt;/script&gt;
	&lt;script type="text/javascript" src="scripts.js"&gt;&lt;/script&gt;
&lt;/body&gt;</pre>
<p>Now that we have our server up and running, we can write some code which will draw to the canvas. Create a new file called <code>scripts.coffee</code>.  All of the following code happens within the App.init() method which we will trigger on the jQuery document ready. </p>
<h4>Create our Canvas Element</h4>
<pre class="brush:js">
# setup our application with its own namespace 
App = {}

###
	Init 
###
App.init = -> 
	App.canvas = document.createElement 'canvas' #create the canvas element 
	App.canvas.height = 400
	App.canvas.width = 800  #size it up
	document.getElementsByTagName('article')[0].appendChild(App.canvas) #append it into the DOM 

	App.ctx = App.canvas.getContext("2d") # Store the context 

	# set some preferences for our line drawing.
	App.ctx.fillStyle = "solid" 		
	App.ctx.strokeStyle = "#bada55"		
	App.ctx.lineWidth = 5				
	App.ctx.lineCap = "round"

	# Draw Function
	App.draw = (x,y,type) ->
		if type is "dragstart"
			App.ctx.beginPath()
			App.ctx.moveTo(x,y)
		else if type is "drag"
			App.ctx.lineTo(x,y)
			App.ctx.stroke()
		else
			App.ctx.closePath()
	return
</pre>
<h4>Draw to canvas function</h4>
<p>Since drawing to canvas involves beginning, moving and closing paths, i&#8217;ve create a short little function that hooks into the jQuery dragstart and drag events.</p>
<pre class="brush:js">
# Draw Function
App.draw = (x,y,type) ->
	if type is "dragstart"
		App.ctx.beginPath()
		App.ctx.moveTo(x,y)
	else if type is "drag"
		App.ctx.lineTo(x,y)
		App.ctx.stroke()
	else
		App.ctx.closePath()
return
</pre>
<h4>Setup our client side web socket</h4>
<p>Since we included our file at <code>http://localhost:4000/socket.io/socket.io.js</code> we are able to create an object which we can send our data over. With just a few lines, we create our App.socket object and bind to any incoming web socket events called &#8216;draw&#8217;. We will go over this more soon. </p>
<pre class="brush:js">
# Sockets!
App.socket = io.connect('http://localhost:4000')

App.socket.on 'draw', (data) ->
	App.draw(data.x,data.y,data.type)
</pre>
<h4>Canvas Drawing Event</h4>
<p>This is where things gets exciting. Now we want to bind a few events to our canvas element. The way this works is when someone draws on the canvas, we immediately use our draw() function to draw to the current canvas as well as send the x and y ordinates over the web socket with socket.io&#8217;s <code>emit</code>. In just a bit we will take a look at the server side part of this event and see how the server sends out this data to all open windows.</p>
<pre class="brush:js">
###
	Draw Events
###
$('canvas').live 'drag dragstart dragend', (e) ->
	type = e.handleObj.type
	offset = $(this).offset()
	
	e.offsetX = e.layerX - offset.left
	e.offsetY = e.layerY - offset.top
	x = e.offsetX 
	y = e.offsetY
	App.draw(x,y,type)
	App.socket.emit('drawClick', { x : x, y : y, type : type})
	return
</pre>
<h3>Jump back to server side</h3>
<p>Now that we know we are sending the x, y and type of event over the web socket, we need to do something with that on our server. What we want to do, is take that data and send it back out to everyone else that has a browser open.</p>
<p>Our updated server.coffee file now looks like this. We first wait for a connection event, then wait for a &#8216;drawClick&#8217; event to be sent by a browser. When that happens we take the data and send it out to everyone else with a browser open. THe server side script we wrote earlier will then paint the canvas.</p>
<pre class="brush:js">
io = require('socket.io').listen(4000)

io.sockets.on 'connection', (socket) ->
	socket.on 'drawClick', (data) ->
		socket.broadcast.emit 'draw',{ x : data.x, y : data.y, type: data.type}
		return
	return
</pre>
<p>You&#8217;ll now need to restart your web socket server as we have made changes to it. Hit control-c to kill it, and node type <code>node server.js</code> to restart it.</p>
<h3>Get Drawing!</h3>
<p>One you fully understand how this all works, open your index.html file in any web browser that supports web sockets and canvas (at the time of writing Chrome, Firefox, Safari, Opera and IE9). Check <a href="http://caniuse.com/#search=canvas" target="_blank">http://caniuse.com/#search=canvas</a> for more support info.</p>
<h4>Limitations</h4>
<p>As this is a very basic demo, there are a few limitations which can easily be solved with a little more code. Currently the canvas only supports one person drawing at a time, if two or more are drawing, the canvas will be painted sporadically. Also, there is definitely a lot of room to add tools such as brushes, colours, erasers and PNG export. If there is interest, I&#8217;ll expand this tutorial series to cover them.</p>
<p>If you&#8217;re interested in getting this up and running in the real world and off of your localhost, I was able to get mine running on <a href="http://aws.amazon.com/ec2/" target="_blank">Amazons free micro instance of EC2</a> although this involves installing Node and NPM all over again. Also note you should run your server on port 80 rather than 4000.</p>
<p>Please feel free to download, hack, complain, fork or contribute to the project on <a href="https://github.com/wesbos/websocket-canvas-draw">my github account.</a> </p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/zEB87JWsAMA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/html5-canvas-websockets-nodejs/feed/</wfw:commentRss>
		<slash:comments>41</slash:comments>
		<feedburner:origLink>http://wesbos.com/html5-canvas-websockets-nodejs/</feedburner:origLink></item>
		<item>
		<title>Growl notifications for the Node.js CoffeeScript complier</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/LgIil5iwqDs/</link>
		<comments>http://wesbos.com/growl-notifications-coffeescript-nodejs/#comments</comments>
		<pubDate>Tue, 19 Jul 2011 15:47:53 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[CoffeeScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[NodeJS]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=311</guid>
		<description><![CDATA[Two things I&#8217;ve been working with lately have been Node.js and CoffeeScript. If you haven&#8217;t heard of either, Node.js is server side javascript and CoffeeScript is a ruby/python like langage that compiles down to regular javascript. The way I develop &#8230; <a href="http://wesbos.com/growl-notifications-coffeescript-nodejs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Two things I&#8217;ve been working with lately have been <a href="http://nodejs.org">Node.js</a> and <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a>. If you haven&#8217;t heard of either, Node.js is server side javascript and CoffeeScript is a ruby/python like langage that compiles down to regular javascript.</p>
<p>The way I develop my CoffeeScript is by using the Node.js compiler to watch my `scripts.coffee` for any changes and compile it into normal JavaScript every time I save my file. The process is instant, but I need to watch my terminal window to see if there were any compiling errors. As you can imagine, this can get fairly annoying especially if you aren&#8217;t on dual monitors.</p>
<p>So, my solution was to write a Node.js module that would send a growl notification to the user when the compile was finished. I made use of the <a href="http://growl.info/extras.php#growlnotify">growlnotify</a> command line plugin for OSX.</p>
<p><img src="http://f.cl.ly/items/2t1H2r0i0u3x0k2Z1E2v/Screen%20shot%202011-07-19%20at%201.34.40%20AM.png" alt="" /></p>
<p>To use, you need to first install <a href="http://growl.info/extras.php#growlnotify">growlnotify</a>.</p>
<p>Then use NPM to install the package `npm install coffeescript-growl`</p>
<p>Finally, require (with -r or &#8211;require) the module when you compile your script. I like to use something like this:</p>
<p>`coffee -r coffeescript-growl &#8211;watch &#8211;compile ~/sites/my_project/scripts.coffee`</p>
<p>Thats it! If you have any suggestions or fixes, please<a title="CoffeeScript Growl" href="https://github.com/wesbos/coffeescript-growl" target="_blank"> fork me on github </a> and <a href="https://twitter.com/#!/wesbos">follow me on twitter.</a></p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/LgIil5iwqDs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/growl-notifications-coffeescript-nodejs/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://wesbos.com/growl-notifications-coffeescript-nodejs/</feedburner:origLink></item>
		<item>
		<title>Link within a jQuery Cycle slideshow with the hashchange event</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/5zSVOd5YNeg/</link>
		<comments>http://wesbos.com/jquery-cycle-link-within-hashchange/#comments</comments>
		<pubDate>Tue, 17 May 2011 17:00:14 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[cycle]]></category>
		<category><![CDATA[hashchange]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[slider]]></category>
		<category><![CDATA[slideshow]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=293</guid>
		<description><![CDATA[Two of my favorite jQuery plugins are Mike Alsup&#8217;s Cycle and Ben Alman&#8217;s Hashchange. Cycle allows you to create really flexible sliders /slideshows and Hashchange allows you to create an event that triggers on hash change. When you&#8217;re using jQuery &#8230; <a href="http://wesbos.com/jquery-cycle-link-within-hashchange/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Two of my favorite jQuery plugins are <a href="http://jquery.malsup.com/cycle/">Mike Alsup&#8217;s Cycle</a> and <a href="http://benalman.com/projects/jquery-hashchange-plugin/" target="_blank">Ben Alman&#8217;s Hashchange</a>. Cycle allows you to create really flexible sliders /slideshows and Hashchange allows you to create an event that triggers on hash change. When you&#8217;re using jQuery cycle for a large slideshow, its a good idea to let users link within that slideshow to a specific slide so that they can share and bookmark them.</p>
<p>A great example of this is for a photographer that may have 50 pictures in their portfolio, they often do not let you share the link to that specific picture but rather just the page with the slideshow embedded in it. Additionally, the user can now use the browsers back/forward buttons to navigate through your slideshow<span id="more-293"></span></p>
<p>Not to fear! We can set a hash on the url every time we change the slide and then check for a hash when the page loads, sending them to that specific slide.</p>
<p>The code isn&#8217;t too complex, so if you&#8217;re comfortable with cycle, head on over to <a href="http://wesbos.com/demos/jquery-cycle-link-within/index.html#photo-6" target="_blank">view the demo</a> or download it at the <a href="https://github.com/wesbos/jQuery-Cycle-hashchange-" target="_blank">github repo</a>.</p>
<p><a href="http://wesbos.com/demos/jquery-cycle-link-within/index.html#photo-2" target="_blank"><img class="aligncenter size-full wp-image-301" title="Screen shot 2011-05-17 at 12.55.00 PM" src="http://wesbos.com/wp-content/uploads/2011/05/Screen-shot-2011-05-17-at-12.55.00-PM1.png" alt="" width="603" height="414" /></a></p>
<p><strong>First we start off with some basic markup</strong></p>
<pre class="brush:applescript">	&lt;a href="#" id="prev"&gt;Prev&lt;/a&gt;
	&lt;a href="#" id="next"&gt;Next&lt;/a&gt;

	&lt;div class="slideshow"&gt;
		&lt;img src="http://farm5.static.flickr.com/4029/4646753786_4a219fbbe3_z.jpg" alt="" /&gt;
		&lt;img src="http://farm4.static.flickr.com/3472/3817281628_d5933948db_z.jpg" alt="" /&gt;
		&lt;img src="http://farm1.static.flickr.com/199/476514422_0c1424fb06_z.jpg?zz=1" alt="" /&gt;
		&lt;img src="http://farm2.static.flickr.com/1311/909213290_161035cf47.jpg" alt="" /&gt;
		&lt;img src="http://farm4.static.flickr.com/3088/2688916488_1a125cd0e7_z.jpg" alt="" /&gt;
		&lt;img src="http://farm1.static.flickr.com/215/520495246_22da7d843b.jpg" alt="" /&gt;
		&lt;img src="http://farm4.static.flickr.com/3537/3492378275_fceca7bf0e_z.jpg?zz=1" alt="" /&gt;
	&lt;/div&gt;</pre>
<p><strong>Then be sure to include <a href="http://jquery.com/">jQuery</a>, <a href="http://jquery.malsup.com/cycle/">jQuery Cycle</a> and <a href="http://benalman.com/projects/jquery-hashchange-plugin/">Hashchange</a>.</strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<pre class="brush:js"><strong>&lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt;
&lt;script type="text/javascript" src="plugins.js"&gt;&lt;/script&gt;</strong></pre>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong>Finally, we write a little JavaScript</strong></p>
<p>This can be broken down into three parts:</p>
<p><strong>1. Setup your document </strong><br />
We write a small function that will determin the current slide, so if a user visits <a href="http://wesbos.com/demos/jquery-cycle-link-within/index.html#photo-3" target="_blank">http://wesbos.com/demos/jquery-cycle-link-within/index.html#photo-3</a> we know they want to see photo 3.</p>
<pre class="brush:js">	// get current slide's number
	function currentSlide() {
		var hash = window.location.hash || '#photo-1';
		return parseInt(hash.replace(/[A-Za-z#\-\/!]/g, '') - 1);
	}
	// global vars
	var	cycleSelector = $('.slideshow'),
			startSlide = currentSlide(),
			hasSlid = 0;</pre>
<p><strong>2. Build our jQuery Cycle slideshow </strong><br />
Here we are doing two important things. First we set the browsers hash to the current slide that was either clicked on the thumbnails or using the next/prev buttons. Next we set the variable hasSlid to 1. This is our way of telling the hashchange event not to fire the slide change since we have already done it here. More on this below.</p>
<pre class="brush:js">// append some markup for the controls
	cycleSelector.before('

')
	// start jQuery Cycle
	.cycle({
		 startingSlide: startSlide,
		 // when using the next/prev links
   	 onPrevNextEvent: function(isNext, idx, slide) {
   	 	hasSlid = 1;
   	 	window.location.hash = "photo-"+ (parseInt(idx) + 1) + "";
   	 	return false;
   	 },
   	 // when using the pager thumbnails
   	 onPagerEvent: function(idx, slide) {
   	 	hasSlid = 1;
   	 	window.location.hash = "photo-"+ (parseInt(idx) + 1) + ""; 

   	 	return false;
   	 },
   	 timeout: 0,
   	 pager:  '#nav ul',
   	 next: '#next',
   	 prev: '#prev',
   	 speed: 500,
   	 // build the thumbnails
   	 pagerAnchorBuilder: function(idx, slide) {
       return '
	<li><a href="#photo-'+ (idx+1) +'"><img src="' + slide.src + '" alt="" width="50" height="50" /></a></li>
';
    }
	});</pre>
<p><strong>3. Bind to hashchange </strong><br />
Finally, we need to listen for the hashchange event. This means that the code within this event will execute whenever the hash in the url is changed. So, for example, if a user changes the url from #photo-2 to #photo-4, this event will be fired and change the current slide to slide 4.</p>
<p>Again, we only want to change the slide if our variable hasSlid is set to 0, if its set to 1 we know that either the prev/next controls or the thumbnails have taken care of this.  If a user visits the url from a link or is using their browsers back/next buttons, then we use this to change the slide.</p>
<pre class="brush:js">	// bind to the hashchange event
	$(window).bind('hashchange', function () {
			var slideNo = currentSlide();
			// we only want to fire the slide change if the next button or the pager hasn't done it for us
			if (hasSlid === 0) { cycleSelector.cycle(slideNo); }
			// return it back to zero
			hasSlid = 0;
	}); 

	// when the page loads, we need to trigger a hashchange
	$(window).trigger( "hashchange" );</pre>
<p>And thats it. You&#8217;re now able to link within a jQuery Cycle slideshow, bookmark and share certain slides, and use your browsers back/forward button. Let me know if you have any questions or improvements. Please fork the <a href="https://github.com/wesbos/jQuery-Cycle-hashchange-">github repo</a> and send me a pull request.<br />
<strong>Want more like this? Be sure to <a href="http://twitter.com/wesbos" >Follow me on twitter</a> for the latest <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </strong> </p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/5zSVOd5YNeg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/jquery-cycle-link-within-hashchange/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://wesbos.com/jquery-cycle-link-within-hashchange/</feedburner:origLink></item>
		<item>
		<title>Get All Angry Birds Levels in Chrome HTML5 Version with a quick hack</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/4UwN29Um9c4/</link>
		<comments>http://wesbos.com/all-levels-html5-angry-birds/#comments</comments>
		<pubDate>Wed, 11 May 2011 19:11:07 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=280</guid>
		<description><![CDATA[Just about an hour ago Rovio and Chrome released Angry Birds for Chrome. As a JavaScript / HTML5 guy, I quickly jumped into the code to see how things worked. I was quickly able to find a hack that gave &#8230; <a href="http://wesbos.com/all-levels-html5-angry-birds/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Just about an hour ago Rovio and Chrome released <a href="http://chrome.angrybirds.com/?version=hd" target="_blank">Angry Birds for Chrome</a>. As a JavaScript / HTML5 guy, I quickly jumped into the code to see how things worked.</p>
<p>I was quickly able to find a hack that gave me access to all the levels, even the special Chrome levels!  So to  get access to all levels in Chrome Angry Birds, just copy and paste the following line into your browser&#8217;s address bar.</p>
<p><span id="more-280"></span></p>
<pre class="brush:js">javascript: var i = 0; while (i&lt;=69) { localStorage.setItem('level_star_'+i,'3'); i++; } window.location.reload();</pre>
<p>To set all levels to locked, simply copy and paste this into your address bar:</p>
<pre class="brush:js">javascript: var i = 1; while (i&lt;=69) { localStorage.setItem('level_star_'+i,'-1'); i++; } window.location.reload();</pre>
<h3>How?</h3>
<p>In the talk Rovio did at Google IO, they mentioned they were using HTML5&#8242;s LocalStorage. If you open up Web Inspector in chrome, you&#8217;ll see they are keeping track of your score and stars with localstorage. Lucky for us, that means we can use <a href="https://developer.mozilla.org/en/DOM/Storage#localStorage" target="_blank">setItem(</a>) set all 70 levels to 3 and get access to them all.</p>
<p>If you like this kind of stuff, be sure to <a href="http://twitter.com/wesbos" target="_blank">follow me on twitter</a> for more <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p>&nbsp;</p>
<p><a href="http://wesbos.com/wp-content/uploads/2011/05/Screen-shot-2011-05-11-at-3.08.52-PM.png"><img class="aligncenter size-medium wp-image-283" title="Screen shot 2011-05-11 at 3.09.21 PM" src="http://wesbos.com/wp-content/uploads/2011/05/Screen-shot-2011-05-11-at-3.09.21-PM-300x225.png" alt="" width="300" height="225" /></a><img class="aligncenter size-medium wp-image-282" title="Screen shot 2011-05-11 at 3.08.52 PM" src="http://wesbos.com/wp-content/uploads/2011/05/Screen-shot-2011-05-11-at-3.08.52-PM-300x225.png" alt="" width="300" height="225" /></p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/4UwN29Um9c4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/all-levels-html5-angry-birds/feed/</wfw:commentRss>
		<slash:comments>184</slash:comments>
		<feedburner:origLink>http://wesbos.com/all-levels-html5-angry-birds/</feedburner:origLink></item>
		<item>
		<title>Dropbox your MAMP MySQL Databases</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/mZN8lL1qJGQ/</link>
		<comments>http://wesbos.com/dropbox-your-mamp-mysql-databases/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 18:04:35 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[mamp]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=271</guid>
		<description><![CDATA[I&#8217;m a backup fanatic and not having a few backups of files makes me uneasy. Today I had a little scare where I couldn&#8217;t find a few of my databases when viewing PHPmyAdmin through MAMP. Turns out sometimes MAMP likes &#8230; <a href="http://wesbos.com/dropbox-your-mamp-mysql-databases/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;m a backup fanatic and not having a few backups of files makes me uneasy. Today I had a little scare where I couldn&#8217;t find a few of my databases when viewing PHPmyAdmin through MAMP. Turns out sometimes MAMP likes to sometimes grab the databases from the MAMP Pro location and sometimes the MAMP location.</p>
<p>So, I decided it was time to figure out how to automatically backup my databases. The problem is that my MySQL databases are not in the same folder as my Dropbox folder.</p>
<p>The answer to this is very simple! First, if you haven&#8217;t already, <a target="_blank" href="http://db.tt/87Zmy6yJ">sign up for dropbox</a>. Then we just need to create a simple symlink that will allow the databases to be stored in their location and still be backed up to the DropBox folder.</p>
<p><span id="more-271"></span>First, figure out where MAMP stores your databases. If you are on good old MAMP, they will be located at /Applications/MAMP/db/ and if you are on MAMP Pro, they are located at /Library/Application Support/appsolute/MAMP PRO/db/mysql/</p>
<p>Next, pop open terminal so we can create our symlink. We will be using the link folders command (ln) and the -s argument to specify that its a symbolic link.</p>
<pre class="brush:shell">ln -s  /Applications/MAMP/db/ ~/Dropbox/symlinks/db</pre>
<p>If your dropbox folder is different, make sure to change the last argument. Other than that, you&#8217;re setup. No more database loss nightmares!</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/mZN8lL1qJGQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/dropbox-your-mamp-mysql-databases/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://wesbos.com/dropbox-your-mamp-mysql-databases/</feedburner:origLink></item>
		<item>
		<title>List WordPress Posts by Category</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/Ry1Munn_7zg/</link>
		<comments>http://wesbos.com/wordpress-list-posts-by-category/#comments</comments>
		<pubDate>Tue, 29 Mar 2011 18:21:05 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wordpress]]></category>
		<category><![CDATA[custom templates]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[the_loop]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=259</guid>
		<description><![CDATA[I saw on twitter that John Gardner was looking for a way to loop through his WordPress categories and then display all posts that belonged to that category below it.  I thought it was a great question / problem to &#8230; <a href="http://wesbos.com/wordpress-list-posts-by-category/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I saw on twitter that <a href="http://twitter.com/j_gardner/status/52762151860965376#">John Gardner</a> was looking for a way to loop through his WordPress categories and then display all posts that belonged to that category below it.  I thought it was a great question / problem to solve so I did a quick tutorial on how to do so.</p>
<p><span id="more-259"></span></p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/tiLKGPhUEpM?version=3&#038;rel=0&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p>Make sure to view video in HD <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First thing you need to do is setup a new page with a custom page template. It can be as simple as below but may vary depending on your theme structure. I&#8217;m using the default WordPress 2010 theme.</p>
<pre class="brush:php">&lt;?php
/* template name: Posts by Category! */
get_header(); ?&gt;
		&lt;div id="container"&gt;
			&lt;div id="content" role="main"&gt;
			&lt;/div&gt;&lt;!-- #content --&gt;
		&lt;/div&gt;&lt;!-- #container --&gt;
&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;</pre>
<p>Then We need to get all of our categories into a variable called $cats. Once they are setup, we&#8217;ll just loop through the categories, setup a new WordPress loop for each of them, and echo out the information needed.</p>
<p>Here is the final code, I&#8217;ve commended each line as needed.</p>
<pre class="brush:php">&lt;?php
/* template name: Posts by Category! */
get_header(); ?&gt;

		&lt;div id="container"&gt;
			&lt;div id="content" role="main"&gt;

			&lt;?php
			// get all the categories from the database
			$cats = get_categories(); 

				// loop through the categries
				foreach ($cats as $cat) {
					// setup the cateogory ID
					$cat_id= $cat-&gt;term_id;
					// Make a header for the cateogry
					echo "&lt;h2&gt;".$cat-&gt;name."&lt;/h2&gt;";
					// create a custom wordpress query
					query_posts("cat=$cat_id&amp;post_per_page=100");
					// start the wordpress loop!
					if (have_posts()) : while (have_posts()) : the_post(); ?&gt;

						&lt;?php // create our link now that the post is setup ?&gt;
						&lt;a href="&lt;?php the_permalink();?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;
						&lt;?php echo '&lt;hr/&gt;'; ?&gt;

					&lt;?php endwhile; endif; // done our wordpress loop. Will start again for each category ?&gt;
				&lt;?php } // done the foreach statement ?&gt;

			&lt;/div&gt;&lt;!-- #content --&gt;
		&lt;/div&gt;&lt;!-- #container --&gt;

&lt;?php get_sidebar(); ?&gt;
&lt;?php get_footer(); ?&gt;</pre>
<p>Thats it! You can obviously customize this to your own likings. I suggest you check out and read <a href="http://codex.wordpress.org/The_Loop">The Loop</a> and <a href="http://codex.wordpress.org/Function_Reference/query_posts">query_posts()</a>.</p>
<p>Please leave any questions or commend below!</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/Ry1Munn_7zg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/wordpress-list-posts-by-category/feed/</wfw:commentRss>
		<slash:comments>51</slash:comments>
		<feedburner:origLink>http://wesbos.com/wordpress-list-posts-by-category/</feedburner:origLink></item>
		<item>
		<title>Defeat the New York Times Paywall with 2 lines of CSS (or a Chrome Extension)</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/ylPLf1kmhPQ/</link>
		<comments>http://wesbos.com/remove-new-york-times-paywall-css/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 17:04:19 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[css]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=230</guid>
		<description><![CDATA[If you haven&#8217;t heard, the New York Times has implemented a paywall where you can only view 20 articles a month. After that they throw an overlay on top of the content so you can&#8217;t view it. Since they still &#8230; <a href="http://wesbos.com/remove-new-york-times-paywall-css/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you haven&#8217;t heard, the New York Times has implemented a paywall where you can only view 20 articles a month. After that they throw an overlay on top of the content so you can&#8217;t view it.</p>
<p>Since they still want to be indexed by search engines, they don&#8217;t bother to hide the content once you have reached your 20 max. Two simple lines of CSS will hide this. I&#8217;ve also made it into a <a href="https://chrome.google.com/extensions/detail/medmifohjnpmbkjbodbckhlgofiffgpm">Chrome Extension</a><br />
<span id="more-230"></span></p>
<p><strong>Update: </strong>Just want to be clear that this is not about the NYT business model or getting stuff for free. If you want  to view the NYT, pay for it. This also isn&#8217;t a hack or a security intrusion, its simply hiding a div that is overlaying the content. The same results can be achieved by disabling javascript or selecting &#8220;no style&#8221; in your favorite browser. This is simply a tutorial on how to style the content of a page to your liking.</p>
<p><strong>Update 2: </strong>Looks like New York Times have updated their CSS classes from #gatewayCreative to #gatewayUnit in an effort to thwart cheaters.  I will not be updating the extension as this wasn&#8217;t intended to get around the wall for free but rather to expose how hilarious their pay wall security was. I think that point has been made, feel free to fork this plugin.</p>
<p><strong>Update 3: </strong>Now Google has taken down the extension. Not sure why, may have been for using the NYT logo, may be more serious. Either way, it was fun while it lasted <img src='http://wesbos.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-268" title="Screen shot 2011-03-29 at 2.33.59 PM" src="http://wesbos.com/wp-content/uploads/2011/03/Screen-shot-2011-03-29-at-2.33.59-PM.png" alt="" width="658" height="130" /></p>
<h3><strong>Video</strong></h3>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/qxM-Cu9OLJI?version=3&#038;rel=0&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<h3>Code</h3>
<pre class="brush:css">#overlay, #gatewayCreative { display: none !important; visibility: hidden !important; }
body { 	overflow: scroll !important; }</pre>
<p>Then create a manifest.json file to register the Google Chrome Extension</p>
<pre class="brush:js">{
	"name" : "New York Times Paywall Smasher",
	"version"  : "1.0",
	"description" : "Disables the New York Times Paywall",
	"browser_actions" : {
		"icons" : {
			"128" : "icon128.png",
			"48" : "icon48.png",
			"16" : "icon16.png"
		}
	},
	"content_scripts" : [{
		"matches": ["http://www.nytimes.com/*"],
		"css" : ["nyt.css"]
 	}]
}</pre>
<p>Load the chrome extension into developer view and say goodbye to the paywall (at least until they implement something that isn&#8217;t defeated with display: none). <a href="https://chrome.google.com/extensions/detail/medmifohjnpmbkjbodbckhlgofiffgpm"> Install Chrome Extension.</a></p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/ylPLf1kmhPQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/remove-new-york-times-paywall-css/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		<feedburner:origLink>http://wesbos.com/remove-new-york-times-paywall-css/</feedburner:origLink></item>
		<item>
		<title>Run two versions of Firefox on Mac OSX</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/gb2Y9ZXEHHw/</link>
		<comments>http://wesbos.com/run-two-versions-of-firefox-on-mac-osx/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 06:56:58 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[browsers]]></category>
		<category><![CDATA[firefox]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=222</guid>
		<description><![CDATA[Yesterday Firefox 4.0 was released and web developers everywhere celebrated a really great browser.  The browser comes packed with a super fast JavaScript engine called JägerMonkey. Now don&#8217;t get too excited just yet! We still need to keep that old version of &#8230; <a href="http://wesbos.com/run-two-versions-of-firefox-on-mac-osx/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Yesterday Firefox 4.0 was released and web developers everywhere celebrated a really great browser.  The browser comes packed with a super fast JavaScript engine called JägerMonkey. Now don&#8217;t get too excited just yet! We still need to keep that old version of Firefox around for testing; we can&#8217;t assume everyone has upgraded to Firefox 4. So, to run both Firefox 3.6 and Firefox 4.0 on the same machine, just follow these simple steps:<span id="more-222"></span></p>
<ol>
<li>Open up your Applications folder and find your old version of Firefox</li>
<li>Right click-&gt; get info.</li>
<li>Rename to &#8220;Firefox36.app&#8221;</li>
<li>Download Firefox 4.0 and install as normal</li>
<li>Celebrate that you now have 1 more browser to test in!</li>
</ol>
<p>Really simple! If someone knows how to do this on the Windows and Linux side, I would love to hear how.</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/gb2Y9ZXEHHw" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/run-two-versions-of-firefox-on-mac-osx/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://wesbos.com/run-two-versions-of-firefox-on-mac-osx/</feedburner:origLink></item>
		<item>
		<title>Import Large MySQL Databases into PHPMyAdmin with BigDump.php</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/arFmH6Gq2NY/</link>
		<comments>http://wesbos.com/import-large-mysql-database-bigdump-php/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 18:17:33 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phpmyadmin]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=211</guid>
		<description><![CDATA[When migrating a site that has been around for a while, I often run into the problem where my MySQL Database is just too large to import via the web interface of PHPMyAdmin. Often times its to a server that &#8230; <a href="http://wesbos.com/import-large-mysql-database-bigdump-php/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>When migrating a site that has been around for a while, I often run into the problem where my MySQL Database is just too large to import via the web interface of PHPMyAdmin. Often times its to a server that doesn&#8217;t allow remote access to their databases. What is a poor dev to do?<span id="more-211"></span></p>
<h3>Take a big dump</h3>
<p>Although this script has been around for almost 9 years, its still an essential tool for every developers toolbox. <a href="http://www.ozerov.de/bigdump.php" target="_blank">Big Dump</a> staggers the database import so your server does not timeout. Here is a quick tutorial on how to use Big Dump.</p>
<h3>Video</h3>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/2JEkLMKAUZc?version=3&#038;rel=0&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<h3>Instructions</h3>
<ol>
<li>Download the latest version of Big Dump <a href="http://www.ozerov.de/bigdump.zip" target="_blank">here</a>.</li>
<li>Open up bigdump.php and configure: Server, database name, username, password, and the file name.</li>
<li>Upload both your SQL file and bigdump.php to your server</li>
<li>Browse to bigdump.php and click import</li>
</ol>
<p>Thats it! Wait a few minutes and you will see a confirmation screen similar to the one below. Make sure to delete bigdump.php off your server when you are finished.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-214" title="BigDump PHPmyadmin" src="http://wesbos.com/wp-content/uploads/2011/03/Screen-shot-2011-03-22-at-2.09.25-PM.png" alt="" width="557" height="321" /></p>
<p>&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/arFmH6Gq2NY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/import-large-mysql-database-bigdump-php/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://wesbos.com/import-large-mysql-database-bigdump-php/</feedburner:origLink></item>
		<item>
		<title>Reset a WordPress Admin Password (Video and Guide)</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/XjEDE4su-Ys/</link>
		<comments>http://wesbos.com/reset-a-wordpress-admin-password/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 19:58:17 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=189</guid>
		<description><![CDATA[Had someone ask me today how to reset a password for a user (Admin or other) on a WordPress account. Its acutally very easy to do, so here is a quick guide! 1. Log into your host&#8217;s backend and find &#8230; <a href="http://wesbos.com/reset-a-wordpress-admin-password/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Had someone ask me today how to reset a password for a user (Admin or other) on a WordPress account. Its acutally very easy to do, so here is a quick guide!<span id="more-189"></span></p>
<span class='embed-youtube' style='text-align:center; display: block;'><iframe class='youtube-player' type='text/html' width='640' height='390' src='http://www.youtube.com/embed/39IiTnNhgyY?version=3&#038;rel=0&#038;fs=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;hd=1&#038;wmode=transparent' frameborder='0'></iframe></span>
<p><span style="font-size: 15px; font-weight: bold;">1. Log into your host&#8217;s backend and find the spot to edit your databases</span></p>
<p>If you are unsure of which database is your WordPress install. Open up your FTP client and browse to /wp-config.php. This file will contain your database name as well as the username and password of it.</p>
<p><img class="aligncenter size-full wp-image-191" title="Screen shot 2011-03-21 at 3.38.40 PM" src="http://wesbos.com/wp-content/uploads/2011/03/Screen-shot-2011-03-21-at-3.38.40-PM.png" alt="" width="442" height="149" /></p>
<h3>2.  Login to your database and you will be presented with PHPMyAdmin.</h3>
<p>On the side, you will see a list of  tables. Click the one that says &#8220;wp_users&#8221;. Once that loads, click the &#8220;Browse&#8221; tab.</p>
<h3>3. Edit the specified WordPress User</h3>
<p>You should now see a list of users in your WordPress install. Click the pencil icon to edit the user you wish to reset the password for.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-192" title="Screen shot 2011-03-21 at 3.44.29 PM" src="http://wesbos.com/wp-content/uploads/2011/03/Screen-shot-2011-03-21-at-3.44.29-PM.png" alt="" width="584" height="262" /></p>
<h3>4.  Set the new password</h3>
<p>Finally, delete the data from the &#8220;user_pass&#8221; field, enter in a new password, and select MD5 from the dropdown to the left of it. When done, click go.</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-193" title="Screen shot 2011-03-21 at 3.47.37 PM" src="http://wesbos.com/wp-content/uploads/2011/03/Screen-shot-2011-03-21-at-3.47.37-PM.png" alt="" width="586" height="112" /></p>
<h3>5. You&#8217;re done! Log in as normal with your new password</h3>
<p style="text-align: left;">&nbsp;</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/XjEDE4su-Ys" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/reset-a-wordpress-admin-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://wesbos.com/reset-a-wordpress-admin-password/</feedburner:origLink></item>
		<item>
		<title>Burstn and Google Maps Mashup – Photo Map!</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/5L_PQAtUTt4/</link>
		<comments>http://wesbos.com/burstn-google-maps-photos-mashup/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 18:44:57 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[google]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[Burstn]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[google-maps]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=157</guid>
		<description><![CDATA[Every now and then I like to play with the API of a social networking site. Burstn is an photo sharing website that allows users to quick snap photos and upload them to their website. Lucky for me, their API &#8230; <a href="http://wesbos.com/burstn-google-maps-photos-mashup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Every now and then I like to play with the API of a social networking site. <a href="http://burstn.com">Burstn</a> is an photo sharing website that allows users to quick snap photos and upload them to their website. Lucky for me, their API is fairly wide open, allows to easy calling, and returns a super nice JSON response. My idea is to ping the <a href="http://groups.google.com/group/burstn/web/api-documentation">Burstn API</a> for a timeline of public photos, parse the JSON response, and plot them on a Google Map based on their Lat and Long positions.  Sound fun? Lets go!<span id="more-157"></span></p>
<p><a href="http://wesbos.com/demos/burstn-map">View Demo</a> <a href="http://wesbos.com/demos/burstn-map.zip">Download Files</a></p>
<h3>Setting up</h3>
<p>You&#8217;ll need three files: index.html, wb.js, and style.css. The bulk of our content will go into wb.js as we are loading everything in via JavaScript.Your index.html file should look like this:</p>
<pre class="brush:php">&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;meta http-equiv="content-type" content="text/html; charset=UTF-8" /&gt;
  &lt;title&gt;Google Maps Burstn Mashup&lt;/title&gt;
  &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://maps.google.com/maps/api/js?sensor=false"    type="text/javascript"&gt;&lt;/script&gt;
  &lt;script type="text/javascript" src="wb.js" &gt;&lt;/script&gt;
  &lt;link rel="stylesheet" href="style.css" /&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;div id="map" style="width: 100%; height: 100%; position: absolute;"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;</pre>
<p><span style="font-size: 15px; font-weight: bold;">Getting the data from Burstn API</span></p>
<p>Pulling the data from Burstn couldn&#8217;t be easier. A quick look at their documentation shows that we need to make a GET request to http://api.burstn.com/1/timeline/global. Since we want to load quite a few photos, we are going to set our limit to 400. We also need to append &amp;callback=? to the end of our url so we can get around the &#8220;Origin null is not allowed by Access-Control-Allow-Origin.&#8221; browser security.</p>
<p>Using jQuery&#8217;s AJAX method, we pull in the JSON data as so:</p>
<pre class="brush:js">	$.getJSON('http://api.burstn.com/1/timeline/global?limit=400&amp;callback=?', function(data) {
		console.log(data);
	});</pre>
<p>Now if we take a look at our console. we&#8217;ll see an object that was returned that looks like this:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-176" title="Screen shot 2011-03-21 at 2.23.34 PM" src="http://wesbos.com/wp-content/uploads/2011/03/Screen-shot-2011-03-21-at-2.23.34-PM.png" alt="" width="586" height="317" /></p>
<p>This is all the data we need to start plotting it on our map. Using the Google Maps JavaScript 3.0 API, we will now modify the code above to be able to plot these pictures on a map.</p>
<h3>First, setup your scripts file to populate with a map</h3>
<pre class="brush:js">// check that the document is ready
$(function() {
	// setup a few vars
	var marker, i; 

	// setup our map
	 var map = new google.maps.Map(document.getElementById('map'), {
      zoom: 3,
      center: new google.maps.LatLng(43, 20),
      mapTypeId: google.maps.MapTypeId.ROADMAP
    });

    // setup the info window (the popup bubble that display the info
    var infowindow = new google.maps.InfoWindow();</pre>
<h3>Next, Pull in data from Burstn and plot on mapa</h3>
<p>You&#8217;ll see in this chunk of code that we use jQuery&#8217;s $.each() to loop over each of the results, check for a latitude coordinate, and then plot it on the map.</p>
<pre class="brush:js">	$.getJSON('http://api.burstn.com/1/timeline/global?limit=400&amp;callback=?', function(data) {
		console.log(data);
		$.each(data['body']['data'], function(i,v) {
			// setup some variables
			var coords = data['body']['data'][i]['coordinates'],
				imgsrc = data['body']['data'][i]['image'],
				caption = data['body']['data'][i]['caption'];

				 // setup the image markers
				var image = new google.maps.MarkerImage(imgsrc['square'],
					new google.maps.Size(20, 32),
					new google.maps.Point(0, 32)
				);

				// check if this image has a lat set, if not, we skip it.
				if (coords.latitude) { 

					marker = new google.maps.Marker({
						position: new google.maps.LatLng(coords.latitude, coords.longitude),
						icon : image,
						map: map
					});

					google.maps.event.addListener(marker, 'click', (function(marker, i) {
						return function() {
							infowindow.setContent('&lt;div class="picture"&gt; &lt;span class="title"&gt;'+caption+'&lt;/span&gt;&lt;img src="'+imgsrc['medium']+'" alt="" /&gt;&lt;/div&gt;');
							infowindow.open(map, marker);
						}
					})(marker, i));

				} // end if

			});
	});
});</pre>
<h3>Thats it! Just add some style</h3>
<p>Thats it! Just add a quick dash of style to make things look good and we are off to the races.</p>
<pre class="brush:css">#map {
	overflow: hidden;
}
.picture {
	background: yellow;
	overflow: hidden;
	position: relative;
	}

	.picture span {
		position: absolute;
		width: 100%;
		bottom: 0;
		padding: 4px;
		background: #000;
		color: #fff;
		font-size: 12px;
		font-family: Arial;}

	.picture img {
		height: 400px;}</pre>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/5L_PQAtUTt4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/burstn-google-maps-photos-mashup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://wesbos.com/burstn-google-maps-photos-mashup/</feedburner:origLink></item>
		<item>
		<title>Using jQuery, JSON and Google’s Visualization Geo API Together</title>
		<link>http://feedproxy.google.com/~r/wesbos/ZXAx/~3/qJQT4FDvHnM/</link>
		<comments>http://wesbos.com/jquery-json-google-visualization-api/#comments</comments>
		<pubDate>Thu, 17 Mar 2011 03:44:23 +0000</pubDate>
		<dc:creator>wesbos</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Ajax]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[JSON]]></category>

		<guid isPermaLink="false">http://wesbos.com/?p=147</guid>
		<description><![CDATA[Was helping someone out in the jQuery IRC channel today and they were having some trouble with a JSON api that they were using. To simply put it they wanted to: Load a JSON file via Ajax Parse the results &#8230; <a href="http://wesbos.com/jquery-json-google-visualization-api/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Was helping someone out in the jQuery IRC channel today and they were having some trouble with a JSON api that they were using. To simply put it they wanted to:</p>
<ol>
<li>Load a JSON file via Ajax</li>
<li>Parse the results</li>
<li>Pass it to <a href="http://code.google.com/apis/ajax/playground/?type=visualization#geo_map" target="_blank">Google&#8217;s Visualization</a> into a data table</li>
<li>Create a map based on that data.</li>
</ol>
<p>Now the example given is great, however it doesn&#8217;t jive well when you want to add in a friendly library like jQuery. So here is how we fixed it:<span id="more-147"></span></p>
<h3>The JSON Data in regiontop10.json</h3>
<pre class="brush:js">[
    {
        "DisplayName": "United States",
        "Name": "US",
        "population": 307006550
    },
    {
        "DisplayName": "Canada",
        "Name": "CA",
        "population": 33739900
    },
    {
        "DisplayName": "United Kingdom",
        "Name": "GB",
        "population": 61838154
    },
    {
        "DisplayName": "Mexico",
        "Name": "MX",
        "population": 107431225
    }
]</pre>
<p>Then we just needed load the data from this file and create the map. Comments on how this code works are inline.</p>
<pre class="brush:js">    google.load('visualization', '1', {packages: ['geomap']});

    $(function() {
    		// when document loads, grab the json
			$.getJSON('regiontop10.json', function(data) {
				// once grabbed, we run this callback

				// setup the new map and its variables
				var map = new google.visualization.DataTable();
					map.addRows(data.length);  // length gives us the number of results in our returned data
					map.addColumn('string', 'Country');
	      		map.addColumn('number', 'Population');

				// now we need to build the map data, loop over each result
				$.each(data, function(i,v) {
					// set the values for both the name and the population
					map.setValue(i, 0, v.DisplayName);
					map.setValue(i, 1, v.population);
				});
				// finally, create the map!
				var geomap = new google.visualization.GeoMap(
		          document.getElementById('visualization'));
		     		 geomap.draw(map, null);

			});
   });</pre>
<p>And that is it! <a href="http://wesbos.com/demos/google-geo-map-visualization/">Take a look at the demo</a> and view source for the rest of the HTML markup.</p>
<img src="http://feeds.feedburner.com/~r/wesbos/ZXAx/~4/qJQT4FDvHnM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://wesbos.com/jquery-json-google-visualization-api/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		<feedburner:origLink>http://wesbos.com/jquery-json-google-visualization-api/</feedburner:origLink></item>
	</channel>
</rss>
