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

<channel>
	<title>Think Vitamin &#187; Code</title>
	<atom:link href="http://thinkvitamin.com/category/mobile/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://thinkvitamin.com</link>
	<description>The Web Practitioner&#039;s Blog</description>
	<lastBuildDate>Thu, 09 Feb 2012 16:41:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Rails 3.2.1</title>
		<link>http://thinkvitamin.com/code/ruby-on-rails/rails-3-2-1/</link>
		<comments>http://thinkvitamin.com/code/ruby-on-rails/rails-3-2-1/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 14:00:04 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18410</guid>
		<description><![CDATA[Greetings, folks! If you haven&#8217;t been keeping up with the latest Rails news, we have a new version! Ruby on Rails 3.2.1 has recently been released with some very welcome changes! Faster development mode &#8211; Rails now only reloads the classes you&#8217;ve actually changed between requests in development mode. Explain queries &#8211; In development mode, [...]]]></description>
			<content:encoded><![CDATA[<p>Greetings, folks! If you haven&#8217;t been keeping up with the latest Rails news, we have a new version! Ruby on Rails 3.2.1 has <a href="http://weblog.rubyonrails.org/2012/1/20/rails-3-2-0-faster-dev-mode-routing-explain-queries-tagged-logger-store">recently been released</a> with some very welcome changes!</p>
<p><span id="more-18410"></span></p>
<ul>
<li><strong>Faster development mode</strong> &#8211; Rails now only reloads the classes you&#8217;ve actually changed between requests in development mode.</li>
<li><strong>Explain queries</strong> &#8211; In development mode, you can automatically show the explain of certain queries by calling <code>.explain</code> at the end of your query. The results will go in your log.</li>
<li><strong>Active Record Store</strong> &#8211; Active Record now has a built in way to do key/value storage right from your models. No plug-ins or external gems required!</li>
</ul>
<p>You can also check out the <a href="https://gist.github.com/1648523">change log</a> of all of the fixes and changes, both big and small. Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ruby-on-rails/rails-3-2-1/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Free Video: Getting started with iOS development</title>
		<link>http://thinkvitamin.com/code/ios/free-video-getting-started-with-ios-development/</link>
		<comments>http://thinkvitamin.com/code/ios/free-video-getting-started-with-ios-development/#comments</comments>
		<pubDate>Tue, 07 Feb 2012 15:38:09 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18579</guid>
		<description><![CDATA[In this 6 minute video, we will get you started with iOS development by learning about the benefits of Apple&#8217;s iOS Dev center and how to gain access to the integrated development environment (IDE) called Xcode. This video is from Treehouse, a high-quality video training site with hundreds of short videos on topics like &#8230; Accessibility [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://teamtreehouse.com/library/ios-4-foundations/your-first-app/getting-started/play?cid=193">6 minute video</a>, we will get you started with iOS development by learning about the benefits of Apple&#8217;s iOS Dev center and how to gain access to the integrated development environment (IDE) called Xcode.</p>
<p><a href="http://teamtreehouse.com/library/ios-4-foundations/your-first-app/getting-started/play?cid=193"><img src="http://i.imgur.com/34Rjr.png" /></a></p>
<p>This video is from <a href="http://teamtreehouse.com/?cid=193">Treehouse</a>, a high-quality video training site with hundreds of short videos on topics like &#8230;</p>
<ul>
<li><a href="http://teamtreehouse.com/library/accessibility/?cid=193">Accessibility</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css3?cid=193">CSS3</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/aesthetic-foundations?cid=193">Aesthetic Foundations</a></li>
<li><a href="http://teamtreehouse.com/library/django/?cid=193">Django</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/html/?cid=193">HTML</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css-foundations/?cid=193">CSS</a></li>
<li><a href="http://teamtreehouse.com/library/html5-foundations/?cid=193">HTML5</a></li>
<li><a href="http://teamtreehouse.com/library/ios-4-foundations/?cid=193">iOS Development</a></li>
<li><a href="http://teamtreehouse.com/library/javascript/?cid=193">JavaScript</a></li>
<li><a href="http://teamtreehouse.com/library/jquery/?cid=193">jQuery</a></li>
<li><a href="http://teamtreehouse.com/library/nosql/?cid=193">NoSQL</a></li>
<li><a href="http://teamtreehouse.com/library/php/?cid=193">PHP</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/rwd-foundations/?cid=193">Responsive Web Design</a></li>
<li><a href="http://teamtreehouse.com/library/ruby/?cid=193">Ruby</a></li>
<li><a href="http://teamtreehouse.com/library/ruby-on-rails/?cid=193">Ruby on Rails</a></li>
<li><a href="http://teamtreehouse.com/library/archive/ux-foundations/?cid=193">UX</a></li>
<li><a href="http://teamtreehouse.com/library/version-control?cid=193">Version Control</a></li>
<li><a href="http://teamtreehouse.com/library/wordpress?cid=193">WordPress Theme Design</a></li>
</ul>
<p>New videos are added regularly, so it&#8217;s a great way to stay up-to-date on all the latest technology and methods. Browse the entire <a href="http://teamtreehouse.com/library/?cid=193">library of videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/free-video-getting-started-with-ios-development/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pears: An open source collection of common markup &amp; style</title>
		<link>http://thinkvitamin.com/design/pears-an-open-source-collection-of-common-markup-style/</link>
		<comments>http://thinkvitamin.com/design/pears-an-open-source-collection-of-common-markup-style/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 18:38:20 +0000</pubDate>
		<dc:creator>Allison Grayce</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18536</guid>
		<description><![CDATA[Lo and behold, Mr. Dan Cederholm has done it again! This time the folks over at SimpleBits unveiled their latest project, Pears, an open source WordPress theme that enables you to get your own pattern library up and running quickly. This is super helpful to collect, test and experiment with your collection of semantic HTML [...]]]></description>
			<content:encoded><![CDATA[<p>Lo and behold, Mr. Dan Cederholm has done it again! This time the folks over at <a href="http://simplebits.com/" target="_blank">SimpleBits</a> unveiled their latest project, <a href="http://pea.rs/" target="_blank">Pears</a>, an open source WordPress theme that enables you to get your own pattern library up and running quickly.</p>
<p><img alt="Pears" src="http://i.imgur.com/xvD0Z.jpg" title="Pears" class="alignleft" width="704" height="576" /></p>
<p><span id="more-18536"></span></p>
<p>This is super helpful to collect, test and experiment with your collection of semantic HTML &#038; CSS patterns. For beginners it can be a great way to begin to understand the relationship between markup and style. No matter which audience you fall into, it  is a handy tool for improving speed and productivity.</p>
<p>Also make sure to take notice of the Pears website itself, which is beautifully designed and responsive. </p>
<p>Thanks Dan, for making our lives more enjoyable with <a href="http://www.dribbble.com">Dribbble</a> and easier with <a href="http://www.pea.rs/">Pears</a>. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/pears-an-open-source-collection-of-common-markup-style/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Free Video: Control Flow</title>
		<link>http://thinkvitamin.com/code/ruby/free-video-control-flow/</link>
		<comments>http://thinkvitamin.com/code/ruby/free-video-control-flow/#comments</comments>
		<pubDate>Thu, 02 Feb 2012 14:00:24 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18405</guid>
		<description><![CDATA[In this 4 minute video, you will learn about the concept of control flow in Ruby. This goes in to using if/else statements and case statements This video is from Treehouse, a high-quality video training site with hundreds of short videos on topics like &#8230; Accessibility CSS3 Aesthetic Foundations Django HTML CSS HTML5 iOS Development JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://teamtreehouse.com/library/ruby-foundations/objects-classes-and-variables/control-flow/play?cid=193">4 minute video</a>, you will learn about the concept of control flow in Ruby. This goes in to using if/else statements and case statements</p>
<p><a href="http://teamtreehouse.com/library/ruby-foundations/objects-classes-and-variables/control-flow/play?cid=193"><img src="http://thinkvitamin.com/wp-content/uploads/2012/02/Control-Flow-Treehouse-1.png" width="704" height="397" alt="A screenshot from the Control Flow video demonstrating a case statement." /></a></p>
<p>This video is from <a href="http://teamtreehouse.com/?cid=193">Treehouse</a>, a high-quality video training site with hundreds of short videos on topics like &#8230;</p>
<ul>
<li><a href="http://teamtreehouse.com/library/accessibility/?cid=193">Accessibility</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css3?cid=193">CSS3</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/aesthetic-foundations?cid=193">Aesthetic Foundations</a></li>
<li><a href="http://teamtreehouse.com/library/django/?cid=193">Django</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/html/?cid=193">HTML</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css-foundations/?cid=193">CSS</a></li>
<li><a href="http://teamtreehouse.com/library/html5-foundations/?cid=193">HTML5</a></li>
<li><a href="http://teamtreehouse.com/library/ios-4-foundations/?cid=193">iOS Development</a></li>
<li><a href="http://teamtreehouse.com/library/javascript/?cid=193">JavaScript</a></li>
<li><a href="http://teamtreehouse.com/library/jquery/?cid=193">jQuery</a></li>
<li><a href="http://teamtreehouse.com/library/nosql/?cid=193">NoSQL</a></li>
<li><a href="http://teamtreehouse.com/library/php/?cid=193">PHP</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/rwd-foundations/?cid=193">Responsive Web Design</a></li>
<li><a href="http://teamtreehouse.com/library/ruby/?cid=193">Ruby</a></li>
<li><a href="http://teamtreehouse.com/library/ruby-on-rails/?cid=193">Ruby on Rails</a></li>
<li><a href="http://teamtreehouse.com/library/archive/ux-foundations/?cid=193">UX</a></li>
<li><a href="http://teamtreehouse.com/library/version-control?cid=193">Version Control</a></li>
<li><a href="http://teamtreehouse.com/library/wordpress?cid=193">WordPress Theme Design</a></li>
</ul>
<p>New videos are added regularly, so it&#8217;s a great way to stay up-to-date on all the latest technology and methods. Browse the entire <a href="http://teamtreehouse.com/library/?cid=193">library of videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ruby/free-video-control-flow/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git For Designers (Part 1)</title>
		<link>http://thinkvitamin.com/design/git-for-designers-part-1/</link>
		<comments>http://thinkvitamin.com/design/git-for-designers-part-1/#comments</comments>
		<pubDate>Wed, 01 Feb 2012 20:33:36 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18391</guid>
		<description><![CDATA[Hi designers! I&#8217;m not a designer. Sorry. I&#8217;m a developer. I can barely tell when things look good or not. This week I learned that there are different ampersands out there (thanks, Allison!). But that&#8217;s not why I&#8217;m writing today. We all have to work together. Professionally, one way we do that is by using [...]]]></description>
			<content:encoded><![CDATA[<p>Hi designers! I&#8217;m not a designer. Sorry. I&#8217;m a developer. I can barely tell when things look good or not. This week I learned that there are different ampersands out there (thanks, <a href="http://twitter.com/allisongrayce">Allison</a>!). But that&#8217;s not why I&#8217;m writing today. We all have to work together. Professionally, one way we do that is by using version control. A version control system tracks changes to your code. There are a lot of different version control systems out there. Today we&#8217;ll be talking about git. Specifically, as it relates to designers making web sites.</p>
<p><span id="more-18391"></span></p>
<h2>Why Use Version Control?</h2>
<p>You might be wondering why you should use version control, even for a site you&#8217;ll never collaborate with anyone on. This is a valid question. I can best illustrate the answer with a scenario you may have encountered in the past. Let&#8217;s say you&#8217;re in the middle of making a site and want to try something crazy with the css. Maybe you want to do a bit of an experiment and make everything strange shades of yellow and red. You don&#8217;t know if you&#8217;re going to keep the work when you finish it. Since it&#8217;s an experiment, it would probably be a good idea to not mess up your working version of the site.</p>
<p>At this point, you might be thinking of creating a copy of the site and making your changes on the copy. Maybe you&#8217;re sure that you&#8217;re going to use this work and you&#8217;re going to crank through. Maybe it doesn&#8217;t work out, though. Wouldn&#8217;t it be nice if you could take a snapshot of your site now, do your experiment, and not have to worry about whether you mess things up? That&#8217;s exactly what version control is for!</p>
<h2 id="install">Step 1: Install and Configure Git</h2>
<p>In order to start working with git, though, we need to install it. Git is fairly easy to install. If you&#8217;re using Windows, <a href="http://help.github.com/win-set-up-git/">GitHub</a> has an excellent set up guide to get git installed on Windows. They also have great guides for <a href="http://help.github.com/mac-set-up-git/">Mac OS X</a> and <a href="http://help.github.com/linux-set-up-git/">linux</a>. If you don&#8217;t already have git installed, follow those guides and come on back here.</p>
<p>Once you have git installed, you have to tell it who you are. This is done using the <code>config</code> command. Open Terminal and type in the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> user.name <span style="color: #ff0000;">&quot;Jason Seifer&quot;</span>
$ <span style="color: #c20cb9; font-weight: bold;">git</span> config <span style="color: #660033;">--global</span> user.email <span style="color: #ff0000;">&quot;jason@teamtreehouse.com&quot;</span></pre></div></div>

<h2 id="initialize">Step 2: Initialize a repository</h2>
<p>We&#8217;re going to initialize a git repository now. A repository is just a directory with one or more files we want to track the changes of, in this case our web site. Open up terminal (or command prompt on Windows) and change to the directory containing the site you want to put in to git. You do that with the <code>cd</code> command. I&#8217;m going to put my web site in the <code>Sites/think_vitamin</code> directory.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #7a0874; font-weight: bold;">&#93;</span> $ <span style="color: #7a0874; font-weight: bold;">cd</span> Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin
<span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span> $</pre></div></div>

<p>Once you&#8217;re in there, type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span> $ <span style="color: #c20cb9; font-weight: bold;">git</span> init</pre></div></div>

<p>Assuming you have correctly installed git, you should see the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">  Initialized empty Git repository <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>jason<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #000000; font-weight: bold;">/</span>.git<span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>This is git telling you that thinks are working and that the path it gave you is now a repository. If you don&#8217;t see that output, go back to step 1 and verify that everything was correctly installed.</p>
<h2 id="add">Step 3: Add Your Files</h2>
<p>Now that we have initialized our git repository, we have to tell git what files we want to add to the repository. In order to do this, we use the <code>add</code> command. The <code>add</code> command takes either a single file or a path. The <code>add</code> command takes the changes you&#8217;ve made and adds them to something in git called the staging area. The staging area is kind of like a waiting room for git. It lets you tell git what changes you&#8217;re going to add to the main index.</p>
<p>Since we are already in the directory with our web site, we&#8217;ll tell it to add the path of the current directory:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span> $ <span style="color: #c20cb9; font-weight: bold;">git</span> add .</pre></div></div>

<p>At this point, you won&#8217;t see any output. My example is just an <code>index.html</code> file. In order to see what git is about to stage, you can use the <code>status</code> command:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin master<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> status
&nbsp;
<span style="color: #666666; font-style: italic;"># On branch master</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Initial commit</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;"># Changes to be committed:</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git rm --cached ...&quot; to unstage)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#	new file:   index.html</span>
<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>The first line of the output says &#8220;<code>On branch master</code>&#8220;. In git, a branch is just a pointer to something called a <code>commit</code> (explained in the next section). Since this is our first commit, git lets us know that on the second line of output where it says <code>Initial commit</code>. Next, git says there are changes to be committed. My <code>index.html</code> file is there since it&#8217;s the only thing I have in the directory right now. This is good!</p>
<h2 id="commit">Step 4: Commit Your Changes</h2>
<p>A <code>commit</code> in git is a pointer to a series of changes that you have told git you want to track with the <code>add</code> command. When you commit your changes, git writes them to the index. This is git&#8217;s way of saying &#8220;this is what the repository looked like at this point in time.&#8221; So let&#8217;s commit our changes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Initial commit&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>master <span style="color: #7a0874; font-weight: bold;">&#40;</span>root-commit<span style="color: #7a0874; font-weight: bold;">&#41;</span> 542d5fa<span style="color: #7a0874; font-weight: bold;">&#93;</span> Initial commit
 <span style="color: #000000;">1</span> files changed, <span style="color: #000000;">1</span> insertions<span style="color: #7a0874; font-weight: bold;">&#40;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">0</span> deletions<span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #7a0874; font-weight: bold;">&#41;</span>
 create mode <span style="color: #000000;">100644</span> index.html</pre></div></div>

<p>Here we use the <code>commit</code> command to tell git to commit our changes to the repository. The <code>-m</code> argument told git that we want to give the commit a message. My message here was &#8220;Initial commit&#8221; because this was the first commit to the repository. As you make changes, you can be much more descriptive. This is helpful when working on larger teams. <a href="http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html">Time Pope</a> has a great article on writing good commit messages if you&#8217;d like any pointers.</p>
<p>The important thing about commits is that, once you have committed changes, you can always go back to how your repository was at the point in time of that commit. How cool is that? That means that you&#8217;re now free to make horrible changes to your site. Wnat to see how Comic Sans looks for all the headers? Go for it! You can always go back.</p>
<h2 id="make_changes">Step 5: Make some changes</h2>
<p>Now that things are committed, you can feel free to make some changes to your code. In my example web page, I made changes to the header of the page. Now we can run <code>git status</code> again to see what happened:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> status
<span style="color: #666666; font-style: italic;"># On branch master</span>
<span style="color: #666666; font-style: italic;"># Changes not staged for commit:</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git add ...&quot; to update what will be committed)</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git checkout -- ...&quot; to discard changes in working directory)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#	modified:   index.html</span>
<span style="color: #666666; font-style: italic;">#</span>
no changes added to commit <span style="color: #7a0874; font-weight: bold;">&#40;</span>use <span style="color: #ff0000;">&quot;git add&quot;</span> and<span style="color: #000000; font-weight: bold;">/</span>or <span style="color: #ff0000;">&quot;git commit -a&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Now we&#8217;ll add the file we just changed:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> add index.html
1.9.3 <span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> status
<span style="color: #666666; font-style: italic;"># On branch master</span>
<span style="color: #666666; font-style: italic;"># Changes to be committed:</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git reset HEAD ...&quot; to unstage)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#	modified:   index.html</span>
<span style="color: #666666; font-style: italic;">#</span></pre></div></div>

<p>Finally, we&#8217;ll commit the change:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Modify home page header&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>master bc8251b<span style="color: #7a0874; font-weight: bold;">&#93;</span> Modify home page header
 <span style="color: #000000;">1</span> files changed, <span style="color: #000000;">1</span> insertions<span style="color: #7a0874; font-weight: bold;">&#40;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">1</span> deletions<span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Great! We just made our first two commits. Our co-workers will love us for writing a descriptive message along with the second commit, too, although they might also still be mad for taking the last cup of coffee.</p>
<h2 id="make_a_branch">Step 6: Make a branch</h2>
<p>Remember earlier when we were talking about making experimental changes that you may want to keep? That&#8217; what branches are for! Branches let you easily separate your work. You can have two branches going at the same time with different work. Branches are great for experimentation with something that you&#8217;re not sure you&#8217;re going to keep.</p>
<p>Let&#8217;s say we wanted to change the font on all headers to Comic Sans. You&#8217;re not sure how this is going to look (bad) but your client really wants you to give it a try anyway. Let&#8217;s create a branch to do that just in case we want to switch back. In git terms, we call this process creating a branch. We do that by checking out the branch and passing a flag to git saying that we want to create it:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> checkout <span style="color: #660033;">-b</span> comic_sans
Switched to a new branch <span style="color: #ff0000;">'comic_sans'</span></pre></div></div>

<p>Now that we&#8217;re on our <code>comic_sans</code> branch, we are free to make changes and commit them. This won&#8217;t affect anything on our <code>master</code> branch until later. Let&#8217;s make our changes:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> status
<span style="color: #666666; font-style: italic;"># On branch comic_sans</span>
<span style="color: #666666; font-style: italic;"># Changes not staged for commit:</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git add ...&quot; to update what will be committed)</span>
<span style="color: #666666; font-style: italic;">#   (use &quot;git checkout -- ...&quot; to discard changes in working directory)</span>
<span style="color: #666666; font-style: italic;">#</span>
<span style="color: #666666; font-style: italic;">#	modified:   index.html</span>
<span style="color: #666666; font-style: italic;">#</span>
no changes added to commit <span style="color: #7a0874; font-weight: bold;">&#40;</span>use <span style="color: #ff0000;">&quot;git add&quot;</span> and<span style="color: #000000; font-weight: bold;">/</span>or <span style="color: #ff0000;">&quot;git commit -a&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Git also let&#8217;s us see what changed in between what we&#8217;re about to stage with the <code>diff</code> command:</p>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;"><span style="">&#91;</span>~/Sites/think_vitamin<span style="">&#93;</span>$ git diff
diff --git a/index.html b/index.html
index 159202e..<span style="color: #440088;">266d025</span> <span style="">100644</span>
<span style="color: #888822;">--- a/index.html</span>
<span style="color: #888822;">+++ b/index.html</span>
<span style="color: #440088;">@@ -1 +1 @@</span>
<span style="color: #991111;">-</span></pre></div></div>

<h1>Hello world</h1>

<div class="wp_syntax"><div class="code"><pre class="diff" style="font-family:monospace;"><span style="color: #00b000;">+</span></pre></div></div>

<h1 style="font-face: Comic Sans;">Hello world</h1>
<p>We can also add and commit the change with one command by using the <code>-a</code> flag when committing:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> commit <span style="color: #660033;">-am</span> <span style="color: #ff0000;">&quot;Make header font comic sans&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#91;</span>comic_sans 94af8b2<span style="color: #7a0874; font-weight: bold;">&#93;</span> Make header font comic sans
 <span style="color: #000000;">1</span> files changed, <span style="color: #000000;">1</span> insertions<span style="color: #7a0874; font-weight: bold;">&#40;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">1</span> deletions<span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Now we&#8217;ve committed to the <code>comic_sans</code> branch. Sweet!</p>
<h2>Step 7: Merge your changes</h2>
<p>Our client is now happy with the header changes. Our experimental branch we created now needs the changes to make their way back in to our main branch. We do this through a process called <em>merging</em>. What we want to do is <code>merge</code> or changes from the <code>comic_sans</code> branch back in to the <code>master</code> branch. First, we have to go to the branch we want to merge to. We do that by checking out. This time, we won&#8217;t use the <code>-b</code> parameter since we&#8217;re not creating the branch:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> checkout master
Switched to branch <span style="color: #ff0000;">'master'</span></pre></div></div>

<p>Now we use the <code>merge</code> command to get our changes from the <code>comic_sans</code> branch in to <code>master</code>:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> merge comic_sans
Updating bc8251b..94af8b2
Fast-forward
 index.html <span style="color: #000000; font-weight: bold;">|</span>    <span style="color: #000000;">2</span> +-
 <span style="color: #000000;">1</span> files changed, <span style="color: #000000;">1</span> insertions<span style="color: #7a0874; font-weight: bold;">&#40;</span>+<span style="color: #7a0874; font-weight: bold;">&#41;</span>, <span style="color: #000000;">1</span> deletions<span style="color: #7a0874; font-weight: bold;">&#40;</span>-<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>Boom! Now we have all of our changes in to git. If we want to see what these changes were, we can use th <code>log</code> command to get a nice display of times, dates, and authors:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">&#91;</span>~<span style="color: #000000; font-weight: bold;">/</span>Sites<span style="color: #000000; font-weight: bold;">/</span>think_vitamin<span style="color: #7a0874; font-weight: bold;">&#93;</span>$ <span style="color: #c20cb9; font-weight: bold;">git</span> log
commit 94af8b2e976ba11755f7483bc761ea2b9a747e0a
Author: Jason Seifer 
Date:   Wed Feb <span style="color: #000000;">1</span> <span style="color: #000000;">15</span>:07:<span style="color: #000000;">45</span> <span style="color: #000000;">2012</span> <span style="color: #660033;">-0500</span>
&nbsp;
    Make header font comic sans
&nbsp;
commit bc8251b338b8ac4451888e1da482708df6264529
Author: Jason Seifer 
Date:   Wed Feb <span style="color: #000000;">1</span> <span style="color: #000000;">10</span>:<span style="color: #000000;">16</span>:<span style="color: #000000;">41</span> <span style="color: #000000;">2012</span> <span style="color: #660033;">-0500</span>
&nbsp;
    Modify home page header
&nbsp;
commit 542d5fab4c86d29a125a78b8a89366f70bdfaa9d
Author: Jason Seifer 
Date:   Wed Feb <span style="color: #000000;">1</span> <span style="color: #000000;">10</span>:<span style="color: #000000;">10</span>:01 <span style="color: #000000;">2012</span> <span style="color: #660033;">-0500</span>
&nbsp;
    Initial commit</pre></div></div>

<h2>Well Done!</h2>
<p>In this article we learned how to install git, create a repository, change branches, and commit changes to our code. In the next article in this series, we&#8217;ll learn about removing files, going back to different commits, and pushing up to <a href="http://github.com">GitHub</a> and working with other people. Stay tuned!</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/git-for-designers-part-1/feed/</wfw:commentRss>
		<slash:comments>23</slash:comments>
		</item>
		<item>
		<title>Styling Images with CSS3</title>
		<link>http://thinkvitamin.com/design/styling-images-with-css3/</link>
		<comments>http://thinkvitamin.com/design/styling-images-with-css3/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 23:36:54 +0000</pubDate>
		<dc:creator>Mat Helme</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[User Interface]]></category>
		<category><![CDATA[responsive layout]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18373</guid>
		<description><![CDATA[Nick La over at Web Designer Wall put together a great article on how to style images with CSS3. The styles include: Basic Style(rounded corners), Embossed Style, Soft Embossed Style, Cutout Style and Glossy Overlay. I personally love the Embossed Style, it&#8217;s ideal for interface buttons. Originally Nick ran into some issues when styling for [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://twitter.com/#!/nickla">Nick La</a> over at <a href="http://www.webdesignerwall.com">Web Designer Wall</a> put together a great article on how to style images with CSS3. The styles include: Basic Style(rounded corners), Embossed Style, Soft Embossed Style, Cutout Style and Glossy Overlay.  I personally love the Embossed Style, it&#8217;s ideal for interface buttons. Originally Nick ran into some issues when styling for a responsive layout. He quickly fixed them with an alternate solution. Check out the <a href="http://webdesignerwall.com/tutorials/css3-image-styles-part-2">article</a> to see his solution.  Great job Nick, we appreciate the tips and tricks!</p>
<p><a href="http://webdesignerwall.com/tutorials/css3-image-styles-part-2">View the Tutorial</a><br />
<a href="http://webdesignerwall.com/demo/css3-image-styles-part-2/">Demo Page</a></p>
<p><img alt="" src="http://i.imgur.com/7UdVG.jpg" title="Web Designer Wall" class="alignnone" width="704" height="311" /></p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/styling-images-with-css3/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Is there a Photoshop grid for responsive web design?</title>
		<link>http://thinkvitamin.com/design/is-there-a-photoshop-grid-for-responsive-web-design/</link>
		<comments>http://thinkvitamin.com/design/is-there-a-photoshop-grid-for-responsive-web-design/#comments</comments>
		<pubDate>Mon, 30 Jan 2012 22:09:51 +0000</pubDate>
		<dc:creator>Kevin Dees</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18333</guid>
		<description><![CDATA[I love responsive web design. It just gets me like no one else can. Now responsive web design gets Photoshop too. A recent post by Elliot Jays Stocks sheds light on the topic and includes a great template for designing your next PSD. You can find the download link on his website or view the [...]]]></description>
			<content:encoded><![CDATA[<p>I love responsive web design. It just gets me like no one else can. Now responsive web design gets Photoshop too. A <a href="http://elliotjaystocks.com/blog/a-better-photoshop-grid-for-responsive-web-design/">recent post by Elliot Jays Stocks</a> sheds light on the topic and includes a great template for designing your next PSD. You can find the <a href="http://static.elliotjaystocks.com/responsive-grid/psd/ejs_1000px_responsive_grid.psd.zip">download link on his website</a> or view the <a href="http://static.elliotjaystocks.com/responsive-grid/html-demo/">simply view the demo</a> if you are impatient like me.</p>
<p><span id="more-18333"></span></p>
<p><img src="http://i.imgur.com/e1zAT.jpg" alt="Grid Demo" /></p>
<p>You can <a href="http://elliotjaystocks.com/blog/">read all about Elliot&#8217;s ideas</a> on his website. He explain everything is great detail. If you read his post you will find it hard to disagree. Fixed designs are becoming harder and harder to justify.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/is-there-a-photoshop-grid-for-responsive-web-design/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free Video: iOS Tab bar (UITabBarController)</title>
		<link>http://thinkvitamin.com/code/ios/free-video-ios-tab-bar-uitabbarcontroller/</link>
		<comments>http://thinkvitamin.com/code/ios/free-video-ios-tab-bar-uitabbarcontroller/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 20:55:58 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18347</guid>
		<description><![CDATA[In this 7 minute video, you will learn the basics of the UITabBarController and how to create one using the Xcode project template. This video is from Treehouse, a high-quality video training site with hundreds of short videos on topics like &#8230; Accessibility CSS3 Aesthetic Foundations Django HTML CSS HTML5 iOS Development JavaScript jQuery NoSQL PHP [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://teamtreehouse.com/library/ios-4-foundations/tab-bar-/basics/play?cid=193">7 minute video</a>,  you will learn the basics of the UITabBarController and how to create one using the Xcode project template.</p>
<p><a href="http://teamtreehouse.com/library/ios-4-foundations/tab-bar-/basics/play?cid=193"><img src="http://i.imgur.com/t2A5f.jpg" /></a></p>
<p>This video is from <a href="http://teamtreehouse.com/?cid=193">Treehouse</a>, a high-quality video training site with hundreds of short videos on topics like &#8230;</p>
<ul>
<li><a href="http://teamtreehouse.com/library/accessibility/?cid=193">Accessibility</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css3?cid=193">CSS3</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/aesthetic-foundations?cid=193">Aesthetic Foundations</a></li>
<li><a href="http://teamtreehouse.com/library/django/?cid=193">Django</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/html/?cid=193">HTML</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css-foundations/?cid=193">CSS</a></li>
<li><a href="http://teamtreehouse.com/library/html5-foundations/?cid=193">HTML5</a></li>
<li><a href="http://teamtreehouse.com/library/ios-4-foundations/?cid=193">iOS Development</a></li>
<li><a href="http://teamtreehouse.com/library/javascript/?cid=193">JavaScript</a></li>
<li><a href="http://teamtreehouse.com/library/jquery/?cid=193">jQuery</a></li>
<li><a href="http://teamtreehouse.com/library/nosql/?cid=193">NoSQL</a></li>
<li><a href="http://teamtreehouse.com/library/php/?cid=193">PHP</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/rwd-foundations/?cid=193">Responsive Web Design</a></li>
<li><a href="http://teamtreehouse.com/library/ruby/?cid=193">Ruby</a></li>
<li><a href="http://teamtreehouse.com/library/ruby-on-rails/?cid=193">Ruby on Rails</a></li>
<li><a href="http://teamtreehouse.com/library/archive/ux-foundations/?cid=193">UX</a></li>
<li><a href="http://teamtreehouse.com/library/version-control?cid=193">Version Control</a></li>
<li><a href="http://teamtreehouse.com/library/wordpress?cid=193">WordPress Theme Design</a></li>
</ul>
<p>New videos are added regularly, so it&#8217;s a great way to stay up-to-date on all the latest technology and methods. Browse the entire <a href="http://teamtreehouse.com/library/?cid=193">library of videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/free-video-ios-tab-bar-uitabbarcontroller/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A New Year, A New Responsive Dribbble Portfolio &#8211; Part 1 of 2</title>
		<link>http://thinkvitamin.com/design/a-new-year-a-new-responsive-dribbble-portfolio-part-1-of-2/</link>
		<comments>http://thinkvitamin.com/design/a-new-year-a-new-responsive-dribbble-portfolio-part-1-of-2/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 14:00:18 +0000</pubDate>
		<dc:creator>Mat Helme</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18138</guid>
		<description><![CDATA[What better way to start off the new year than a fresh new Dribbble portfolio?  If you are a designer with minimal coding experience and want to display your Dribbble work in all browser sizes, you have come to the right place.  We will be creating a HTML5 one page portfolio which pulls your Dribbble [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://i.imgur.com/6HWPQ.png"><img src="http://i.imgur.com/bvVj8.jpg" alt="Dribbble Portfolio" /></a></p>
<p>What better way to start off the new year than a fresh new Dribbble portfolio?  If you are a designer with minimal coding experience and want to display your Dribbble work in all browser sizes, you have come to the right place.  We will be creating a HTML5 one page portfolio which pulls your Dribbble information and is responsive in all browsers.  This little project will be presented in two parts.</p>
<p><span id="more-18138"></span></p>
<hr />
<h3>Part 1 (this post):</h3>
<p>HTML/CSS/jQuery set up.</p>
<h3>Part 2 (coming soon):</h3>
<p>Convert HTML to PHP and use the Dribbble API to pull your data. Plus IE fixes.</p>
<hr />
<h2>The File Structure</h2>
<p>Let’s dig right in and start off with our file structure.  On your desktop create a folder labeled: ‘Dribble-Portfolio’.  In that folder create the following files:</p>
<ul>
<li>folder labeled ‘css’</li>
<ul>
<li>style.css</li>
</ul>
<li>folder labeled ‘images’</li>
<ul>
<li><a href="http://i.imgur.com/IGjNu.png">logo.png</a></li>
<li><a href="http://i.imgur.com/CaQ1q.png">connet.jpg</a></li>
<li><a href="http://i.imgur.com/gp22J.jpg">me.png</a></li>
<li><a href="http://i.imgur.com/C5Sdi.jpg">sample.jpg</a></li>
</ul>
<li>index.html</li>
<li>folder labeled ‘scripts’</li>
<ul>
<li><a href="http://www.etuwa.com/scripts/jquery.js">jquery.js</a></li>
<li><a href="http://www.etuwa.com/scripts/fitText.js">fitText.js</a></li>
</ul>
</ul>
<p>It should look a little something like this:</p>
<p><img src="http://i.imgur.com/U0OPl.jpg" alt="Dribbble Portfolio" /></p>
<p><em>*to download the .js and image files simply select the links above and save them to the appropriate file structure.</em></p>
<h2>The HTML</h2>
<p>Now that we have all of our assets and files lets begin with the HTML. Below is the proper code for your ‘index.html’ file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;!</span>DOCTYPE html<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;!--</span>Viewport<span style="color: #339933;">--&gt;</span>
	<span style="color: #339933;">&lt;</span>meta name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;viewport&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width=device-width; initial-scale=1; maximum-scale=1&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Dribbble Portfolio<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;!--</span>Google fonts<span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>link href<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://fonts.googleapis.com/css?family=Open+Sans'</span> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">'stylesheet'</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/css'</span><span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>link href<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://fonts.googleapis.com/css?family=Raleway:100'</span> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">'stylesheet'</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/css'</span><span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;!--</span>Main Stylesheet<span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;css/style.css&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>body<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>header<span style="color: #339933;">&gt;</span>
&nbsp;
  	<span style="color: #339933;">&lt;</span>h1 id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;logo&quot;</span><span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/logo.png&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;My Logo&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h1<span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;</span>nav<span style="color: #339933;">&gt;</span>
&nbsp;
    	<span style="color: #339933;">&lt;</span>ul <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;menu&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;email&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;dribbble&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;twitter&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;facebook&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkd&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
&nbsp;
      <span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;/</span>nav<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;/</span>header<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> header<span style="color: #339933;">--&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>section <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;half&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
      <span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/me.jpg&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;main-image&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;This is Me&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;/</span>section<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> main image<span style="color: #339933;">--&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>section <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;half&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
  	<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tagline&quot;</span><span style="color: #339933;">&gt;</span>Check Out My Super Radical One Page Responsive Portfolio Which Pulls My Dribble <span style="color: #0000ff;">'Shots'</span><span style="color: #339933;">.</span> Get Gnarly<span style="color: #339933;">!&lt;/</span>h2<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;/</span>section<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> tagline<span style="color: #339933;">--&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;clear&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>section<span style="color: #339933;">&gt;</span>
&nbsp;
			<span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Latest Work<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
			<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;container&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
			<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;/</span>section<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> dribble content<span style="color: #339933;">--&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;clear&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>footer<span style="color: #339933;">&gt;</span>All RIghts Reserved <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>www<span style="color: #339933;">.</span>website<span style="color: #339933;">.</span>com<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>footer<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> footer<span style="color: #339933;">--&gt;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #339933;">&lt;/</span>body<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>html<span style="color: #339933;">&gt;</span></pre></div></div>

<p>As you can see the code is fairly simple. We have a basic HTML5 markup with some ‘viewport’ settings at the top. The ‘viewport’ settings tell devices such as iPhones to display at the devices width and scale.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;!</span>DOCTYPE html<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>html<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>head<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;!--</span>Viewport<span style="color: #339933;">--&gt;</span>
	<span style="color: #339933;">&lt;</span>meta name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;viewport&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;width=device-width; initial-scale=1; maximum-scale=1&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>meta http<span style="color: #339933;">-</span>equiv<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Content-Type&quot;</span> content<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/html; charset=UTF-8&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;</span>title<span style="color: #339933;">&gt;</span>Dribbble Portfolio<span style="color: #339933;">&lt;/</span>title<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Also the &#8216;head&#8217; is reaching out and grabbing some Google font stylesheets as well as our ‘style.css’ file in our ‘css’ folder. We will get to this file in our next step.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
  <span style="color: #339933;">&lt;!--</span>Google fonts<span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>link href<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://fonts.googleapis.com/css?family=Open+Sans'</span> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">'stylesheet'</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/css'</span><span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;</span>link href<span style="color: #339933;">=</span><span style="color: #0000ff;">'http://fonts.googleapis.com/css?family=Raleway:100'</span> rel<span style="color: #339933;">=</span><span style="color: #0000ff;">'stylesheet'</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">'text/css'</span><span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;!--</span>Main Stylesheet<span style="color: #339933;">--&gt;</span>
  <span style="color: #339933;">&lt;</span>link rel<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;stylesheet&quot;</span> type<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;text/css&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;css/style.css&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;/</span>head<span style="color: #339933;">&gt;</span></pre></div></div>

<p>As we get into the body of the file we have four main sections(header, section(half), section(dribbble) and footer).</p>
<p>The header contains two elements. Element one is the logo, feel free to change it. It’s located in the images folder, labeled ‘logo.png’(200x80px). Element two is our social network icons which we won’t see until we add the css styles. For now we are going to link to hash tags. In part two of this tutorial we will be pulling in the correct data via Dribbble.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>header<span style="color: #339933;">&gt;</span>
&nbsp;
  	<span style="color: #339933;">&lt;</span>h1 id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;logo&quot;</span><span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/logo.png&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;My Logo&quot;</span> <span style="color: #339933;">/&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>h1<span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;</span>nav<span style="color: #339933;">&gt;</span>
&nbsp;
    	<span style="color: #339933;">&lt;</span>ul <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;menu&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;email&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;dribbble&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;twitter&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;facebook&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
        <span style="color: #339933;">&lt;</span>li<span style="color: #339933;">&gt;&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;linkd&quot;</span><span style="color: #339933;">&gt;&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>li<span style="color: #339933;">&gt;</span>
&nbsp;
      <span style="color: #339933;">&lt;/</span>ul<span style="color: #339933;">&gt;</span>
&nbsp;
    <span style="color: #339933;">&lt;/</span>nav<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;/</span>header<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> header<span style="color: #339933;">--&gt;</span></pre></div></div>

<p>The next section, section(half) contains our ‘me.jpg’ image and our tagline which are located directly below the header. Feel free to swap out the image(me.jpg) and tagline copy to better personalize your portfolio. The image currently being pulled in is 800x600px as it is scalable to the screen size.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #339933;">&lt;</span>section <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;half&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
      <span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/me.jpg&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;main-image&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;This is Me&quot;</span> <span style="color: #339933;">/&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;/</span>section<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> main image<span style="color: #339933;">--&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>section <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;half&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
  	<span style="color: #339933;">&lt;</span>h2 <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;tagline&quot;</span><span style="color: #339933;">&gt;</span>Check Out My Super Radical One Page Responsive Portfolio Which Pulls My Dribble <span style="color: #0000ff;">'Shots'</span><span style="color: #339933;">.</span> Get Gnarly<span style="color: #339933;">!&lt;/</span>h2<span style="color: #339933;">&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;/</span>section<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> tagline<span style="color: #339933;">--&gt;</span>
&nbsp;
  <span style="color: #339933;">&lt;</span>div <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;clear&quot;</span><span style="color: #339933;">&gt;&lt;/</span>div<span style="color: #339933;">&gt;</span></pre></div></div>

<p>Our next section is section(dribble) which is going to pull our most recent Dribbble ‘shot’ titles and ‘shot’ images. For now we are going to use dummy content. In part two we will be running a loop to pull the latest projects with the all mighty power of php. You will also be able to choose how many projects you would like to display. For now we are going show twelve ‘shot’ examples.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>section<span style="color: #339933;">&gt;</span>
&nbsp;
			<span style="color: #339933;">&lt;</span>h1<span style="color: #339933;">&gt;</span>Latest Work<span style="color: #339933;">&lt;/</span>h1<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
			<span style="color: #339933;">&lt;</span>div id<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;container&quot;</span><span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
          <span style="color: #339933;">&lt;</span>a <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;box&quot;</span> href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>h3<span style="color: #339933;">&gt;</span>Title of the Work<span style="color: #339933;">&lt;/</span>h3<span style="color: #339933;">&gt;</span>
            	<span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;images/sample.jpg&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;Work Title&quot;</span> <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;pic&quot;</span><span style="color: #339933;">/&gt;</span>
          <span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span>
&nbsp;
&nbsp;
			<span style="color: #339933;">&lt;/</span>div<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;/</span>section<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> dribble content<span style="color: #339933;">--&gt;</span></pre></div></div>

<p>The last section is the footer area. This is for any links or Copy Right text you wish to display or link out to.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>footer<span style="color: #339933;">&gt;</span>All RIghts Reserved <span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;#&quot;</span><span style="color: #339933;">&gt;</span>www<span style="color: #339933;">.</span>website<span style="color: #339933;">.</span>com<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;&lt;/</span>footer<span style="color: #339933;">&gt;</span>
  <span style="color: #339933;">&lt;!--</span><span style="color: #990000;">end</span> footer<span style="color: #339933;">--&gt;</span></pre></div></div>

<h2>The CSS</h2>
<p>Now that we have inserted all of our HTML data, let’s add our styles to the page. Simply copy the CSS code below and input it into the style.css file. Here is the CSS code:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* DRIBBBLE PORTFOLIO SITE - 2012 */</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*RESET*/</span>
html<span style="color: #00AA00;">,</span>body<span style="color: #00AA00;">,</span>div<span style="color: #00AA00;">,</span>span<span style="color: #00AA00;">,</span>applet<span style="color: #00AA00;">,</span>object<span style="color: #00AA00;">,</span>iframe<span style="color: #00AA00;">,</span><span style="color: #cc00cc;">#logo</span><span style="color: #00AA00;">,</span>h2<span style="color: #00AA00;">,</span>h3<span style="color: #00AA00;">,</span>h4<span style="color: #00AA00;">,</span>h5<span style="color: #00AA00;">,</span>h6<span style="color: #00AA00;">,</span>p<span style="color: #00AA00;">,</span>blockquote<span style="color: #00AA00;">,</span>pre<span style="color: #00AA00;">,</span>a<span style="color: #00AA00;">,</span>abbr<span style="color: #00AA00;">,</span>acronym<span style="color: #00AA00;">,</span>address<span style="color: #00AA00;">,</span>big<span style="color: #00AA00;">,</span>cite<span style="color: #00AA00;">,</span>code<span style="color: #00AA00;">,</span>del<span style="color: #00AA00;">,</span>dfn<span style="color: #00AA00;">,</span>em<span style="color: #00AA00;">,</span>img<span style="color: #00AA00;">,</span>ins<span style="color: #00AA00;">,</span>kbd<span style="color: #00AA00;">,</span>q<span style="color: #00AA00;">,</span>s<span style="color: #00AA00;">,</span>samp<span style="color: #00AA00;">,</span>small<span style="color: #00AA00;">,</span>strike<span style="color: #00AA00;">,</span>strong<span style="color: #00AA00;">,</span>sub<span style="color: #00AA00;">,</span>sup<span style="color: #00AA00;">,</span>tt<span style="color: #00AA00;">,</span>var<span style="color: #00AA00;">,</span>b<span style="color: #00AA00;">,</span>u<span style="color: #00AA00;">,</span>i<span style="color: #00AA00;">,</span><span style="color: #993333;">center</span><span style="color: #00AA00;">,</span>dl<span style="color: #00AA00;">,</span>dt<span style="color: #00AA00;">,</span>dd<span style="color: #00AA00;">,</span>ol<span style="color: #00AA00;">,</span>ul<span style="color: #00AA00;">,</span>li<span style="color: #00AA00;">,</span>fieldset<span style="color: #00AA00;">,</span>form<span style="color: #00AA00;">,</span>label<span style="color: #00AA00;">,</span>legend<span style="color: #00AA00;">,</span>table<span style="color: #00AA00;">,</span>caption<span style="color: #00AA00;">,</span>tbody<span style="color: #00AA00;">,</span>tfoot<span style="color: #00AA00;">,</span>thead<span style="color: #00AA00;">,</span>tr<span style="color: #00AA00;">,</span>th<span style="color: #00AA00;">,</span>td<span style="color: #00AA00;">,</span>article<span style="color: #00AA00;">,</span>aside<span style="color: #00AA00;">,</span>canvas<span style="color: #00AA00;">,</span>details<span style="color: #00AA00;">,</span><span style="color: #993333;">embed</span><span style="color: #00AA00;">,</span>figure<span style="color: #00AA00;">,</span>figcaption<span style="color: #00AA00;">,</span>footer<span style="color: #00AA00;">,</span>header<span style="color: #00AA00;">,</span>hgroup<span style="color: #00AA00;">,</span>menu<span style="color: #00AA00;">,</span>nav<span style="color: #00AA00;">,</span>output<span style="color: #00AA00;">,</span>ruby<span style="color: #00AA00;">,</span>section<span style="color: #00AA00;">,</span>summary<span style="color: #00AA00;">,</span>time<span style="color: #00AA00;">,</span>mark<span style="color: #00AA00;">,</span>audio<span style="color: #00AA00;">,</span>video<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">outline</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>border<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>font-family<span style="color: #00AA00;">:</span><span style="color: #993333;">inherit</span><span style="color: #00AA00;">;</span>font-<span style="color: #000000; font-weight: bold;">size</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span>margin<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>padding<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span>vertical-align<span style="color: #00AA00;">:</span><span style="color: #993333;">baseline</span><span style="color: #00AA00;">&#125;</span>article<span style="color: #00AA00;">,</span>aside<span style="color: #00AA00;">,</span>details<span style="color: #00AA00;">,</span>figcaption<span style="color: #00AA00;">,</span>figure<span style="color: #00AA00;">,</span>footer<span style="color: #00AA00;">,</span>header<span style="color: #00AA00;">,</span>hgroup<span style="color: #00AA00;">,</span>menu<span style="color: #00AA00;">,</span>nav<span style="color: #00AA00;">,</span>section<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">&#125;</span>body<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">&#125;</span>ol<span style="color: #00AA00;">,</span>ul<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">&#125;</span>blockquote<span style="color: #00AA00;">,</span>q<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">quotes</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">&#125;</span>blockquote<span style="color: #3333ff;">:before</span><span style="color: #00AA00;">,</span>blockquote<span style="color: #3333ff;">:after</span><span style="color: #00AA00;">,</span>q<span style="color: #3333ff;">:before</span><span style="color: #00AA00;">,</span>q<span style="color: #3333ff;">:after</span><span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">content</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">&#125;</span>table<span style="color: #00AA00;">&#123;</span><span style="color: #000000; font-weight: bold;">border-collapse</span><span style="color: #00AA00;">:</span><span style="color: #993333;">collapse</span><span style="color: #00AA00;">;</span>border-spacing<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*MAIN*/</span>
body <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#dce877</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #993333;">auto</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #933;">5%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Open </span>Sans<span style="color: #00AA00;">,</span> Arial<span style="color: #00AA00;">,</span> Helvetica<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">90%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">13px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">21px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#616634</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
header<span style="color: #00AA00;">,</span> footer <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
section <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
ul <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#616634</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> -webkit-transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> -moz-transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#111</span><span style="color: #00AA00;">;</span> opacity<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
h1<span style="color: #00AA00;">,</span> h2<span style="color: #00AA00;">,</span> h3 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
h1 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
h2 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
h3 <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">14px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">40px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
p <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.full</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">96%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.half</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">46%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">2%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
.<span style="color: #000000; font-weight: bold;">clear</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*HEADER*/</span>
header <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">position</span><span style="color: #00AA00;">:</span><span style="color: #993333;">relative</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#bcc664</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #cc00cc;">#logo</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> -webkit-transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> -moz-transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
	<span style="color: #808080; font-style: italic;">/*CONNECT*/</span>
	nav <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">right</span><span style="color: #00AA00;">;</span> transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> -webkit-transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> -moz-transition<span style="color: #3333ff;">:all </span>linear .5s<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.menu</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">list-style</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">15px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.menu</span> li <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">inline</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.menu</span> li a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">32px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">31px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000; font-style: italic;">../images/connect.png</span><span style="color: #00AA00;">&#41;</span> <span style="color: #993333;">no-repeat</span><span style="color: #00AA00;">;</span> opacity<span style="color: #00AA00;">:</span>.5<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #933;">30px</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.menu</span> li a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span> opacity<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.dribbble</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.linkd</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #933;">-38px</span> <span style="color: #cc66cc;">0</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.twitter</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #933;">-78px</span> <span style="color: #cc66cc;">0</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.facebook</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #933;">-118px</span> <span style="color: #cc66cc;">0</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.email</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span><span style="color: #933;">-158px</span> <span style="color: #cc66cc;">0</span> !important<span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*SECTION(HALF)*/</span>
<span style="color: #6666ff;">.main-image</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.tagline</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span><span style="color: #933;">140%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#616634</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>Raleway<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">normal</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*SECTION(DRIBBBLE)*/</span>
<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span> -moz-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">4</span><span style="color: #00AA00;">;</span> column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">4</span><span style="color: #00AA00;">;</span> -webkit-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">4</span><span style="color: #00AA00;">;</span> -webkit-column-gap<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> -moz-column-gap<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> column-gap<span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.box</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#BCC664</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">5%</span><span style="color: #00AA00;">;</span> opacity<span style="color: #00AA00;">:</span>.75<span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">display</span><span style="color: #00AA00;">:</span>inline-<span style="color: #993333;">block</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">border-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#616634</span><span style="color: #00AA00;">;</span> border-radius<span style="color: #00AA00;">:</span><span style="color: #933;">2px</span> <span style="color: #933;">2px</span> <span style="color: #933;">10px</span> <span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">90%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.pic</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">100%</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">clear</span><span style="color: #00AA00;">:</span><span style="color: #993333;">both</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">/*FOOTER*/</span>
footer <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#bcc664</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span> <span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">12px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #808080; font-style: italic;">/*MEDIA QUERIES*/</span>
<span style="color: #a1a100;">@media screen and (max-width:960px ) {</span>
&nbsp;
	<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span> -moz-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">3</span><span style="color: #00AA00;">;</span> column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">3</span><span style="color: #00AA00;">;</span> -webkit-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">3</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #a1a100;">@media screen and (max-width: 768px) {</span>
&nbsp;
	<span style="color: #6666ff;">.half</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">95%</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.menu</span> li a <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">1px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span> -moz-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span> -webkit-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span> column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">2</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>	
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #a1a100;">@media screen and (max-width: 479px) {</span>
&nbsp;
	<span style="color: #cc00cc;">#logo</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">48px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	nav <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #cc66cc;">0</span> <span style="color: #933;">50px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #6666ff;">.menu</span> <span style="color: #00AA00;">&#123;</span> <span style="color: #000000; font-weight: bold;">margin</span><span style="color: #00AA00;">:</span><span style="color: #cc66cc;">0</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
	<span style="color: #cc00cc;">#container</span> <span style="color: #00AA00;">&#123;</span> -moz-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> -webkit-column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> column-count<span style="color: #00AA00;">:</span><span style="color: #cc66cc;">1</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>After we save our ‘style.css’ file and refresh our browser, we have a very clean portfolio layout that responds well to the browser size.</p>
<p>When you view the stylesheet css code you will see ‘%’ used a lot on the width attributes. The page is styled with a responsive fluid layout in mind. If you have any questions about responsive web sites, please check out ‘<a href="http://teamtreehouse.com/library/design-foundations/rwd-foundations">Responsive Web Design Foundations</a>’ over at Treehouse.</p>
<p>As of now we have a fully functional static HTML5 page which has been tested in the latest versions of Firefox, Chrome and Safari. Because we are using HTML5 and CSS3 capabilities we will not be testing in IE at the moment. Once we finish up part 2 of the tutorial we will set up separate IE files to compensate for it’s lack of functionality with HTML5 and CSS3.</p>
<h2>The JavaScript</h2>
<p>Lastly we are going to add a little javascript to our page allowing our ‘tagline’ text to scale with browser size. Insert this snippet of code directly below the footer.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #339933;">&lt;!--</span>js files<span style="color: #339933;">--&gt;</span>
	<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scripts/jquery.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
	<span style="color: #339933;">&lt;</span>script src<span style="color: #339933;">=</span><span style="color: #3366CC;">&quot;scripts/fitText.js&quot;</span><span style="color: #339933;">&gt;&lt;/</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
	<span style="color: #339933;">&lt;!--</span>initiate fit text<span style="color: #339933;">--&gt;</span>
	<span style="color: #339933;">&lt;</span>script<span style="color: #339933;">&gt;</span>
&nbsp;
  	 $<span style="color: #009900;">&#40;</span>document<span style="color: #009900;">&#41;</span>.<span style="color: #660066;">ready</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
  		 <span style="color: #009966; font-style: italic;">/*FitText*/</span>
  		 $<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;.tagline&quot;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">fitText</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">1.1</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span> minFontSize<span style="color: #339933;">:</span> <span style="color: #3366CC;">'20px'</span><span style="color: #339933;">,</span> maxFontSize<span style="color: #339933;">:</span> <span style="color: #3366CC;">'200px'</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  	 <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #339933;">&lt;/</span>script<span style="color: #339933;">&gt;</span></pre></div></div>

<p>This snippet simply links up to our ‘jquery’ and ‘fitText’ files we set in our scripts folder earlier. Then it initiates the ‘fitText’ function and gives it some variables. Feel free to change the max-font-size and min-font-size as your ‘tagline’ will be different.</p>
<h2>Wrapping Up</h2>
<p>Now lets review what we have just done.</p>
<ul>
<li>We have set up our HTML</li>
<li>Added our CSS styles</li>
<li>Inserted a little javascript</li>
</ul>
<p>Congratulations you have successfully set up a static responsive one page portfolio.</p>
<hr />
<p><a href="http://thinkvitamin.s3.amazonaws.com/dribbble-api/part-1/Dribble-Portfolio.zip">Source Files</a><br />
<a href="http://thinkvitamin.s3.amazonaws.com/dribbble-api/part-1/Dribble-Portfolio/index.html" target="_blank">Demo Site</a></p>
<hr />
<h3>Still to Come(Part 2)</h3>
<p>In the final portion of this tutorial we will be using <a href="http://dribbble.com/api">Dribbble API</a> to load in our user data and ‘shots’, as well as IE 8 and up fixes. In the meantime if you would like to know more about HTML5 and CSS3 please check out <a href="http://teamtreehouse.com/">Treehouse</a>, or contact me at mat@teamtreehouse.com. As always, Get Gnarly and Design your Life!</p>
<p>Role Those Credits:</p>
<ul>
<li><a href="http://dribbble.com/">Dribbble</a></li>
<li><a href="http://jquery.com/">jQuery</a></li>
<li><a href="http://fittextjs.com/">Fit Text</a></li>
<li><a href="http://teamtreehouse.com/">Treehouse</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/a-new-year-a-new-responsive-dribbble-portfolio-part-1-of-2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Scrolling Made Fun</title>
		<link>http://thinkvitamin.com/design/scrolling-made-fun/</link>
		<comments>http://thinkvitamin.com/design/scrolling-made-fun/#comments</comments>
		<pubDate>Wed, 25 Jan 2012 20:00:31 +0000</pubDate>
		<dc:creator>Mat Helme</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS3]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Typography]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18304</guid>
		<description><![CDATA[Just when you thought scrolling your web page was getting boring. Scrollorama has stepped the scroll game up with this remarkable jQuery Plugin. Scrollorama allows you to manipulate text when you scroll the page. You can do everything from Transitions to Zoom to Parallax. Check out the Scrollorama site to view some great examples and [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://johnpolacek.github.com/scrollorama/"><img src="http://i.imgur.com/Ff5DF.jpg" alt="Scrollorama" /></a></p>
<p>Just when you thought scrolling your web page was getting boring. <a href="http://johnpolacek.github.com/scrollorama/">Scrollorama</a> has stepped the scroll game up with this remarkable jQuery Plugin. <a href="http://johnpolacek.github.com/scrollorama/">Scrollorama</a> allows you to manipulate text when you scroll the page. You can do everything from Transitions to Zoom to Parallax. Check out the <a href="http://johnpolacek.github.com/scrollorama/">Scrollorama</a> site to view some great examples and the plugin&#8217;s documentation.</p>
<p>This Plugin is great for landing pages and highly interactive web applications. Like CSS3 transitions, use your animations sparingly.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/scrolling-made-fun/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The separation of structure, presentation and behavior is dead</title>
		<link>http://thinkvitamin.com/design/the-separation-of-structure-presentation-and-behavior-is-dead/</link>
		<comments>http://thinkvitamin.com/design/the-separation-of-structure-presentation-and-behavior-is-dead/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 14:00:23 +0000</pubDate>
		<dc:creator>Kevin Dees</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Design]]></category>
		<category><![CDATA[Web Industry]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18132</guid>
		<description><![CDATA[The separation of structure, presentation and behavior is dead. It has been dead for a while. Still, this golden rule of web design sticks around. It lives on like Elvis and we need to address it. I remember the weight of separation vividly. I remember writing custom JavaScript to replace the &#60;a&#62; tag&#8217;s target attribute [...]]]></description>
			<content:encoded><![CDATA[<p>The separation of structure, presentation and behavior is dead. It has been dead for a while. Still, this golden rule of web design sticks around. It lives on like Elvis and we need to address it.</p>
<p><span id="more-18132"></span></p>
<p>I remember the weight of separation vividly. I remember writing custom JavaScript to replace the &lt;a&gt; tag&#8217;s target attribute because it added behavior to HTML. I remember dropping the &lt;font&gt; tag from my arsenal of tools, something I don’t regret.</p>
<p>In principle, the rule of separation was good. It helped us explain the best practice and implementation of HTML, CSS and JavaScript. It spun the web toward a brighter future. Separation vanquished the &lt;font&gt; tags, spacer gifs and inline JavaScript that polluted the web for years. In the old web structure, presentation and behavior lived in one layer but the principle of separation divided them.</p>
<p><img src="http://i.imgur.com/8i6MJ.jpg" alt="The old web" /></p>
<h2>The Path</h2>
<p>The principle of separation lead web standards into victory during the first browser wars. Separation did not do this by eliminating proprietary standards, but by defining the &#8220;path&#8221; for new standards like CSS and XHTML. Through this victory browser makers work together now, for the most part. Browsers prefix proprietary CSS and push together for new technologies such as HTML5.</p>
<p>However, separation was an old idea that lived hand in hand with XHTML 2. The idea was that structure, presentation and behavior should be at all times pure. Separation like XHTML 2 has seen its day. Just look at the current state of our specifications. The proof is in the pudding.</p>
<h2>The Truth</h2>
<p>CSS now has behavior with features like :hover and animations. CSS has structure as well with the pseudo elements ::before and ::after. HTML has the same issues. Its new &lt;input&gt; types have behavior and presentation littered throughout. What the web currently looks like vs what separation wants the web to be is not the same.</p>
<p><img src="http://i.imgur.com/p2MR6.jpg" alt="The way the web really looks" /></p>
<p>The specification says separation is dead and the browser makers agree. Last year at SXSW during the browser wars panel I asked the panelists for their thoughts. I asked them what was to keep the &lt;font&gt; tag from coming back and why separation was not being addressed. Brendan Eich answered quickly and simply, “We don’t care about separation.”</p>
<p>He is right to say this. Separation has played its roll. But if he is right and we live in a new age, why do we we still teach separation? Why do we still pretend to follow it? I have a few assumptions.</p>
<h2>Why Separation is Still Around</h2>
<p>First, it worked at a basic level. It let us know when we were getting into gray areas. Second, the principle was simple and easy to understand. Each technology has its place, HTML, CSS and JavaScript.</p>
<p>So then, what should we do? Ignore all reason and do whatever we like? No, of course not. We need to be honest with ourselves and understand the raising pattern: Divergence.</p>
<p>We have been using Divergence for years. With every site you include :hover in your CSS. With the &#8220;email&#8221; value you use as your &lt;input&gt; tag&#8217;s type. With the many jQuery plug-ins that add new structure and presentation to a site. You use Divergence.</p>
<h2>Divergence</h2>
<p>What is Divergence? Divergence is the process you take when any of the three layers of separation cross. Let&#8217;s think about what we know the web is like today.</p>
<p><img src="http://i.imgur.com/bk3Me.jpg" alt="Divergence" /></p>
<p>As an example let&#8217;s examine a scenario where presentation and behavior cross, such as when you need a design change as the cursor moves over a link. You need to pick CSS or JavaScript.</p>
<p><img src="http://i.imgur.com/IJBLP.jpg" alt="An example" /></p>
<p>JavaScript has the mouseover event handler and CSS has :hover. However, you want to add a presentational effect, a nice underline maybe.</p>
<p>During the crossover of the two layers we are forced to choose CSS or JavaScript. You could choose CSS because you want to change the link&#8217;s style, but you could also choose JavaScript because the change is triggered by a behavior.</p>
<p>Unlike separation where you are trapped, Divergence says this is fine. In Divergence the lines can cross.</p>
<p>Think of Separation and Divergence as totally different logical approaches.</p>
<p>With Separation you live in a true and false world. Everything is black and white. It is on or off. It is Boolean by nature. With Divergence there&#8217;s black and white, but there&#8217;s also gray.</p>
<h2>Truth is Conditional</h2>
<p>The first rule of Divergence is that truth is conditional. Presentation can be behavioral and vice versa. We can use CSS a presentational technology with behavior as in the case of :hover.</p>
<p>However, Divergence does one thing that keeps it from creating a world where anything goes. To understand that concept we need to look at the &lt;font&gt; tag and understand how divergence keeps us from using &lt;font&gt; just as the principle of separation does.</p>
<p>Under the &#8220;conditional truth&#8221; rule of Divergence the &lt;font&gt; tag is fine. It is presentational and structural. However, with the second rule of Divergence there is an issue. This is the rule of &#8220;wholeness&#8221;.</p>
<h2>Wholeness</h2>
<p>The &lt;font&gt; tag is in HTML so it is a structure. However, it is not semantic and so while it is a structure it is not structural. The rule of divergence says that an item who falls into conditional truth is fine. It can be both structural and presentational at the same time. The &lt;font&gt; tag is.</p>
<p>However, the &lt;font&gt; tag must now pass the second rule. This rule, wholeness, says that the item must by nature be compliant wholly&#8230; to at least one of its parts. This does not negate the first rule. It only approves the item has the properties of the layer in which it lives.</p>
<p>Wholeness works like this:</p>
<ul>
<li>An item who is in structure must have the properties structure. In other words HTML must be semantic.</li>
<li>An item who is in presentation must have the properties presentation. In other words CSS must effect presentation.</li>
<li>An item who is in behavior must have the properties behavior. In other words JavaScript must effect behavior.</li>
</ul>
<p>Divergence says that items can have multiple properties but can only operate from a layer if it belongs to it in wholeness. This means that the item itself must have the properties of the layer it lives in and can demonstrate the properties of another layer if it likes.</p>
<h2>Where &lt;font&gt; Fails</h2>
<p>The &lt;font&gt; tag meets the conditional truth of Divergence but is not fully structural. It demonstrates the properties of presentation in that you can set “font properties” with it. But, it can not belong to structure because its structural property is not structural. This is because the tag name is purely presentational &#8211; “font”. This means that it doesn’t belong fully to at least one of its parts.</p>
<p>Therefore it can not diverge to one side or the other. HTML or CSS. So, we can not use the &lt;font&gt; tag under Divergence.</p>
<p>The principle of Divergence is simple and complex. It apples to all layers of web design.</p>
<h2>Some Examples</h2>
<p>As a quick example we can say that the HTML5 email value of the &lt;input&gt; tag’s type is fine under Divergence. It is semantic and behavioral but complies wholly to at lest one of its parts HTML.</p>
<p>Simply using the pseudo elements ::before and ::after to create content as structure and not presentation is not divergent because it is not fully presentational. Not to mention inaccessible.</p>
<p>It is unfortunate that the world of web design is not black and white and fortunate at the same time because it moves us forward.</p>
<h2>To Round it Up</h2>
<p>We are standing in a new age. We need to stop saying separation and doing divergence. In the end we can pretend that the principle of separation is still relevant but it doesn’t support the current direction of the web. It doesn’t help standards and browser makers don’t care.</p>
<p>Most importantly we need practical principles to guide us. So we know when to say yes or no to new features in CSS and HTML so that we can keep one eye on the vendors and the other on the web&#8217;s future. We need to accept the fact that separation of structure, presentation and behavior is dead.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/the-separation-of-structure-presentation-and-behavior-is-dead/feed/</wfw:commentRss>
		<slash:comments>30</slash:comments>
		</item>
		<item>
		<title>HTML5 Please &#8211; Which Features Can You Use?</title>
		<link>http://thinkvitamin.com/code/html5/html5-please-which-features-can-you-use/</link>
		<comments>http://thinkvitamin.com/code/html5/html5-please-which-features-can-you-use/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 22:06:56 +0000</pubDate>
		<dc:creator>Jim Hoskins</dc:creator>
				<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18170</guid>
		<description><![CDATA[HTML5 Please is a great resource for determining browser support for many HTML5 and CSS3 Features. Each feature offers a recommendation to either use, not use, use with caution, or use with a fallback. It offers great information like the browser share for each feature, as well as the fallbacks you can use to simulate [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://html5please.us/">HTML5 Please</a> is a great resource for determining browser support for many HTML5 and CSS3 Features. Each feature offers a recommendation to either use, not use, use with caution, or use with a fallback. It offers great information like the browser share for each feature, as well as the fallbacks you can use to simulate the feature in incompatible browsers.</p>
<p>My favorite feature is the search, which allows you to filter features by compatibility, for instance <a href="http://html5please.us/#gtie7">what is safe to use in IE8+</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/html5/html5-please-which-features-can-you-use/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How We Built Code Racer in 4 Days</title>
		<link>http://thinkvitamin.com/code/how-we-built-code-racer-in-4-days/</link>
		<comments>http://thinkvitamin.com/code/how-we-built-code-racer-in-4-days/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 20:35:16 +0000</pubDate>
		<dc:creator>Jim Hoskins</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18076</guid>
		<description><![CDATA[If you haven&#8217;t seen Code Racer, you should give it a try. Code Racer is the product of Idea Week at Treehouse. Idea Week is a tradition brought over from Carsonified to Treehouse where the entire team drops what they are doing to work on a completely new project for one week. This is my [...]]]></description>
			<content:encoded><![CDATA[<p>If you haven&#8217;t seen <a href="http://coderace.me/" title="Code Racer">Code Racer</a>, you should give it a try. Code Racer is the product of Idea Week at Treehouse. <a href="http://thinkvitamin.com/uncategorized/idea-week-building-a-product-in-one-week/">Idea Week</a> is a tradition brought over from Carsonified to Treehouse where the entire team drops what they are doing to work on a completely new project for one week.</p>
<p>This is my recounting of the Idea Week when we created Code Racer. This won&#8217;t be a full story as a lot of people worked on this project and I wasn&#8217;t in a position to keep track of what everyone was doing. Fortunately our video professionals at Treehouse had cameras rolling, so much of this is documented on video. I can only tell you about what I was involved in, which was the server and client side development.</p>
<p><span id="more-18076"></span></p>
<p>I had been involved with one Idea Week before, when we created <a href="http://brickify.com/">Brickify</a>. This actually wasn&#8217;t an official Idea Week, it was a project we decided to build late on a Tuesday, but then became an Idea (half) Week.</p>
<p>We decided to do an Idea Week when Ryan told us he would be gathering the whole team together in Orlando this January. Since we had recently hired several new teachers and video pros, and Idea Week was a great way to get everybody working together as a team.</p>
<p><object width="704" height="396"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=34988070&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=34988070&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="704" height="396"></embed></object>
<p><a href="http://vimeo.com/34988070">Treehouse CodeRacer Launch Video</a> from <a href="http://vimeo.com/teamtreehouse">Treehouse</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>The idea for what we were going to build wasn&#8217;t decided until the Monday morning of our Idea Week. In the time leading up to the project, we figured our product would likely be a Ruby on Rails application with a great UI, design, API, and hopefully an iOS app. This seemed ideal because Alan and Jason work with Rails every day, and I have several years of experience with Rails as well. I was thinking Alan and Jason would lead the server side development, and I would focus on front-end interaction. It didn&#8217;t quite end up working out like that.</p>
<p>When Ryan presented his idea of creating a real-time code-challenge game, it became clear that our assumptions of responsibility were pretty far off. Since we needed to use Web Sockets (or their available fallbacks), <a href="http://nodejs.org/">Node.js</a> became the clear decision for the Code Racer server. This changed the dynamic of the team a bit since I&#8217;m the resident Node.js guy, as well as the front-end JavaScript guy. Fortunately Alan, Jason, and Amit have experience with Node.js and JavaScript, so they were able to kick ass on Code Racer.</p>
<p>Besides not knowing the project idea until Idea Week begins, there is another challenge: a hard deadline. One week seems reasonable for a project that has 5 developers and 4 designers. That&#8217;s 5 days, right? Well, Treehouse works the <a href="http://thinkvitamin.com/fully-carsonified/work-less/">four day work week</a>, so it&#8217;s really 4. Also, Alan, Ryan, and Tyson had to fly out mid-day Thursday, so we had to launch Thursday morning. So Idea Week is really a little over 3 days. Better get started! </p>
<h2 id="tech_decisions">Tech Decisions</h2>
<p>The first thing we did was discuss tech. Because the game required near real-time interaction between the players we chose <a href="http://socket.io/">Socket.io</a>, which is a great server and client library for working with web sockets. This is what allows us to communicate quickly between the players and the server.</p>
<p>Socket.io is built on Node.js, which made Node.js the natural choice for our server. The event based architecture  allows us to hold many socket connections open concurrently on one server.</p>
<p>As a group we also decided to use <a href="http://jashkenas.github.com/coffee-script/">CoffeeScript</a> for our server and client code. I found it to be very useful when I worked on Code Challenges for <a href="http://teamtreehouse.com/">Treehouse</a>, and Alan and Jason were interested in trying it out on a non-trivial project. It ended up working really well.</p>
<p>For the front-end, we chose to use <a href="http://spinejs.com/">Spine</a> for our application library with <a href="http://jquery.com/">jQuery</a> powering our DOM interactions. There is a lot of information shooting around that needs to be reflected in the UI. Events from the user like typing inside the code editor, and events from the server like information about the game state all need to be handled so the models and views can be updated. Spine&#8217;s models, views, and controllers handled the interaction extremely well. Information from the server is received via socket.io, which will update our models. The various controllers on our page listen for changes to the model and update the views as needed.</p>
<p>We also utilized Facebook for authentication and MySQL for storing our users and game logs. I can&#8217;t talk much about those decisions because Jason lead that effort.</p>
<h2 id="day_one_planning_and_server">Day One &#8211; Planning and Server</h2>
<p>On Monday morning, after our first meeting, the whole team swung into action. The designers and developers split up to talk about their plans and responsibilities. This is where we the developers began making the tech decisions that I described above. </p>
<p>While we were doing that, the design team was coming up with UI sketches as quickly as possible, so our whole team was on the same page. These sketches were extremely valuable to the dev team, because we needed to start building the UI almost immediately. </p>
<p>After that, the dev team split up and began working. Fortunately I had some side projects that utilized Node, CoffeeScript, and Less, so we were able to strip out the guts of that project and use it as a starting point. In less than an hour we had a running server and a github repo that everyone could start working on.</p>
<p><object width="704" height="396"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=34866706&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=34866706&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=0&amp;show_portrait=1&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="704" height="396"></embed></object>
<p><a href="http://vimeo.com/34866706">Code Racer: Day One</a> from <a href="http://vimeo.com/teamtreehouse">Treehouse</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>I spent most of Day 1 setting up the project and then building a game matchmaking system where when you start a game, you join a lobby until that game reaches capacity. When the game reaches capacity it begins, and a new game is created for the next set of players.</p>
<h2 id="day_two_interface">Day Two &#8211; Interface</h2>
<p>The second day for me was all about the front-end. By Tuesday we were able to connect to a lobby and start multiple games on the same server. Next on the list was creating the interface. There are a lot of moving parts in the game that must react to information sent from the server and the player.</p>
<p>When a new player joins, we have to add them to the page, which includes an editor, a tab in the players bar, and an entry in the lobby screen. When a player updates their code, it must be sent to the server, which will notify all the players in the game. Each player must take these notifications and update the code for the other player&#8217;s editor. Being able to watch someone else code was one of our top priority features.</p>
<p>Getting all of the information moving around the different client models and controllers, through the sockets to the server and back down to the clients was the most difficult problem to tackle. By Tuesday night we were able to see other players&#8217; code as they typed it. Many of the other game elements like the timer, player list, and scores were also being displayed.</p>
<p><object width="700" height="394"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=34969494&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=34969494&amp;server=vimeo.com&amp;show_title=0&amp;show_byline=0&amp;show_portrait=0&amp;color=00adef&amp;fullscreen=1&amp;autoplay=0&amp;loop=0" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="700" height="394"></embed></object>
<p><a href="http://vimeo.com/34969494">Code Racer: Day Two</a> from <a href="http://vimeo.com/teamtreehouse">Treehouse</a> on <a href="http://vimeo.com">Vimeo</a>.</p>
<p>It was about this time I had to step away from the code for a while. Trying to hold all of the server and client interactions in my head was causing me to mentally fatigue, and I could tell I was becoming less effective. Fortunately Alan jumped in and spent Tuesday night working on getting the game logic up and running. I was amazed at how quickly it turned from a small prototype of live-coding into something that really looked like a game.</p>
<p>While I stepped back from the game logic and architecture, I was finally able to go around the office and see what everyone else was up to. It was awesome to see what was getting done. Amit had a working system for creating challenges and verifying answers from the players. Kevin had built a bunch of awesome weapons you can use on other players that will play sounds and manipulate your screen in some way. Jason had Facebook integration up and running. The design team was doing awesome creating amazing designs and interfaces.</p>
<h2 id="day_three_integration_and_testing">Day Three &#8211; Integration and Testing</h2>
<p>By Wednesday morning we had something that resembled a game. The html layouts the design team had built had not yet been integrated into the game and there was a lot of work to do on the game logic itself. Wednesday was all about getting the game done. We had to be ready to launch by Thursday. We spent the whole day working on the game logic, testing, tweaking, and testing again.</p>
<p>We played our first game on Wednesday after lunch and the competitive taunts and gasps of excitement and defeat from the players were quite loud. For the first time we were able to see that Code Racer is actually fun to play. A huge wave or relief rolled over the whole office. It actually looks like this idea may work.</p>
<h2 id="day_four_launch">Day Four &#8211; Launch!</h2>
<p>Finally it was launch day. We spent the morning squashing bugs, polishing the UI and game play, and deploying the application. It was pretty stressful. We had a lot of things we needed to get done and almost no time to do it. </p>
<p>We sent out links to our friends to test Code Racer before the official launch. Of course this brought us a lot of feedback on improvements we could make and bugs we need to eliminate, which is how we spent Thursday.</p>
<p>As Ryan and Alan were getting ready to leave for their flights, we were able to launch Code Racer officially. We did it!. Articles from <a href="http://techcrunch.com/2012/01/12/compete-against-other-players-learning-to-code-with-treehouses-code-race/">TechCrunch</a> and <a href="http://venturebeat.com/2012/01/12/coderacer/">Venture Beat</a> went live, and tweets started flowing in. It was unreal. On Monday morning I wasn&#8217;t sure this idea was possible, but now here it was, online, with thousands of people playing it. In the first 3 days after launch over 6,800 players had played a total of over 4,500 games.</p>
<p>In less than 4 days, the team at Treehouse went from idea to product. I&#8217;m incredibly proud of all of the people who worked on Code Racer and count myself very lucky to have the opportunity to work with them.</p>
<h2> The Libraries and Tools We Used </h2>
<p>Finally, I wanted to share the (hopefully) complete list of tools we used to make Code Racer. Thanks to Jason for putting this list together!</p>
<ul>
<li><a href="http://nodejs.org/">Node.js</a></li>
<li><a href="http://expressjs.com/">express</a></li>
<li><a href="http://spinejs.com">Spine</a></li>
<li><a href="https://github.com/maccman/hem">hem</a></li>
<li><a href="https://github.com/maccman/es5-shimify">es5-shimify</a></li>
<li><a href="https://github.com/maccman/json2ify">json2ify</a></li>
<li><a href="https://github.com/sstephenson/eco">eco</a></li>
<li><a href="https://github.com/broofa/node-uuid">node-uuid</a></li>
<li><a href="http://sequelizejs.com">Sequelize</a></li>
<li><a href="https://github.com/masylum/facebook-js">facebook-js</a></li>
<li><a href="http://coffeescript.org/">CoffeeScript</a></li>
<li><a href="http://socket.io/">Socket.io</a></li>
<li><a href="http://aws.amazon.com">Amazon EC2</a></li>
<li><a href="http://github.com">GitHub</a></li>
<li><a href="http://code.google.com/p/macvim/">MacVim</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/how-we-built-code-racer-in-4-days/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Free Video: Installing Ruby</title>
		<link>http://thinkvitamin.com/code/ruby/free-video-installing-ruby/</link>
		<comments>http://thinkvitamin.com/code/ruby/free-video-installing-ruby/#comments</comments>
		<pubDate>Thu, 19 Jan 2012 14:00:40 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18038</guid>
		<description><![CDATA[In this 8 minute video, you will learn how to install Ruby on both Mac OS X and on Windows. This will let you get IRB up and running and is the basis for running Ruby programs on your own computer. This video is from Treehouse, a high-quality video training site with hundreds of short videos [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://teamtreehouse.com/library/ruby-foundations/introduction/installing-ruby/play?cid=193">8 minute video</a>, you will learn how to install Ruby on both Mac OS X and on Windows. This will let you get IRB up and running and is the basis for running Ruby programs on your own computer.</p>
<p><a href="http://teamtreehouse.com/library/ruby-foundations/introduction/installing-ruby/play?cid=193"><img src="http://thinkvitamin.com/wp-content/uploads/2012/01/Installing-Ruby-Treehouse.png" alt="Installing Ruby Video" title="Installing Ruby - Treehouse" width="704" height="397" alt="A screenshot from the Installing Ruby video that shows how to install Ruby on Macs and Windows." /></a></p>
<p>This video is from <a href="http://teamtreehouse.com/?cid=193">Treehouse</a>, a high-quality video training site with hundreds of short videos on topics like &#8230;</p>
<ul>
<li><a href="http://teamtreehouse.com/library/accessibility/?cid=193">Accessibility</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css3?cid=193">CSS3</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/aesthetic-foundations?cid=193">Aesthetic Foundations</a></li>
<li><a href="http://teamtreehouse.com/library/django/?cid=193">Django</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/html/?cid=193">HTML</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css-foundations/?cid=193">CSS</a></li>
<li><a href="http://teamtreehouse.com/library/html5-foundations/?cid=193">HTML5</a></li>
<li><a href="http://teamtreehouse.com/library/ios-4-foundations/?cid=193">iOS Development</a></li>
<li><a href="http://teamtreehouse.com/library/javascript/?cid=193">JavaScript</a></li>
<li><a href="http://teamtreehouse.com/library/jquery/?cid=193">jQuery</a></li>
<li><a href="http://teamtreehouse.com/library/nosql/?cid=193">NoSQL</a></li>
<li><a href="http://teamtreehouse.com/library/php/?cid=193">PHP</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/rwd-foundations/?cid=193">Responsive Web Design</a></li>
<li><a href="http://teamtreehouse.com/library/ruby/?cid=193">Ruby</a></li>
<li><a href="http://teamtreehouse.com/library/ruby-on-rails/?cid=193">Ruby on Rails</a></li>
<li><a href="http://teamtreehouse.com/library/archive/ux-foundations/?cid=193">UX</a></li>
<li><a href="http://teamtreehouse.com/library/version-control?cid=193">Version Control</a></li>
<li><a href="http://teamtreehouse.com/library/wordpress?cid=193">WordPress Theme Design</a></li>
</ul>
<p>New videos are added regularly, so it&#8217;s a great way to stay up-to-date on all the latest technology and methods. Browse the entire <a href="http://teamtreehouse.com/library/?cid=193">library of videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ruby/free-video-installing-ruby/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Customizing the design of UIPopoverController</title>
		<link>http://thinkvitamin.com/code/ios/customizing-the-design-of-uipopovercontroller/</link>
		<comments>http://thinkvitamin.com/code/ios/customizing-the-design-of-uipopovercontroller/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 19:27:57 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=18021</guid>
		<description><![CDATA[Popovers are very common within the iPad user interface but you were restricted to the design provided by Apple. With iOS 5 came a little known class called UIPopoverBackgroundView which allows you to provide a custom border and arrow for the popover. The popover The UIPopoverController is the class that facilitates the popover view. It [...]]]></description>
			<content:encoded><![CDATA[<p>Popovers are very common within the iPad user interface but you were restricted to the design provided by Apple. With iOS 5 came a little known class called <code>UIPopoverBackgroundView</code> which allows you to provide a custom border and arrow for the popover. </p>
<p><span id="more-18021"></span></p>
<h2>The popover</h2>
<p>The <code>UIPopoverController</code> is the class that facilitates the popover view. It takes a custom view controller and then displays it with a neat border and arrow, where the arrow points to its origin. It is ideal for displaying contextual information. The popover user interface is essentially made of three main parts: the border, content, and arrow.</p>
<p><img src="https://img.skitch.com/20120118-kpkht8t5dxpk6du9frya4hup1t.jpg" alt="UIPopoverController" /></p>
<h2>Images</h2>
<p>Before we look at the <code>UIPopoverBackgroundView</code> you will need two images to customize your popover. One image for the <a href="https://img.skitch.com/20120118-bmkyb1xq8atuhepaadfabhni6.png" title="Border">border</a> and the other for the <a href="https://img.skitch.com/20120118-pheehhdtp8i368ds8hi3w98nqk.png" title="Arrow">arrow</a>. </p>
<p><img src="https://img.skitch.com/20120118-bypr27ru341q5pe3jdkwpn15cb.jpg"></p>
<h3>Dissecting the background image</h3>
<p>When designing the background image it is important to note that the image will be stretched. <code>UIImage</code> allows you to create a stretchable image by defining cap insets. These caps define portions of the image that will not be rescaled whereas the rest of the image is easily tiled when stretched. As seen in the image below the dark area is what will be tiled and the colored corners will not.</p>
<p><img src="https://img.skitch.com/20120118-r1d25j25p234ruatay389u638f.jpg"></p>
<h2>Subclassing UIPopoverBackgroundView</h2>
<p>The <code>UIPopoverBackgroundView</code> is an abstract class which has no implementation. We need to subclass it and provide implementations for all its methods and properties. You can read the Apple documentation on all its properties and methods. What is not in the documentation is how to layout the border and arrow using the method <code>layoutSubviews</code>. </p>
<p>First let&#8217;s start by creating an <code>Interface</code> and subclassing the <code>UIPopoverBackgroundView</code>.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &lt;UIKit/UIPopoverBackgroundView.h&gt;</span>
&nbsp;
<span style="color: #a61390;">@interface</span> CustomPopoverBackgroundView <span style="color: #002200;">:</span> UIPopoverBackgroundView <span style="color: #002200;">&#123;</span>
    UIImageView <span style="color: #002200;">*</span>_borderImageView;
    UIImageView <span style="color: #002200;">*</span>_arrowView;
    CGFloat _arrowOffset;
    UIPopoverArrowDirection _arrowDirection;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></td></tr></table></div>

<p>Make sure to specify your import statement or else the code will not compile. An explanation for each of the instance variables:</p>
<ul>
<li><code>_borderImageView</code>: contains the image for the border</li>
<li><code>_arrowView</code>: contains the image for the arrow</li>
<li><code>_arrowOffset</code>: used for the property <code>arrowOffset</code> specified in the <code>Interface</code> for <code>UIPopoverBackgroundView</code>. We will see later how this value is used to calculate the position for the arrow.</li>
<li><code>_arrowDirection</code>: used for the property <code>arrowDirection</code> specified in the <code>Interface</code> for <code>UIPopoverBackgroundView</code></li>
</ul>
<p>Let&#8217;s fill out the implementation, starting with the designated initializer</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;"><span style="color: #6e371a;">#import &quot;CustomPopoverBackgroundView.h&quot;</span>
&nbsp;
<span style="color: #6e371a;">#define CONTENT_INSET 10.0</span>
<span style="color: #6e371a;">#define CAP_INSET 25.0</span>
<span style="color: #6e371a;">#define ARROW_BASE 25.0</span>
<span style="color: #6e371a;">#define ARROW_HEIGHT 25.0</span>
&nbsp;
<span style="color: #a61390;">@implementation</span> CustomPopoverBackgroundView
&nbsp;
&nbsp;
<span style="color: #002200;">-</span><span style="color: #002200;">&#40;</span><span style="color: #a61390;">id</span><span style="color: #002200;">&#41;</span>initWithFrame<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGRect<span style="color: #002200;">&#41;</span>frame<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">if</span> <span style="color: #002200;">&#40;</span>self <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>super initWithFrame<span style="color: #002200;">:</span>frame<span style="color: #002200;">&#93;</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        _borderImageView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImageView alloc<span style="color: #002200;">&#93;</span> initWithImage<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;popover-bg.png&quot;</span><span style="color: #002200;">&#93;</span> resizableImageWithCapInsets<span style="color: #002200;">:</span>UIEdgeInsetsMake<span style="color: #002200;">&#40;</span>CAP_INSET,CAP_INSET,CAP_INSET,CAP_INSET<span style="color: #002200;">&#41;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
        _arrowView <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIImageView alloc<span style="color: #002200;">&#93;</span> initWithImage<span style="color: #002200;">:</span><span style="color: #002200;">&#91;</span>UIImage imageNamed<span style="color: #002200;">:</span><span style="color: #bf1d1a;">@</span><span style="color: #bf1d1a;">&quot;arrow.png&quot;</span><span style="color: #002200;">&#93;</span><span style="color: #002200;">&#93;</span>;
&nbsp;
        <span style="color: #002200;">&#91;</span>self addSubview<span style="color: #002200;">:</span>_borderImageView<span style="color: #002200;">&#93;</span>;
        <span style="color: #002200;">&#91;</span>self addSubview<span style="color: #002200;">:</span>_arrowView<span style="color: #002200;">&#93;</span>;
&nbsp;
    <span style="color: #002200;">&#125;</span>
    <span style="color: #a61390;">return</span> self;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>Basically we are allocating and initializing the two views and adding them as subviews. Notice how the background image is defined with cap insets. Next, let&#8217;s implement all the required methods including the getters and setters for the properties.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;">&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>CGFloat<span style="color: #002200;">&#41;</span> arrowOffset <span style="color: #002200;">&#123;</span>    
    <span style="color: #a61390;">return</span> _arrowOffset;    
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span> setArrowOffset<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>CGFloat<span style="color: #002200;">&#41;</span>arrowOffset <span style="color: #002200;">&#123;</span>    
    _arrowOffset <span style="color: #002200;">=</span> arrowOffset;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>UIPopoverArrowDirection<span style="color: #002200;">&#41;</span>arrowDirection <span style="color: #002200;">&#123;</span>    
    <span style="color: #a61390;">return</span> _arrowDirection;    
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>setArrowDirection<span style="color: #002200;">:</span><span style="color: #002200;">&#40;</span>UIPopoverArrowDirection<span style="color: #002200;">&#41;</span>arrowDirection <span style="color: #002200;">&#123;</span>    
    _arrowDirection <span style="color: #002200;">=</span> arrowDirection;
<span style="color: #002200;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span>UIEdgeInsets<span style="color: #002200;">&#41;</span>contentViewInsets<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> UIEdgeInsetsMake<span style="color: #002200;">&#40;</span>CONTENT_INSET, CONTENT_INSET, CONTENT_INSET, CONTENT_INSET<span style="color: #002200;">&#41;</span>;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span>CGFloat<span style="color: #002200;">&#41;</span>arrowHeight<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> ARROW_HEIGHT;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #002200;">+</span><span style="color: #002200;">&#40;</span>CGFloat<span style="color: #002200;">&#41;</span>arrowBase<span style="color: #002200;">&#123;</span>
    <span style="color: #a61390;">return</span> ARROW_BASE;
<span style="color: #002200;">&#125;</span></pre></td></tr></table></div>

<p>The above methods are fairly straightforward with the exception of <code>contentViewInsets</code>. This method determines the thickness of your border. The higher the number the thicker your border. Finally, the method that lays out our two subviews in their appropriate sizes and location.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;">&nbsp;
<span style="color: #002200;">-</span>  <span style="color: #002200;">&#40;</span><span style="color: #a61390;">void</span><span style="color: #002200;">&#41;</span>layoutSubviews <span style="color: #002200;">&#123;</span>
    <span style="color: #002200;">&#91;</span>super layoutSubviews<span style="color: #002200;">&#93;</span>;
&nbsp;
    CGFloat _height <span style="color: #002200;">=</span> self.frame.size.height;
    CGFloat _width <span style="color: #002200;">=</span> self.frame.size.width;
    CGFloat _left <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.0</span>;
    CGFloat _top <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.0</span>;
    CGFloat _coordinate <span style="color: #002200;">=</span> <span style="color: #2400d9;">0.0</span>;
    CGAffineTransform _rotation <span style="color: #002200;">=</span> CGAffineTransformIdentity;
&nbsp;
&nbsp;
    <span style="color: #a61390;">switch</span> <span style="color: #002200;">&#40;</span>self.arrowDirection<span style="color: #002200;">&#41;</span> <span style="color: #002200;">&#123;</span>
        <span style="color: #a61390;">case</span> UIPopoverArrowDirectionUp<span style="color: #002200;">:</span>
            _top <span style="color: #002200;">+=</span> ARROW_HEIGHT;
            _height <span style="color: #002200;">-=</span> ARROW_HEIGHT;
            _coordinate <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>self.frame.size.width <span style="color: #002200;">/</span> <span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">+</span> self.arrowOffset<span style="color: #002200;">&#41;</span> <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>ARROW_BASE<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span>;
            _arrowView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span>_coordinate, <span style="color: #2400d9;">0</span>, ARROW_BASE, ARROW_HEIGHT<span style="color: #002200;">&#41;</span>;            
            <span style="color: #a61390;">break</span>;
&nbsp;
&nbsp;
        <span style="color: #a61390;">case</span> UIPopoverArrowDirectionDown<span style="color: #002200;">:</span>
            _height <span style="color: #002200;">-=</span> ARROW_HEIGHT;
            _coordinate <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>self.frame.size.width <span style="color: #002200;">/</span> <span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">+</span> self.arrowOffset<span style="color: #002200;">&#41;</span> <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>ARROW_BASE<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span>;
            _arrowView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span>_coordinate, _height, ARROW_BASE, ARROW_HEIGHT<span style="color: #002200;">&#41;</span>; 
            _rotation <span style="color: #002200;">=</span> CGAffineTransformMakeRotation<span style="color: #002200;">&#40;</span> M_PI <span style="color: #002200;">&#41;</span>;
            <span style="color: #a61390;">break</span>;
&nbsp;
        <span style="color: #a61390;">case</span> UIPopoverArrowDirectionLeft<span style="color: #002200;">:</span>
            _left <span style="color: #002200;">+=</span> ARROW_BASE;
            _width <span style="color: #002200;">-=</span> ARROW_BASE;
            _coordinate <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>self.frame.size.height <span style="color: #002200;">/</span> <span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">+</span> self.arrowOffset<span style="color: #002200;">&#41;</span> <span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>ARROW_HEIGHT<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span>;
            _arrowView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span><span style="color: #2400d9;">0</span>, _coordinate, ARROW_BASE, ARROW_HEIGHT<span style="color: #002200;">&#41;</span>; 
            _rotation <span style="color: #002200;">=</span> CGAffineTransformMakeRotation<span style="color: #002200;">&#40;</span> <span style="color: #002200;">-</span>M_PI_2 <span style="color: #002200;">&#41;</span>;
            <span style="color: #a61390;">break</span>;
&nbsp;
        <span style="color: #a61390;">case</span> UIPopoverArrowDirectionRight<span style="color: #002200;">:</span>
            _width <span style="color: #002200;">-=</span> ARROW_BASE;
            _coordinate <span style="color: #002200;">=</span> <span style="color: #002200;">&#40;</span><span style="color: #002200;">&#40;</span>self.frame.size.height <span style="color: #002200;">/</span> <span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span> <span style="color: #002200;">+</span> self.arrowOffset<span style="color: #002200;">&#41;</span><span style="color: #002200;">-</span> <span style="color: #002200;">&#40;</span>ARROW_HEIGHT<span style="color: #002200;">/</span><span style="color: #2400d9;">2</span><span style="color: #002200;">&#41;</span>;
            _arrowView.frame <span style="color: #002200;">=</span> CGRectMake<span style="color: #002200;">&#40;</span>_width, _coordinate, ARROW_BASE, ARROW_HEIGHT<span style="color: #002200;">&#41;</span>; 
            _rotation <span style="color: #002200;">=</span> CGAffineTransformMakeRotation<span style="color: #002200;">&#40;</span> M_PI_2 <span style="color: #002200;">&#41;</span>;
&nbsp;
            <span style="color: #a61390;">break</span>;
&nbsp;
    <span style="color: #002200;">&#125;</span>
&nbsp;
    _borderImageView.frame <span style="color: #002200;">=</span>  CGRectMake<span style="color: #002200;">&#40;</span>_left, _top, _width, _height<span style="color: #002200;">&#41;</span>;
&nbsp;
&nbsp;
    <span style="color: #002200;">&#91;</span>_arrowView setTransform<span style="color: #002200;">:</span>_rotation<span style="color: #002200;">&#93;</span>;
&nbsp;
<span style="color: #002200;">&#125;</span>
&nbsp;
<span style="color: #a61390;">@end</span></pre></td></tr></table></div>

<p>The switch statement determines the direction of the arrow and then calculates the location of the arrow and its rotation. Our default arrow image points upwards so we need to change its rotation using an affine transform which takes in radians. The <code>arrowOffset</code> is calculated and set by the <code>UIPopoverController</code> which essentially tells us the distance of the arrow from the center of content view. We also have to adjust the height and width of our border view to account for the arrow. </p>
<h2>Using the CustomPopoverBackgroundView</h2>
<p>Now that we have created the <code>CustomPopoverBackgroundView</code> we need to set it when creating an instance of the <code>UIPopoverController</code></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;">UIPopoverController <span style="color: #002200;">*</span>popoverController <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>UIPopoverController alloc<span style="color: #002200;">&#93;</span> initWithContentViewController<span style="color: #002200;">:</span>contentViewController<span style="color: #002200;">&#93;</span> ;
&nbsp;
popoverController.popoverBackgroundViewClass <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span>CustomPopoverBackgroundView class<span style="color: #002200;">&#93;</span>;</pre></td></tr></table></div>

<p>Note: the above code will work only in iOS 5</p>
<p>Now run your app and marvel at your newly designed popover.</p>
<p><img src="https://img.skitch.com/20120118-8111m9y34nqs7e6pj14w9y6a8h.jpg" alt="Subclassing UIPopoverBackgroundView" ></p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/customizing-the-design-of-uipopovercontroller/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Ember.js: A More Lightweight SproutCore</title>
		<link>http://thinkvitamin.com/code/javascript/ember-js-a-more-lightweight-sproutcore/</link>
		<comments>http://thinkvitamin.com/code/javascript/ember-js-a-more-lightweight-sproutcore/#comments</comments>
		<pubDate>Wed, 14 Dec 2011 20:41:48 +0000</pubDate>
		<dc:creator>Jim Hoskins</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17713</guid>
		<description><![CDATA[Ember.js is a new JavaScript framework that was formerly SproutCore 2.0. When I tried out SproutCore for the first time a few years ago, I was impressed with it&#8217;s data binding and templates, but I found it included a lot of things I didn&#8217;t need or want, like a large UI framework and it&#8217;s own [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.emberjs.com/">Ember.js</a> is a new JavaScript framework that was formerly SproutCore 2.0. When I tried out SproutCore for the first time a few years ago, I was impressed with it&#8217;s data binding and templates, but I found it included a lot of things I didn&#8217;t need or want, like a large UI framework and it&#8217;s own recommended toolchain and workflow. I wished I could just use the few core parts of SproutCore easily and leave out the rest. Ember.js is that wish coming true. Its main focuses are: data binding, computed properties, and auto-updating templates.</p>
<p>Check out the <a href="https://github.com/emberjs/ember.js/">Ember.js on Github</a> and read the <a href="http://yehudakatz.com/2011/12/08/announcing-amber-js/">announcement here</a>. </p>
<p><em>Ember.js had the code name Amber while in development. It was announced under the name Amber.js, but renamed to Ember.js after there was some confusion with another project</em></p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/javascript/ember-js-a-more-lightweight-sproutcore/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Creating Bookmarklets for Fun and Profit</title>
		<link>http://thinkvitamin.com/code/javascript/creating-bookmarklets-for-fun-and-profit/</link>
		<comments>http://thinkvitamin.com/code/javascript/creating-bookmarklets-for-fun-and-profit/#comments</comments>
		<pubDate>Tue, 13 Dec 2011 21:31:06 +0000</pubDate>
		<dc:creator>Jim Hoskins</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17630</guid>
		<description><![CDATA[Bookmarklets are just like normal browser bookmarks, but when you click one, instead of taking you to another web page, it performs some action on the web page you are currently on. You have probably encountered bookmarklets in some way, whether it’s in a bookmarking service like Instapaper, or maybe a cool web design tool [...]]]></description>
			<content:encoded><![CDATA[<p>Bookmarklets are just like normal browser bookmarks, but when you click one, instead of taking you to another web page, it performs some action on the web page you are currently on.</p>
<p>You have probably encountered bookmarklets in some way, whether it’s in a bookmarking service like Instapaper, or maybe a cool web design tool that manipulates your page in some way. What you may not realize is that it’s very easy to create bookmarklets. So easy that you can use them not only in your large projects, but you can build quick bookmarklets to help you automate tedious online tasks.</p>
<p><span id="more-17630"></span></p>
<h2 id="bookmarklet_basics">Bookmarklet Basics</h2>
<p>A bookmarklet is simply a snippet of JavaScript code saved as a link.<br />
When you click the link, or click the bookmark you created from the<br />
link, it runs the JavaScript code on the page that you are currently<br />
looking at.</p>
<p>So what can you do with that? Almost anything! Let’s start, however,<br />
with a very simple example.</p>
<p>So let’s take a very simple piece of JavaScript, and create a<br />
bookmarklet.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'This is a rather simple example...'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This typical snippet of JavaScript simply pops up a box that says “This<br />
is a rather simple example…”</p>
<p>So let’s now create a link that executes this snippet.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;javascript:alert('This is a rather simple example...');&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> Show Alert <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>So it looks kind of like a typical <code>&lt;a&gt;</code> tag. The href however is a<br />
little different. Instead of a typical page url, it is our JavaScript<br />
code, preceded by <code>javascript:</code>. This is what allows us to run our code.</p>
<p>If you click the link, you will get the popup. But if you drag the link<br />
to your bookmarks toolbar, you will then be able to click that bookmark,<br />
and execute the code on any page.</p>
<h2 id="interacting_with_the_page">Interacting with the Page.</h2>
<p>The previous example isn’t very useful, it just pops up the same old<br />
message each time. The beauty of a bookmarklet is that it runs the code<br />
<strong><em>within</em></strong> the page you are viewing. This means your bookmarklet’s<br />
code has access to all of the page elements, variables, and functions on<br />
that page. This is also the reason to be careful using 3rd party<br />
bookmarklets, they can also do malicious things like retrieve your<br />
cookie from the page you are on and transmit it elsewhere.</p>
<p>Let’s jazz up our example to popup the title of the current page.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;javascript:alert('This page is : ' + document.title);&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> Show Title <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Now this link and bookmarklet will tell us the title of the current<br />
page. This is because the <code>document</code> will be the page document of the<br />
current page.</p>
<p>We can do much more than just get information and pop it up in an alert,<br />
we can apply styles to a page, add or remove elements, or even<br />
manipulate forms to automate data entry.</p>
<p>If you have some long form that is tedious to fill out, but the<br />
actions you want to take can be automated, bookmarklets can save you a lot<br />
of time. Better yet, you can create a bookmarklet for a coworker and be a<br />
hero who saved him or her hours of work by simply spending a few minutes<br />
creating a bookmarklet to help.</p>
<p>If you are making a bookmarklet to work on a particular site, there is a<br />
good chance that the site uses jQuery (it’s that popular). If it’s another<br />
framework you could utilize that too. If you know jQuery is on the page<br />
you are using your bookmarklet for, it makes building bookmarklets that<br />
much easier.</p>
<p>Here is a simple example. Sometimes when confronted with dozens of checkboxes on a page, I want to<br />
just check them all, and maybe uncheck the few that don’t apply to me.<br />
If there is no “Check All” button, I have to do it myself.<br />
The code for that is simple, assuming you have jQuery on the target<br />
page.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">':checkbox'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">attr</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>This selects all checkboxes, and checks them all. Just throw code in a<br />
link, drag the link to you bookmarks bar, and you’re ready to go<br />
checkbox crazy at a moment’s notice.</p>
<h2 id="workflow">Workflow</h2>
<p>Often when creating bookmarklets, the code requires some<br />
experimentation, and several JavaScript statements.</p>
<p>Here is the workflow I use.</p>
<h3 id="step_1_experiment_in_the_dev_tools_or_firebug">Step 1: Experiment in the Dev Tools or Firebug</h3>
<p>Since your code will run on a page, pick out a target page, and open<br />
the JavaScript console of your Dev Tools, or Firebug. This allows you to<br />
experiment with the JavaScript code and what CSS selectors can be used to select elements (if<br />
you are using a framework like jQuery, as shown above).</p>
<p>You may want to write the code snippet in a text editor, then copy and<br />
paste it into the console, rather than try to form you statement(s) in<br />
the console itself.</p>
<p>Once your code does what you want, move to step 2.</p>
<h3 id="step_2_prepare_your_code">Step 2: Prepare Your Code</h3>
<p>Since you will have to place your code in the <code>href</code> attribute of an<br />
<code>&lt;a&gt;</code> tag, there are some formatting restrictions. First take note of<br />
any quotes in your code. I like to use only single quotes in my<br />
bookmarklet code, so when I wrap the code in double quotes to embed it<br />
in the HTML, I don’t break out of the <code>href</code> value.</p>
<p>Your code should also be compact. You can do this fairly easily by<br />
removing line breaks. Make sure you are using semicolons properly, but<br />
you already do that, right? You could also try using a JavaScript<br />
minifier to reduce the code, but if there is that much code, you may<br />
want to try a different technique, I will explain shortly.</p>
<h3 id="step_3_create_the_bookmarklet">Step 3: Create the Bookmarklet</h3>
<p>There are two main ways to add a bookmarklet to your browser. You can<br />
create an <code>&lt;a&gt;</code> tag on a page, and drag it to your bookmarks, or you can<br />
create a normal bookmark to any page, then edit its title and link. You<br />
would then set the like location to your ‘javascript: …’ code. This<br />
strategy can be a bit cumbersome, but editing an existing bookmark is<br />
the way you have to do it on iOS.</p>
<p>I prefer to create a link on an HTML page. This makes it easier to<br />
share.</p>
<p>We saw the syntax for this at the beginning of this article.</p>
<p>It’s an <code>&lt;a&gt;</code> tag. The <code>href</code> is in the format <code>"javascript: YOUR CODE<br />
 HERE"</code> and the content of the tag will be the title of the bookmarklet.</p>
<p>You can either create a new HTML page to create this link, or you can<br />
 use something like <a href="http://jsfiddle.net/">jsFiddle</a> to quickly create<br />
 your link. This has the added benefit of making it easy to share with a<br />
 coworker, a friend, or the world.</p>
<h2 id="bigger_bookmarklets">Bigger Bookmarklets</h2>
<p>If you are creating a bookmarklet that goes beyond a simple gimmick or<br />
 time saver, you may have a lot more code. While you can cram quite a bit<br />
 of code in that link, it’s often better to instead create a JavaScript<br />
 file that is hosted on the web, then have the bookmarklet load that<br />
 script into the page. Your script will execute in the page just as it<br />
 would have with the shorter bookmarklets.</p>
<p>Creating an external file has the added benefit of being able to update<br />
 the logic of the bookmarklet by simply updating the target file.</p>
<p>The readable version of the code looks like this.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> script <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'SCRIPT'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  script.<span style="color: #660066;">src</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'http://example.com/the_code.js'</span><span style="color: #339933;">;</span>
  document.<span style="color: #660066;">body</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span>script<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>This creates a <code>&lt;script&gt;</code> tag, sets its <code>src</code>, and adds it to the page,<br />
which will fetch and run the file immediately. Of course you would<br />
change the value of <code>src</code> to be the url to your JavaScript file.</p>
<p>The whole thing is wrapped in a function that will execute immediately.<br />
This is because we are creating a variable called <code>script</code>. Since we are<br />
going to be running this on another page, we don’t want to accidentally<br />
mess up a global variable that page may be counting on. By wrapping it<br />
in this self executing function, we keep all our variables to ourselves,<br />
not messing up the target JavaScript environment.</p>
<p>Ultimately the code is compressed to this:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span>=<span style="color: #ff0000;">&quot;javascript:(function(){var script=document.createElement('SCRIPT');script.src='http://example.com/the_code.js';document.body.appendChild(script);})()&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span> Do Something! <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2 id="use_your_new_superpowers_for_good">Use Your New Superpowers for Good</h2>
<p>Now that you can make bookmarklets, you can add all sorts of features to<br />
any site you want. You are now a developer for any site on the web.</p>
<p>Almost anything is possible when you can run JavaScript on a website. If<br />
you want to learn about what is possible with JavaScript, check out the<br />
JavaScript and jQuery lessons on<br />
<a href="http://teamtreehouse.com?cid=193">Treehouse</a>.</p>
<h2> Update: A real-life example</h2>
<p>I was watching the iOS videos on <a href="http://teamtreehouse.com?cid=193">Treehouse</a>, and coding along when I realized what I would like is for the video to pause when I tab over to Xcode, then resume when I come back to Treehouse. Since I work for Treehouse I could have easily added it to the feature development list, but I wanted it right away. So a bookmarklet was born. </p>
<p><a href="http://jsfiddle.net/jimrhoskins/Ybnv6/3/">You can check out the bookmarklet here</a>. The code was built for use on a <a href="http://teamtreehouse.com?cid=193">Treehouse</a> video page, but it should work on any page with HTML5 video and jQuery.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/javascript/creating-bookmarklets-for-fun-and-profit/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>iOS 5 Automatic Reference Counting (ARC)</title>
		<link>http://thinkvitamin.com/code/ios/ios-5-automatic-reference-counting-arc/</link>
		<comments>http://thinkvitamin.com/code/ios/ios-5-automatic-reference-counting-arc/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 20:24:41 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17578</guid>
		<description><![CDATA[With iOS 5 Apple has released the most appealing language feature, automatic reference counting or ARC. It makes memory management a lot simpler because you no longer have to manually keep a count of object references &#8211; the compiler takes care of it. Manual Reference Counting If you have been developing on the earlier versions [...]]]></description>
			<content:encoded><![CDATA[<p>With iOS 5 Apple has released the most appealing language feature, automatic reference counting or ARC. It makes memory management a lot simpler because you no longer have to manually keep a count of object references &#8211; the compiler takes care of it. </p>
<p><span id="more-17578"></span></p>
<h2>Manual Reference Counting</h2>
<p>If you have been developing on the earlier versions of iOS 4 then you are probably familiar with reference counting. In a manual reference counting environment you have to keep track of object ownership. If you own an object you must make sure to release it, if you don&#8217;t then you will have a memory leak, which eventually leads to app crashes. Aside from crashes or leaks keeping count of the retain, release and autorelease is cumbersome. </p>
<p>Here&#8217;s a typical example, you allocate a new object called <code>obj1</code>, then  you point <code>obj2</code> to <code>obj1</code>. At this point you have to make sure that you <code>retain</code> <code>obj2</code>, which increases the reference count. In addition, you have to make sure you send a release to each object to free memory once the retain count goes down to zero. This is a simple example but in a normal sized app this can get very complicated, very quickly.</p>
<p><img src="http://i.imgur.com/6lahN.jpg" alt="Manual reference counting" /></p>
<h2>Automatic Reference Counting (ARC) </h2>
<p>The above example is simplified when using ARC.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="objc" style="font-family:monospace;">MyClass <span style="color: #002200;">*</span>obj1 <span style="color: #002200;">=</span> <span style="color: #002200;">&#91;</span><span style="color: #002200;">&#91;</span>MyClass alloc<span style="color: #002200;">&#93;</span> init<span style="color: #002200;">&#93;</span>;
MyClass <span style="color: #002200;">*</span>obj2 <span style="color: #002200;">=</span> obj1;</pre></td></tr></table></div>

<p>As you can see, you still allocate <code>obj1</code> and then point <code>obj2</code> to <code>obj1</code>. The retains and releases are still occurring, although now it all happens behind the scenes. It is the compiler&#8217;s job to maintain the life of an object and to ensure that it is appropriately deallocated when no longer in use. Since this is not garbage collection, you do not sacrifice speed. Your app is just as fast and now with less maintenance. You get to focus on the features of your app and not get distracted by memory management. </p>
<h3> Strong vs Weak </h3>
<p>With ARC the only thing you have to consider are the qualifiers Strong and Weak.</p>
<p>The <code>strong</code> qualifier is set by default. When using this qualifier you are instructing compiler that you would like to retain an abject for the current event cycle. </p>
<p>You can still use <code>retain</code>, however it is recommended that you use <code>strong</code> instead. </p>
<p>The <code>weak</code> qualifier also known as a zeroing weak reference, instructs the compiler that you do not need to retain the object. And if all the references to this object go down to zero then the object is released and set to nil. This is important because a message send to a nil object does not cause a crash, it simply doesn&#8217;t do anything. </p>
<p>You can still use <code>assign</code>, however it is recommended that you use <code>weak</code> instead because it will set a deallocated object to <code>nil</code>. </p>
<p>A weak qualifier is especially used in a parent child object relationship, where the parent has a strong reference to a child object. And the child object a <code>weak</code> reference back to parent otherwise you will end up creating a circular reference. </p>
<p><img src="http://i.imgur.com/tSBSu.jpg" alt="Weak references" /></p>
<h2>Upgrading to ARC </h2>
<p>Upgrading an existing project to use ARC is very simple. Open up your project in Xcode 4.2 and from the menu select Edit > Refactor > Convert to Objective-C ARC. The conversion process first performs a pre-flight check and then ensures that you are ready to upgrade to ARC. It then gives you a preview of all the changes it will make to your code before finally committing the changes. </p>
<p><img src="http://i.imgur.com/TIqr6.jpg" alt="Upgrading to ARC" /></p>
<h2>Further Reading</h2>
<p>This is just a preview of the changes that come with ARC. There are plenty of little nuances that you can read about in the articles below:<br />
<a href="http://clang.llvm.org/docs/AutomaticReferenceCounting.html" title="Technical Specification of ARC">Technical specification of ARC</a><br />
<a href="https://developer.apple.com/library/ios/#releasenotes/ObjectiveC/RN-TransitioningToARC/_index.html" title="Transition to ARC">Transition to ARC release notes</a></p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/ios-5-automatic-reference-counting-arc/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Free Video: iOS Controls &#8211; UIButton: Part 1</title>
		<link>http://thinkvitamin.com/code/ios/free-video-ios-controls-uibutton-part-1/</link>
		<comments>http://thinkvitamin.com/code/ios/free-video-ios-controls-uibutton-part-1/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 17:37:43 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17574</guid>
		<description><![CDATA[In this 8 minute video, you will learn about the class UIButton which intercepts touch events and sends a message to an object. We will look at its properties and various types of buttons we can create. This video is from Treehouse, a high-quality video training site with hundreds of short videos on topics like &#8230; [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://teamtreehouse.com/library/ios-4-foundations/controls/uibutton-part-1/play?cid=193">8 minute video</a>, you will learn about the class UIButton which intercepts touch events and sends a message to an object. We will look at its properties and various types of buttons we can create.</p>
<p><a href="http://teamtreehouse.com/library/ios-4-foundations/controls/uibutton-part-1/play?cid=193"><img src="http://i.imgur.com/49VJ5.jpg" /></a></p>
<p>This video is from <a href="http://teamtreehouse.com/?cid=193">Treehouse</a>, a high-quality video training site with hundreds of short videos on topics like &#8230;</p>
<ul>
<li><a href="http://teamtreehouse.com/library/accessibility/?cid=193">Accessibility</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css3?cid=193">CSS3</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/aesthetic-foundations?cid=193">Aesthetic Foundations</a></li>
<li><a href="http://teamtreehouse.com/library/django/?cid=193">Django</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/html/?cid=193">HTML</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css-foundations/?cid=193">CSS</a></li>
<li><a href="http://teamtreehouse.com/library/html5-foundations/?cid=193">HTML5</a></li>
<li><a href="http://teamtreehouse.com/library/ios-4-foundations/?cid=193">iOS Development</a></li>
<li><a href="http://teamtreehouse.com/library/javascript/?cid=193">JavaScript</a></li>
<li><a href="http://teamtreehouse.com/library/jquery/?cid=193">jQuery</a></li>
<li><a href="http://teamtreehouse.com/library/nosql/?cid=193">NoSQL</a></li>
<li><a href="http://teamtreehouse.com/library/php/?cid=193">PHP</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/rwd-foundations/?cid=193">Responsive Web Design</a></li>
<li><a href="http://teamtreehouse.com/library/ruby/?cid=193">Ruby</a></li>
<li><a href="http://teamtreehouse.com/library/ruby-on-rails/?cid=193">Ruby on Rails</a></li>
<li><a href="http://teamtreehouse.com/library/archive/ux-foundations/?cid=193">UX</a></li>
<li><a href="http://teamtreehouse.com/library/version-control?cid=193">Version Control</a></li>
<li><a href="http://teamtreehouse.com/library/wordpress?cid=193">WordPress Theme Design</a></li>
</ul>
<p>New videos are added regularly, so it&#8217;s a great way to stay up-to-date on all the latest technology and methods. Browse the entire <a href="http://teamtreehouse.com/library/?cid=193">library of videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/free-video-ios-controls-uibutton-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Should we still be using the &#8220;file&#8221; convention?</title>
		<link>http://thinkvitamin.com/code/ruby-on-rails/should-we-still-be-using-the-file-convention/</link>
		<comments>http://thinkvitamin.com/code/ruby-on-rails/should-we-still-be-using-the-file-convention/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 15:40:06 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17564</guid>
		<description><![CDATA[Josh Susser has brought up an interesting point on his blog regarding file and naming conventions of projects. Josh uses the Makefile as the beginning example and points out that we&#8217;re past the point where we need to worry about being limited to 8 characters in filenames. Further, file names like Capfile, Gemfile, etc. are [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.hasmanythrough.com">Josh Susser</a> has brought up an interesting point on his blog regarding <a href="http://blog.hasmanythrough.com/2011/12/1/i-heard-you-liked-files">file and naming conventions</a> of projects. Josh uses the <code>Makefile</code> as the beginning example and points out that we&#8217;re past the point where we need to worry about being limited to 8 characters in filenames. Further, file names like <code>Capfile</code>, <code>Gemfile</code>, etc. are not very descriptive. He says:</p>
<blockquote><p>
<em>Just because your configuration file&#8217;s contents are written in a DSL does not mean you should pretend it&#8217;s not Ruby anymore.</em>
</p></blockquote>
<p>Personally, I agree with Mr. Susser on every point except the <code>Rakefile</code>, since the original intention of rake is to be Ruby&#8217;s version of make. However, rake does support the <code>Rakefile.rb</code> convention as well as a couple of variants. What do you think? Let us know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ruby-on-rails/should-we-still-be-using-the-file-convention/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Path Menu in CSS3</title>
		<link>http://thinkvitamin.com/design/user-interface/path-menu-in-css3/</link>
		<comments>http://thinkvitamin.com/design/user-interface/path-menu-in-css3/#comments</comments>
		<pubDate>Thu, 08 Dec 2011 14:00:14 +0000</pubDate>
		<dc:creator>Nick Pettit</dc:creator>
				<category><![CDATA[CSS3]]></category>
		<category><![CDATA[User Interface]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17528</guid>
		<description><![CDATA[Many of the people that I follow on Twitter have been falling in love with Path, a social networking app for iOS devices. I can understand why; the UI is very fun to use. Whenever I see great UI in a native application on a mobile device or a desktop, I always imagine how that [...]]]></description>
			<content:encoded><![CDATA[<p>Many of the people that I follow on Twitter have been falling in love with Path, a social networking app for iOS devices. I can understand why; the UI is very fun to use.<br />
<span id="more-17528"></span></p>
<p>Whenever I see great UI in a native application on a mobile device or a desktop, I always imagine how that might translate to the web. That&#8217;s why I was so happy to see <a href="http://lab.victorcoulon.fr/css/path-menu/">the Path menu UI recreated in CSS3</a>! Mad props to <a href="https://twitter.com/#!/_victa">Victor</a> for putting this together.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/design/user-interface/path-menu-in-css3/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dependency management for iOS</title>
		<link>http://thinkvitamin.com/code/ios/dependency-management-for-ios/</link>
		<comments>http://thinkvitamin.com/code/ios/dependency-management-for-ios/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 16:34:14 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17381</guid>
		<description><![CDATA[As an iOS developer you have probably used third-party libraries or custom controls in your iOS project. At first, it seems easy, just drop in some files, link a library and you are done. You don&#8217;t feel the pain until you have to go back and upgrade your project either for a new version of [...]]]></description>
			<content:encoded><![CDATA[<p>As an iOS developer you have probably used third-party libraries or <a href="http://cocoacontrols.com/" title="Custom Cocoa Controls">custom controls</a> in your iOS project. At first, it seems easy, just drop in some files, link a library and you are done. You don&#8217;t feel the pain until you have to go back and upgrade your project either for a new version of iOS or the library. Multiply this with several projects, each with several third party libraries and you are dealing with a mess that sucks more time than you ever needed. </p>
<p>Now not only is there a solution to this problem but there are two solutions to choose from. </p>
<h2>CocoaPods</h2>
<p><a href="https://github.com/CocoaPods/CocoaPods" title="CocoaPods ">CocoaPods</a> has been around for quite some time and garnered a lot of community support. Basically, you create a <a href="https://github.com/CocoaPods/CocoaPods/wiki/A-Podfile" title="Podfile">Podfile</a> that lists all your project dependencies in one text file. You then run a command line tool to install the dependencies which  looks for a <a href="https://github.com/CocoaPods/CocoaPods/wiki/A-pod-specification" title="Pod spec file">Pod</a>, a spec file containing information about each library, based on the Pod it fetches the source code and adds the dependency to your Xcode workspace in a separate project. </p>
<h2>VendorKit</h2>
<p><a href="http://vendorkit.com/" title="VendorKit">VendorKit</a> is fairly new and takes a slightly different approach. Once again you create a text file with all your project dependencies and then run a command line tool. Here’s where the difference becomes obvious: Cocoapods use standardized Podfiles that contain the names of libraries and probably version numbers which, in turn, fetches a Pod detailing information about each library. With VendorKit, you specify the library name, where it&#8217;s located, and if it has other dependencies. There is no standardization. There is a vendor spec file, but it&#8217;s only required if the library has other third-party dependencies. Other than that, it delivers on its promise, helping you manage your dependencies.</p>
<p>Both approaches have their own merit and and it all depends on your requirements and workflow.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/dependency-management-for-ios/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>An Introduction To RSpec</title>
		<link>http://thinkvitamin.com/code/ruby-on-rails/an-introduction-to-rspec/</link>
		<comments>http://thinkvitamin.com/code/ruby-on-rails/an-introduction-to-rspec/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 15:33:33 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17534</guid>
		<description><![CDATA[In the Ruby world, we have a few different testing libraries. One of the ones that has gained a lot of popularity and use is rspec. RSpec takes a slightly different approach to the idea of testing applications, by testing behavior rather than only specific methods. I thought I&#8217;d take some time to show everyone [...]]]></description>
			<content:encoded><![CDATA[<p>In the Ruby world, we have a few different testing libraries. One of the ones that has gained a lot of popularity and use is <a href="https://github.com/rspec/">rspec</a>. RSpec takes a slightly different approach to the idea of testing applications, by testing behavior rather than only specific methods. I thought I&#8217;d take some time to show everyone why rspec is so useful in testing your applications.</p>
<p><span id="more-17534"></span></p>
<h4>The Basics</h4>
<p>RSpec gives you a way to encapsulate what you&#8217;re testing via the <code>describe</code> block, and it&#8217;s friend <code>context</code>. In a general unit testing sense, we use <code>describe</code> to describe the behavior of a class:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe <span style="color:#CC00FF; font-weight:bold;">Hash</span> <span style="color:#9966CC; font-weight:bold;">do</span>
&nbsp;
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Tests are written using the <code>it</code> block. Here&#8217;s an example of how you might write a spec for the <code>Hash</code> class:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe <span style="color:#CC00FF; font-weight:bold;">Hash</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  it <span style="color:#996600;">&quot;should return a blank instance&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#CC00FF; font-weight:bold;">Hash</span>.<span style="color:#9900CC;">new</span>.<span style="color:#9900CC;">should</span> == <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>Those are the basics of writing some rspec examples. You can run the above by installing rspec via <code>gem install rspec</code> and putting that code in a file called <code>hash_spec.rb</code> and typing:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rspec hash_spec.rb</pre></div></div>

<p>You should see something like the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.
&nbsp;
Finished <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000;">0.11021</span> seconds
<span style="color: #000000;">1</span> example, <span style="color: #000000;">0</span> failures</pre></div></div>

<p>You can set up test state using the <code>before</code> and <code>after</code> directives. This will apply to anything in your describe block:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe <span style="color:#CC00FF; font-weight:bold;">Hash</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  before <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#0066ff; font-weight:bold;">@hash</span> = <span style="color:#CC00FF; font-weight:bold;">Hash</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#123;</span>:hello <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#996600;">'world'</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  it <span style="color:#996600;">&quot;should return a blank instance&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#CC00FF; font-weight:bold;">Hash</span>.<span style="color:#9900CC;">new</span>.<span style="color:#9900CC;">should</span> == <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  it <span style="color:#996600;">&quot;hash the correct information in a key&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    <span style="color:#0066ff; font-weight:bold;">@hash</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:hello</span><span style="color:#006600; font-weight:bold;">&#93;</span>.<span style="color:#9900CC;">should</span> == <span style="color:#996600;">'world'</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The above code will create the <code>@hash</code> variable before each test is run. There are two arguments for before&#8211; <code>all</code> and <code>each</code>. Using the <code>all</code> argument, the setup will be done once before all of the tests in the block, and <code>:each</code> will be done before each individual test. The <code>after</code> directive has the same options and runs the same way, only after tests are completed. This is most useful when tearing down the previous state of the tests.</p>
<h4>RSpec Idioms</h4>
<p>We usually use the <code>describe</code> keyword to describe methods. Using a &#8220;.&#8221; will signify that you&#8217;re testing a class method, and using &#8220;#&#8221; will signify that it&#8217;s an instance method. Here&#8217;s how it might look for a made up class:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe MyClass <span style="color:#9966CC; font-weight:bold;">do</span>
  describe <span style="color:#996600;">&quot;.class_method_1&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  describe <span style="color:#996600;">&quot;#instance_method_1&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>The <code>context</code> method does the same thing by letting you contextualize a block of your tests. This is extremely powerful for test states when you add more complicated setup and teardown code to really get in to your objects. I&#8217;ll show you a bit more of a real life scenario by building a delicious burger class.</p>
<p><img src="http://thinkvitamin.com/wp-content/uploads/2011/12/a-delicious-burger.jpg" alt="A Delicious Burger" title="A Delicious Burger" width="704" height="478" class="alignnone size-full wp-image-17538" /></p>
<p>Let&#8217;s say that in our <code>Burger</code> class we&#8217;re trying to test the <code>#apply_ketchup</code> method. Someone may not want ketchup on their burger. Instead of judging them, we&#8217;ll write a test for the class to not apply ketchup if someone doesn&#8217;t want it:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe Burger <span style="color:#9966CC; font-weight:bold;">do</span>
  describe <span style="color:#996600;">&quot;#apply_ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    context <span style="color:#996600;">&quot;with ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      before <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#0066ff; font-weight:bold;">@burger</span> = Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#0066ff; font-weight:bold;">@burger</span>.<span style="color:#9900CC;">apply_ketchup</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      it <span style="color:#996600;">&quot;sets the ketchup flag to true&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#0066ff; font-weight:bold;">@burger</span>.<span style="color:#9900CC;">has_ketchup_on_it</span>?.<span style="color:#9900CC;">should</span> be_true
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    context <span style="color:#996600;">&quot;without ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      before <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#0066ff; font-weight:bold;">@burger</span> = Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span>
        <span style="color:#0066ff; font-weight:bold;">@burger</span>.<span style="color:#9900CC;">apply_ketchup</span>
      <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
      it <span style="color:#996600;">&quot;sets the ketchup flag to false&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        <span style="color:#0066ff; font-weight:bold;">@burger</span>.<span style="color:#9900CC;">has_ketchup_on_it</span>?.<span style="color:#9900CC;">should</span> be_false
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<h4>Cleaning Up a Bit</h4>
<p>The above pattern works but can become a bit tiresome to repeat all the time. RSpec gives us some helper methods to generalize it. We could rewrite the above using the <cod>let</cod> keyword to make the the variable automatically. The variable would then get created the first time it is accessed:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe Burger <span style="color:#9966CC; font-weight:bold;">do</span>
  describe <span style="color:#996600;">&quot;#apply_ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    context <span style="color:#996600;">&quot;with ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      let<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:burger</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      before  <span style="color:#006600; font-weight:bold;">&#123;</span> burger.<span style="color:#9900CC;">apply_ketchup</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
      it <span style="color:#996600;">&quot;sets the ketchup flag to true&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        burger.<span style="color:#9900CC;">has_ketchup_on_it</span>?.<span style="color:#9900CC;">should</span> be_true
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    context <span style="color:#996600;">&quot;without ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      let<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:burger</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
      before  <span style="color:#006600; font-weight:bold;">&#123;</span> burger.<span style="color:#9900CC;">apply_ketchup</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
      it <span style="color:#996600;">&quot;sets the ketchup flag to false&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
        burger.<span style="color:#9900CC;">has_ketchup_on_it</span>?.<span style="color:#9900CC;">should</span> be_false
      <span style="color:#9966CC; font-weight:bold;">end</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>This all works but we can clean it up even further using the <code>subject</code> method. The <code>subject</code> method tells rspec what we&#8217;re doing the tests on.  We&#8217;re going to combine that with the <code>specify</code> method in the next example. The <code>specify</code> method is just like the <code>it</code> method except the <code>specify</code> method takes the code block as the description of the test:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">describe Burger <span style="color:#9966CC; font-weight:bold;">do</span>
  describe <span style="color:#996600;">&quot;#apply_ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    subject <span style="color:#006600; font-weight:bold;">&#123;</span> burger <span style="color:#006600; font-weight:bold;">&#125;</span>
    before  <span style="color:#006600; font-weight:bold;">&#123;</span> burger.<span style="color:#9900CC;">apply_ketchup</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
    context <span style="color:#996600;">&quot;with ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      let<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:burger</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
      specify <span style="color:#006600; font-weight:bold;">&#123;</span> subject.<span style="color:#9900CC;">has_ketchup_on_it</span>?.<span style="color:#9900CC;">should</span> be_true <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    context <span style="color:#996600;">&quot;without ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      let<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:burger</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
      specify <span style="color:#006600; font-weight:bold;">&#123;</span> subject.<span style="color:#9900CC;">has_ketchup_on_it</span>?.<span style="color:#9900CC;">should</span> be_false <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<p>One neat thing about rspec is that the built in matchers will let you declaratively specify methods in your tests if they conform to a certain naming convention. RSpec will look for methods that are named with <code>has</code> and end in a question mark to let you do write declarative test code. Here&#8217;s what our final Burger class will look like using that idiom.  Put the following in a file called <code>burger_spec.rb</code> and run it:</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#9966CC; font-weight:bold;">class</span> Burger
  attr_reader <span style="color:#ff3333; font-weight:bold;">:options</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> initialize<span style="color:#006600; font-weight:bold;">&#40;</span>options=<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
    <span style="color:#0066ff; font-weight:bold;">@options</span> = options
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> apply_ketchup
    <span style="color:#0066ff; font-weight:bold;">@ketchup</span> = <span style="color:#0066ff; font-weight:bold;">@options</span><span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span><span style="color:#006600; font-weight:bold;">&#93;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> has_ketchup_on_it?
    <span style="color:#0066ff; font-weight:bold;">@ketchup</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
&nbsp;
describe Burger <span style="color:#9966CC; font-weight:bold;">do</span>
  describe <span style="color:#996600;">&quot;#apply_ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    subject <span style="color:#006600; font-weight:bold;">&#123;</span> burger <span style="color:#006600; font-weight:bold;">&#125;</span>
    before  <span style="color:#006600; font-weight:bold;">&#123;</span> burger.<span style="color:#9900CC;">apply_ketchup</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
    context <span style="color:#996600;">&quot;with ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      let<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:burger</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
      it <span style="color:#006600; font-weight:bold;">&#123;</span> should have_ketchup_on_it <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
    context <span style="color:#996600;">&quot;without ketchup&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      let<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:burger</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#123;</span> Burger.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:ketchup</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">false</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;
      it <span style="color:#006600; font-weight:bold;">&#123;</span> should_not have_ketchup_on_it <span style="color:#006600; font-weight:bold;">&#125;</span>
    <span style="color:#9966CC; font-weight:bold;">end</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>

<h4>A Burger Needs More Than Just Ketchup</h4>
<p>In this brief tutorial we jumped in to rspec and created a burger class. Then we refactored our tests a bit to make them more idiomatic. What we wound up with was easier to read and quick to run. In the next tutorials in this series, we&#8217;ll delve deeper in to rspec including more idioms, further testing, and writing our own matchers. For now, <a href="http://megayummo.com/2011/06/22/db-bistro-moderne/">I know what I&#8217;m having for lunch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ruby-on-rails/an-introduction-to-rspec/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Free Video: HTML Inputs</title>
		<link>http://thinkvitamin.com/code/free-video-html-inputs/</link>
		<comments>http://thinkvitamin.com/code/free-video-html-inputs/#comments</comments>
		<pubDate>Tue, 06 Dec 2011 14:00:04 +0000</pubDate>
		<dc:creator>Nick Pettit</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17385</guid>
		<description><![CDATA[In this 10 minute video, you will learn the basics of the HTML input element, which allows for a variety of form elements. This video is from Treehouse, a high-quality video training site with hundreds of short videos on topics like &#8230; Accessibility CSS3 Aesthetic Foundations Django HTML CSS HTML5 iOS Development JavaScript jQuery NoSQL PHP [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://teamtreehouse.com/library/design-foundations/html/forms/inputs/play?cid=193">10 minute video</a>, you will learn the basics of the HTML input element, which allows for a variety of form elements.</p>
<p><a href="http://teamtreehouse.com/library/design-foundations/html/forms/inputs/play?cid=193"><img src="http://i.imgur.com/9u7rz.png" /></a></p>
<p>This video is from <a href="http://teamtreehouse.com/?cid=193">Treehouse</a>, a high-quality video training site with hundreds of short videos on topics like &#8230;</p>
<ul>
<li><a href="http://teamtreehouse.com/library/accessibility/?cid=193">Accessibility</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css3?cid=193">CSS3</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/aesthetic-foundations?cid=193">Aesthetic Foundations</a></li>
<li><a href="http://teamtreehouse.com/library/django/?cid=193">Django</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/html/?cid=193">HTML</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/css-foundations/?cid=193">CSS</a></li>
<li><a href="http://teamtreehouse.com/library/html5-foundations/?cid=193">HTML5</a></li>
<li><a href="http://teamtreehouse.com/library/ios-4-foundations/?cid=193">iOS Development</a></li>
<li><a href="http://teamtreehouse.com/library/javascript/?cid=193">JavaScript</a></li>
<li><a href="http://teamtreehouse.com/library/jquery/?cid=193">jQuery</a></li>
<li><a href="http://teamtreehouse.com/library/nosql/?cid=193">NoSQL</a></li>
<li><a href="http://teamtreehouse.com/library/php/?cid=193">PHP</a></li>
<li><a href="http://teamtreehouse.com/library/design-foundations/rwd-foundations/?cid=193">Responsive Web Design</a></li>
<li><a href="http://teamtreehouse.com/library/ruby/?cid=193">Ruby</a></li>
<li><a href="http://teamtreehouse.com/library/ruby-on-rails/?cid=193">Ruby on Rails</a></li>
<li><a href="http://teamtreehouse.com/library/archive/ux-foundations/?cid=193">UX</a></li>
<li><a href="http://teamtreehouse.com/library/version-control?cid=193">Version Control</a></li>
<li><a href="http://teamtreehouse.com/library/wordpress?cid=193">WordPress Theme Design</a></li>
</ul>
<p>New videos are added regularly, so it&#8217;s a great way to stay up-to-date on all the latest technology and methods. Browse the entire <a href="http://teamtreehouse.com/library/?cid=193">library of videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/free-video-html-inputs/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Jbuilder, Rspec 2.8.0, Ruby 2.0</title>
		<link>http://thinkvitamin.com/code/ruby-on-rails/ruby-news-updates-1252011/</link>
		<comments>http://thinkvitamin.com/code/ruby-on-rails/ruby-news-updates-1252011/#comments</comments>
		<pubDate>Mon, 05 Dec 2011 15:00:37 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17370</guid>
		<description><![CDATA[There&#8217;s always a lot going on in the Ruby and Rails communities! Here&#8217;s some recent news from the communities: Jbuilder is a DSL for declaring JSON structures, created by DHH (creator of Rails). It lets you declaratively build your JSON output similarly to how Builder works for xml. It&#8217;s currently in the rails user account [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s always a lot going on in the Ruby and Rails communities! Here&#8217;s some recent news from the communities:</p>
<p><span id="more-17370"></span></p>
<ul>
<li><a href="https://github.com/rails/jbuilder">Jbuilder</a> is a DSL for declaring JSON structures, created by DHH (creator of Rails). It lets you declaratively build your JSON output similarly to how Builder works for xml. It&#8217;s currently in the rails user account on GitHub and it may make an appearance in Rails 3.2.</li>
<li><a href="http://blog.davidchelimsky.net/2011/11/06/rspec-280rc1-is-released/">Rspec 2.8.0 rc1</a> has been released with some interesting additions to <code>rspec-core</code> and <code>rspec-mocks</code>. Some of the highlights including running examples in random order, the ability to add custom profile options files, and being able to filter example groups from the command line.</li>
<li>Finally, there&#8217;s been talk of <a href="http://www.rubyinside.com/the-ruby-standard-library-to-be-converted-to-gems-for-ruby-2-0-5586.html?utm_source=rubyweekly&#038;utm_medium=email">converting the Ruby standard library to gems</a> for Ruby 2.0. It&#8217;s mostly discussion at this point but that could be an interesting move as it would not require loading the whole standard library for every Ruby program. Additionally, updates to the standard library could come out much quicker than the typical Ruby interpreter release cycle.</li>
</ul>
<p>What are your thoughts on all this? Have any interesting Ruby news to share? Let us know in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ruby-on-rails/ruby-news-updates-1252011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iOS Design Patterns: Model View Controller (Part 3)</title>
		<link>http://thinkvitamin.com/code/ios/ios-design-patterns-model-view-controller-part-3/</link>
		<comments>http://thinkvitamin.com/code/ios/ios-design-patterns-model-view-controller-part-3/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 14:44:36 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>
		<category><![CDATA[design patterns]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17003</guid>
		<description><![CDATA[The third installment in the multi-part series covering the various design patterns used in iOS. The Model View Controller (MVC) design pattern separates aspects of an application into three distinct parts and defines how the three communicate. As the name implies the application is divided into three distinct parts: Model, View and Controller. The main [...]]]></description>
			<content:encoded><![CDATA[<p>The third installment in the multi-part series covering the various design patterns used in iOS. The Model View Controller (MVC) design pattern separates aspects of an application into three distinct parts and defines how the three communicate.</p>
<p><span id="more-17003"></span></p>
<p><img src="http://i.imgur.com/0feAC.jpg" alt="Model View Controller" /></p>
<p>As the name implies the application is divided into three distinct parts: Model, View and Controller. The main purpose for MVC is reusability where you can reuse the same model for different views.</p>
<h2>Model</h2>
<p>The model contains the data. For example, a <code>Book</code> object contains information regarding the book such as: title and author. In addition, the Book object could be related to other objects establishing a one-to-one or one-to-many relationship. For example, the <code>Book</code> object could relate to a <code>Category</code> object, wherein one <code>Category</code> can contain multiple <code>Book</code> objects. The model objects obtain data either from a database or files, which could be located locally or externally. The model does not talk directly to a view, instead is made available to a controller which accesses it when needed. In iOS, a model is usually a subclass of <code>NSObject</code> or in the case of Core Data (an iOS framework that helps save data to a database locally on the device) <code>NSManagedObject</code>. As with any model object it contains instance variables and getter / setter methods. Most object-oriented languages have a mechanism to provide <a href="http://en.wikipedia.org/wiki/Encapsulation_(object-oriented_programming)" title="Encapsulation">encapsulation</a>, in iOS a <code>property</code> provides encapsulation and the keyword <code>synthesize</code> automatically generates the getter and setter methods.  In the case of <code>Book</code> you would have methods such as <code>getTitle</code> and <code>setTitle</code> or <code>getAuthor</code> and <code>setAuthor</code>.</p>
<p><img src="http://i.imgur.com/XC83j.jpg" alt="Model" /></p>
<h2>View</h2>
<p>The view displays information contained in the model. For example, the view could display a list of <code>Books</code> as mentioned in the above example. Although the view does not obtain the information directly from the model, it uses the controller as a mediator which instructs it when and what to display. In iOS, most views subclass from <code>UIView</code> which provides the capability for handling touch events and drawing. The UIKit framework contains classes to draw typical interface elements such as tables (lists), buttons, textfields, sliders and more. Below is a list of books displayed using the class <code>UITableView</code>.</p>
<p><img src="http://i.imgur.com/YwQ3v.jpg" alt="List of books using UITableView " /></p>
<h2>Controller</h2>
<p>Finally, the controller is responsible for accessing data from the model and displaying it on the view. The same controller can be used to intermediate between several views and models. The controller monitors user interaction with the view and communicates any changes to the model. On the other hand, changes to the model are observed by the controller and subsequently reflected in the view. The controller is also where most of the application lies. In iOS, the controller is generally a subclass of <code>UIViewController</code> that manages a view, it is also responsible for responding to <a href="http://thinkvitamin.com/code/ios/ios-design-patterns-delegation-part-2/" title="Delegation">delegation</a> messages and <a href="http://thinkvitamin.com/code/ios/ios-design-patterns-target-action-part-1/" title="Target-action">target-action</a> messages. Below you have a <code>UITableViewController</code> which is a subclass of <code>UIViewController</code> that manages a <code>UITableView</code>.</p>
<p><img src="http://i.imgur.com/Hfx1o.jpg" alt="Model-View-Controller in iOS" /></p>
<h3>Related posts</h3>
<p>Check out the other posts in this series:<br />
<a href="http://thinkvitamin.com/code/ios/ios-design-patterns-target-action-part-1/" title="iOS design patterns">iOS Design Patterns: Target-action (Part 1)</a><br />
<a href="http://thinkvitamin.com/code/ios/ios-design-patterns-delegation-part-2/" title="iOS Design Patterns: Delegation (Part 2)">iOS Design Patterns: Delegation (Part 2)</a></p>
<p>If you are interested in learning more do check out the <a href="http://teamtreehouse.com/">iOS development</a> course.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/ios-design-patterns-model-view-controller-part-3/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Installing Ruby, Rails, and MySQL on OS X Lion</title>
		<link>http://thinkvitamin.com/code/ruby-on-rails/installing-ruby-rails-and-mysql-on-os-x-lion/</link>
		<comments>http://thinkvitamin.com/code/ruby-on-rails/installing-ruby-rails-and-mysql-on-os-x-lion/#comments</comments>
		<pubDate>Wed, 23 Nov 2011 14:00:21 +0000</pubDate>
		<dc:creator>Jason Seifer</dc:creator>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[rails3]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[rubyonrails]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17055</guid>
		<description><![CDATA[Hi, folks! What&#8217;s new? Not much here, either. Just hanging out on Treehouse Island. How have you been? How are things? Things are good here, too. What&#8217;s that? You want to install the latest versions of Ruby, Rails, and MySQL on Lion? Ok, that&#8217;s cool, we can do that instead of watching the latest Twilight [...]]]></description>
			<content:encoded><![CDATA[<p>Hi, folks! What&#8217;s new? Not much here, either. Just hanging out on Treehouse Island. How have you been? How are things? Things are good here, too. What&#8217;s that? You want to install the latest versions of Ruby, Rails, and MySQL on Lion? Ok, that&#8217;s cool, we can do that instead of watching the latest Twilight movie. No problem.</p>
<p><span id="more-17055"></span></p>
<p>We&#8217;re going to be using <a href="http://mxcl.github.com/homebrew/">homebrew</a> and <a href="https://rvm.beginrescueend.com/">rvm</a> to get this all up and running. This is a bit of an opinionated method of getting everything installed. There are several ways of installing a modern Ruby and Rails environment and in the end, they all get you to the same place. Another popular option for getting ruby up and running is <a href="https://github.com/sstephenson/ruby-build">ruby-build</a> and <a href="https://github.com/sstephenson/rbenv">rbenv</a>.</p>
<p>For the purposes of getting everything up and running quickly, I find rvm to be a bit easier to use and explain so I&#8217;m going to use that. Another quick note: while these instructions are written for Lion, they should also work on Snow Leopard, particularly the osx-gcc-installer instructions.</p>
<h2 id="installdevelopertools">Install Developer Tools</h2>
<p>Before we install either Homebrew or rvm, we need to have a compiler installed. Xcode happens to come with one. Open up the App Store and type &#8220;Xcode&#8221; in to the search box. Click install. This is a large download so go ahead and get some coffee or catch up on the latest meme on Reddit.</p>
<p><a href="http://thinkvitamin.com/code/ruby-on-rails/installing-ruby-rails-and-mysql-on-os-x-lion/attachment/xcode-704/" rel="attachment wp-att-17078"><img src="http://thinkvitamin.com/wp-content/uploads/2011/11/Xcode-704.jpg" alt="Xcode in the Mac App Store" title="Xcode-704" width="704" height="632" class="alignnone size-full wp-image-17078" /></a></p>
<p>Another option is to use the <a href="https://github.com/kennethreitz/osx-gcc-installer">osx-gcc-installer</a>. This doesn&#8217;t install the Developer Tools from Apple, only the compiler. The instructions that follow <em>should</em> work with only that installed but I haven&#8217;t tested it. Besides, you&#8217;ll probably want to have the full developer tools installed so you can unlock the iOS foundations badge on <a href="http://teamtreehouse.com">Treehouse</a>.</p>
<h2 id="installhomebrew">Install Homebrew</h2>
<p><a href="http://mxcl.github.com/homebrew/">Homebrew</a> is &#8220;The missing package manager for OS X.&#8221; The other big package manager available on OS X is called <a href="http://www.macports.org/">MacPorts</a>. It&#8217;s also very good but we&#8217;re going to use Homebrew for the purposes of this article.</p>
<h4 id="warning">A Word of Warning</h4>
<p>The instructions that follow run a shell script directly from a web site that you are not in control of. This is generally considered a Bad Thing™ and in general, you should at least review what the script is doing before you run it. We&#8217;re going to have to trust each other and the homebrew team that the script does what it&#8217;s supposed to do. Always think twice when you see something like this, though.</p>
<p>Nevertheless, we&#8217;re going to trust the homebrew team and run this script. I&#8217;ve run this several times before and it&#8217;s not like it&#8217;s a comment thread on YouTube.</p>
<h4>Moving On</h4>
<p>Open up the Terminal application that comes with OS X. This should be inside the &#8220;Utilities&#8221; folder in your main &#8220;Applications&#8221; folder. Type the following:</p>
<p><code>/usr/bin/ruby -e &quot;$(curl -fsSL https://raw.github.com/gist/323731)&quot;</code></p>
<p>You should see a bunch of text going by at this point and having it seem like something is installing. If you see any error messages, double check to make sure that you&#8217;ve installed the Developer Tools correctly.</p>
<h2 id="installgit">Install Git</h2>
<p>This part should go by pretty quickly. Open up a terminal and type the following:</p>
<p><code>brew install git</code></p>
<p>You should now have git installed. You can verify by typing the following:</p>
<p><code>git --version</code></p>
<p>You should see:</p>
<p><code>git version 1.7.7.2</code></p>
<p>That&#8217;s the latest version of git as of this writing. If you don&#8217;t see something similar, double check that you&#8217;ve correctly installed the Developer Tools and Homebrew above.</p>
<h2 id="installmysql">Install MySQL</h2>
<p>Now that you&#8217;ve got Homebrew installed, installing MySQL is pretty easy. In the same terminal, type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">brew <span style="color: #c20cb9; font-weight: bold;">install</span> mysql</pre></div></div>

<p>Again, you should see a bunch of text going by saying things like &#8220;Downloading,&#8221; &#8220;Patching,&#8221; &#8220;make&#8221; and the like. After it finishes, you should see a bunch of instructions. Let&#8217;s follow them, still in terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">mysql_install_db <span style="color: #660033;">--verbose</span> <span style="color: #660033;">--basedir</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$(brew --prefix mysql)</span>&quot;</span> <span style="color: #660033;">--datadir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">--tmpdir</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchAgents
<span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>Cellar<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span>5.5.15<span style="color: #000000; font-weight: bold;">/</span>com.mysql.mysqld.plist ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchAgents<span style="color: #000000; font-weight: bold;">/</span>
launchctl load <span style="color: #660033;">-w</span> ~<span style="color: #000000; font-weight: bold;">/</span>Library<span style="color: #000000; font-weight: bold;">/</span>LaunchAgents<span style="color: #000000; font-weight: bold;">/</span>com.mysql.mysqld.plist</pre></div></div>

<p>That should install mysql to run on startup of your system. Test it with the following at the command prompt:</p>
<p><em>Note: The dollar sign in front of the mysql command denotes that we are at a shell inside of the terminal. It is not necessary to type it.</em></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ mysql <span style="color: #660033;">-uroot</span></pre></div></div>

<p>You should see the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection <span style="color: #c20cb9; font-weight: bold;">id</span> is <span style="color: #000000;">75</span>
Server version: 5.5.15 Source distribution
&nbsp;
Copyright <span style="color: #7a0874; font-weight: bold;">&#40;</span>c<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">2000</span>, <span style="color: #000000;">2010</span>, Oracle and<span style="color: #000000; font-weight: bold;">/</span>or its affiliates. All rights reserved.
&nbsp;
Oracle is a registered trademark of Oracle Corporation and<span style="color: #000000; font-weight: bold;">/</span>or its
affiliates. Other names may be trademarks of their respective
owners.
&nbsp;
Type <span style="color: #ff0000;">'help;'</span> or <span style="color: #ff0000;">'\h'</span> <span style="color: #000000; font-weight: bold;">for</span> help. Type <span style="color: #ff0000;">'\c'</span> to <span style="color: #c20cb9; font-weight: bold;">clear</span> the current input statement.
&nbsp;
mysql<span style="color: #000000; font-weight: bold;">&gt;</span></pre></div></div>

<p>If you don&#8217;t see that, something went wrong in the install. Double check the instructions above and try again. Type &#8220;quit;&#8221; to exit the prompt.</p>
<p>Congratulations! You&#8217;ve installed msyql.</p>
<h2 id="installrvm">Install RVM</h2>
<p><a href="https://rvm.beginrescueend.com/">RVM</a> is the Ruby Version Manager. It lets you easily switch between different versions of Ruby on the command line. Remember what I told you a few paragraphs above about not running untrusted shell scripts? We&#8217;re going to do it again. Open up terminal again and type the following to install rvm:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">bash</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">&lt;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>curl <span style="color: #660033;">-s</span> https:<span style="color: #000000; font-weight: bold;">//</span>raw.github.com<span style="color: #000000; font-weight: bold;">/</span>wayneeseguin<span style="color: #000000; font-weight: bold;">/</span>rvm<span style="color: #000000; font-weight: bold;">/</span>master<span style="color: #000000; font-weight: bold;">/</span>binscripts<span style="color: #000000; font-weight: bold;">/</span>rvm-installer<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>That install install rvm. We&#8217;re not done yet, though! Create a new file in your home folder called &#8220;.bash_profile&#8221; and open it using a text editor:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">touch</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_profile
$ open <span style="color: #660033;">-e</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_profile</pre></div></div>

<p>This will open the file in TextEdit. Place the following inside:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PATH</span>=<span style="color: #ff0000;">&quot;./bin:<span style="color: #007800;">$PATH</span>&quot;</span> 
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;/Users/jason/.rvm/scripts/rvm&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #ff0000;">&quot;/Users/jason/.rvm/scripts/rvm&quot;</span></pre></div></div>

<p>Make sure to change <em>jason</em> above with the &#8220;Account name&#8221; on your mac. You can find that by typing the following in to your terminal:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$USER</span></pre></div></div>

<p>In my case it returns <code>jason</code>.</p>
<p>If you already have a <code>.bash_profile</code>, you can add those lines to it at the bottom.</p>
<p>With those things done, you can now close terminal.</p>
<h2 id="installruby">Install Ruby</h2>
<p>In terminal, we need to tell RVM to load the environment we just set up.  With terminal open, type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">source</span> ~<span style="color: #000000; font-weight: bold;">/</span>.bash_profile</pre></div></div>

<p>Now we can install a ruby interpreter:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rvm <span style="color: #c20cb9; font-weight: bold;">install</span> 1.9.3-p0</pre></div></div>

<p>This will install the latest Ruby. At the time of this writing, that is version 1.9.3, patch level 0. This should take a few minutes. Feel free to get back to Reddit as you have already loaded up on coffee by this point.</p>
<p>Once it&#8217;s done, you have installed Ruby! Congratulations!</p>
<p>Now, let&#8217;s tell rvm to use the Ruby we&#8217;ve just installed:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rvm use 1.9.3-p0</pre></div></div>

<p>And we&#8217;ll make sure we&#8217;re using the right version:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ ruby <span style="color: #660033;">-v</span></pre></div></div>

<p>You should now see:</p>
<p><code>ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]</code></p>
<p><strong>Update:</strong> As Ryan Townsend points out in the comments, if you&#8217;d like to use this version of Ruby every time you&#8217;re in a shell, type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rvm use 1.9.3-p0 <span style="color: #660033;">--default</span></pre></div></div>

<p>Thanks, Ryan!</p>
<h2 id="installrails">Install Rails</h2>
<p>Now that we have Ruby installed, let&#8217;s install some gems. First up, we&#8217;re going to want to install bundler which Rails depends on. Let&#8217;s install some gems:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> bundler
$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> mysql2
$ gem <span style="color: #c20cb9; font-weight: bold;">install</span> rails</pre></div></div>

<p>Now that we have rails and bundler installed, we can create our own rails app. Type the following:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ rails new testapp</pre></div></div>

<p>This will create a rails application called &#8220;testapp&#8221; and then run &#8220;bundle install&#8221; inside of it. Congratulations, you are now on the rails!</p>
<h2 id="summary">Summary</h2>
<p>We&#8217;ve gone and installed the latest versions of the Developer Tools, a package manager, git, mysql, ruby, and rails. At this point, we&#8217;re all set to create our own Rails applications. If you&#8217;d like to <a href="http://teamtreehouse.com">learn Ruby</a>, keep an eye on <a href="http://teamtreehouse.com">Treehouse</a>. We&#8217;ll have the Ruby Foundations badge ready to be unlocked real soon now. If you have any questions, let me know in the comments. Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ruby-on-rails/installing-ruby-rails-and-mysql-on-os-x-lion/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
		</item>
		<item>
		<title>Inside Treehouse: Code Challenges</title>
		<link>http://thinkvitamin.com/code/inside-treehouse-code-challenges/</link>
		<comments>http://thinkvitamin.com/code/inside-treehouse-code-challenges/#comments</comments>
		<pubDate>Tue, 22 Nov 2011 15:22:21 +0000</pubDate>
		<dc:creator>Jim Hoskins</dc:creator>
				<category><![CDATA[Code]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=17035</guid>
		<description><![CDATA[Besides creating videos for Treehouse, I got to work on the Code Challenge engine which is used to test your knowledge and skill by writing real code. We decided it would be best to build this application independent of the main Treehouse rails application. I got to choose the tools for the Code Challenges, and [...]]]></description>
			<content:encoded><![CDATA[<p>Besides creating videos for <a href="http://teamtreehouse.com" title="Learn Web Design, Web Development and iOS at Treehouse">Treehouse</a>, I got to work on the Code Challenge engine which is used to test your knowledge and skill by writing real code. We decided it would be best to build this application independent of the main Treehouse rails application. </p>
<p>I got to choose the tools for the Code Challenges, and now I get to share with you what tools I used, why I chose them, and how they worked out. The code challenge is built as two small, independent applications using <a href="http://nodejs.org/" title="Node">NodeJS</a>, <a href="http://dojotoolkit.org/" title="Dojo">Dojo</a>, <a href="http://coffeescript.org/" title="CoffeeScript">CoffeeScript</a>, <a href="http://requirejs.org/" title="RequireJS">RequireJS</a>, <a href="http://couchdb.apache.org/" title="CouchDB">CouchDB</a>, and the <a href="http://ace.ajax.org/" title="Ace">Ace Editor</a>.</p>
<p><span id="more-17035"></span></p>
<p><img src="http://i.imgur.com/YK4Ya.png" alt="Treehouse Code Challenge" /></p>
<h2 id="modularity">Modularity</h2>
<p>There are two major components involved in the Code Challenge tool. One component is the editor interface that you interact with. This is the only component you really see and touch. The other is the component that actually evaluates the code you write to see if it is correct.</p>
<p>I decided to make these two components completely separate applications. The only coupling between them is the editor component calls the test evaluator via a web service. This turned out to be a very good decision, because the two applications have very different resource needs.</p>
<p>The editor application pretty much entirely runs in the web browser. The server for the editor does a very small amount of work. It was able run on a single <a href="http://www.heroku.com/" title="Heroku">Heroku</a> dyno and survive the spike of traffic generated when Treehouse launched.</p>
<p>The code testing application, on the other hand, does a lot of heavy lifting on the server. Because of this, it isn&#8217;t able to run on Heroku, so instead we ended up running it on <a href="http://aws.amazon.com/ec2/" title="Amazon EC2">Amazon EC2</a> instances. Since the testing application is entirely stateless, we are able to fire up multiple instances of the server behind a load balancer. This allowed us to keep challenges up an running as thousands of people began taking challenges.</p>
<p>In this article, I will mainly be talking about what powers the code editor component.</p>
<h2 id="nodejs">NodeJS</h2>
<p><a href="http://nodejs.org/" title="Node">NodeJS</a> powers the application and web servers that run our <a href="http://teamtreehouse.com" title="Learn Web Design, Web Development and iOS at Treehouse">Treehouse</a> Code Challenges. The servers are actually very thin. Besides serving the static assets, the servers mainly act as a proxy to the database and other services. </p>
<p><img src="http://i.imgur.com/Vhn3U.png" alt="NodeJS" /></p>
<p>Node is particularly suited for the task of proxying data because it can handle a lot concurrent connections, since the server is only busy while actually moving the information through the server. The time the connections are idle and waiting can be used to serve other clients.</p>
<h2 id="dojo">Dojo</h2>
<p>The user facing application is a single page JavaScript app. All of the interaction is done on one page, with no reloading or linking to other pages. The user interface makes use of a lot of advanced interface elements including tabs, resizable layouts, and stack layouts. My options were to use <a href="http://jquery.com/" title="jQuery">jQuery</a> and <a href="http://jqueryui.com/" title="jQuery UI">jQuery UI</a> (or a mish-mash of other jQuery plugins), or I could build my own UI elements, or use a more robust library like <a href="http://developer.yahoo.com/yui/" title="YUI">Yahoo&#8217;s YUI</a> or <a href="http://dojotoolkit.org/" title="Dojo">Dojo</a>.</p>
<p>After some prototyping with YUI and Dojo, I decided to use Dojo. It had a larger variety UI Widgets, and seemed like a pretty solid choice. There are a lot of great options I could have chosen, but I chose Dojo because it was new to me, seemed to have a lot of support, and integrated well with the <a href="http://requirejs.org/docs/whyamd.html" title="Why AMD">AMD</a> module pattern that I was using via <a href="http://requirejs.org/" title="RequireJS">RequireJS</a>.</p>
<p>The main drawback is that Dojo&#8217;s documentation can be a bit tricky to navigate, and sometimes I just had to dive into the Dojo source to figure out what was happening. Ultimately I feel confident building with Dojo, but there is definitely a learning curve when you get started.</p>
<h2 id="coffeescript">CoffeeScript</h2>
<p>I have been a fan of <a href="http://coffeescript.org/" title="CoffeeScript">CoffeeScript</a> for a while, but I had yet to use it for a non-trivial project. I decided that I would use CoffeeScript front-to-back. The front-end code is CoffeeScript. The NodeJS server is CoffeeScript. Even the CouchDB design documents are written in CoffeeScript, then translated to JavaScript and saved to the server.</p>
<p>I chose CoffeeScript because I <strong>liked</strong> CoffeeScript, and wanted to find out if using it in a large project would make me <strong>love</strong> it or <strong>hate</strong> it. Well, now I love it. My code is both readable and maintainable and a significant amount of boilerplate code has been removed. The way CoffeeScript handles classes and inheritance made it super convenient to subclass Dojo widgets for the UI. I hope to delve deeper into this in an upcoming article.</p>
<h2 id="requirejs">RequireJS</h2>
<p>Organizing code in JavaScript can be complicated, but in a larger application, proper organization is crucial. Having all of your code in one or two files just isn&#8217;t maintainable. The more you split up your files, the more complicated it gets to include it into your page. You have to make sure all of your files are included in such a way that all dependencies are loaded before they are used.</p>
<p><a href="http://requirejs.org/" title="RequireJS">RequireJS</a> does a phenomenal job at allowing you to split your code in such a way you can have just one class or module per file. RequireJS also includes an optimizer that will combine all your files into a single, minified file for use in production.</p>
<p>RequireJS uses the <a href="http://requirejs.org/docs/whyamd.html" title="Why AMD">Asynchronous Module Definition (AMD)</a> pattern for organizing your code. Dojo also uses such AMD to define it&#8217;s own modules, so you can require specific Dojo dependencies in your project, just like you require any of your own files. This is a huge win since I could keep my code organized in a consistent way.</p>
<p>You can read more about why RequireJS is awesome in my previous article.</p>
<h2 id="couchdb">CouchDB</h2>
<p>When it came to choosing a datastore for the application, I wanted something that would be easy to work with from the front end. I narrowed it down to <a href="http://www.mongodb.org/" title="MongoDB">MongoDB</a> and <a href="http://couchdb.apache.org/" title="CouchDB">CouchDB</a>. I actually built the first prototype with MongoDB, and ended up switching out to Couch.</p>
<p>It turns out all I really needed in a database was something that could store arbitrary documents, and retrieve them by ID. The querying functionality in MongoDB is very cool and useful, but I just didn&#8217;t need it in this project. I always had the ID of the document I needed, and only need to have proper queries in the admin tools (to a very small degree). This made CouchDB&#8217;s strengths outweigh MongoDB&#8217;s for this project, and that is why I made the switch.</p>
<p>CouchDB is queried over HTTP, which is great because I was able to effectively do the querying from the front-end code, and just use the server to proxy the query to CouchDB relatively untouched. The server does have some logic for security, but ultimately the front end code is directly querying the database.</p>
<h2 id="ace">Ace</h2>
<p>One of the most important parts of the Code Challenge is code editor, since it&#8217;s really all about the code. A simple HTML textarea just won&#8217;t do. An editor should have good indentation support, code highlighting, and the keyboard shortcuts you would expect.</p>
<p>The <a href="http://ace.ajax.org/" title="Ace">Ace</a> project provided a great code editor with pluggable themes, language support, and a good amount of extensibility. Overall I am pretty happy with Ace, but we might end up swapping it out for a similar component. </p>
<p>Since the application is so modular, it&#8217;s very easy to swap out components like Ace if an alternative has better support for a certain feature we may want.</p>
<h2 id="results">Results</h2>
<p>I am extremely pleased with each of these tools, both how they work in isolation, but also in how they work together. There were several points in development when I couldn&#8217;t work on this code for several weeks at a time. Normally I am disoriented when coming back to code after such a break, but in this project it was so well organized that I was able to pick up fairly quickly from where I left off.</p>
<p>I was also able to do a full rewrite of the code about halfway through because I was able to simply write new modules, and switch them out one by one. This allowed me to rewrite some sloppy code with my new knowledge I had gained about my tools. This rewrite only took a few hours, and didn&#8217;t introduce any regressions in functionality.</p>
<p>Dojo turned out to be particularly awesome because the widgets are supported and tested thoroughly in most browsers. Everything pretty much &#8220;just worked&#8221; from one browser to another, and I didn&#8217;t spend much time at all on browser bugs.</p>
<p>The launch of Treehouse and Code Challenges was a complete success. The code challenges had only a few minor bugs pop up during launch, and most of these were small style bugs. The servers kept pace with no problems since it was easy to add more servers when traffic picked up.</p>
<p>This combination of tools allowed me to build both prototype and a real application very quickly. It has very few bugs, is easy to maintain, and ultimately is a joy to work with. I hope to share some specific tips and tricks I discovered with these tools, both here on Think Vitamin, and on <a href="http://teamtreehouse.com" title="Learn Web Design, Web Development and iOS at Treehouse">Treehouse</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/inside-treehouse-code-challenges/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>iOS Design Patterns: Delegation (Part 2)</title>
		<link>http://thinkvitamin.com/code/ios/ios-design-patterns-delegation-part-2/</link>
		<comments>http://thinkvitamin.com/code/ios/ios-design-patterns-delegation-part-2/#comments</comments>
		<pubDate>Fri, 28 Oct 2011 16:43:23 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=16886</guid>
		<description><![CDATA[This is the second installment in the multi-part series covering the various design patterns used in iOS. A good read for anyone getting started with iOS development. This second part covers a design pattern known as Delegation. Delegation Example The delegation pattern means exactly what its name implies, in that it delegates control. It is [...]]]></description>
			<content:encoded><![CDATA[<p>This is the second installment in the multi-part series covering the various design patterns used in iOS. A good read for anyone getting started with iOS development. This second part covers a design pattern known as Delegation. </p>
<p><span id="more-16886"></span></p>
<h2>Delegation Example</h2>
<p>The delegation pattern means exactly what its name implies, in that it delegates control. It is simple yet powerful. </p>
<p>Take the example of a simple app that contains some images within a scrollable view. The images are laid out horizontally and dragging the view horizontally makes it possible to paginate between the images. The images are downloaded from the internet, hence scrolling should automatically trigger the image download. </p>
<p><img src="http://i.imgur.com/jNlgC.jpg" alt="Scrollable view" /></p>
<p>Therefore, the two main components for this app are the image downloads and the scrollable view. Once the view has been scrolled the application needs acknowledgement of this event and subsequently trigger an image download. In most cases what matters most is where the scrolling has halted, however, in some cases it is also important to know when the scrolling began and the velocity of the scroll. The iOS framework has a class called <code>UIScrollView</code> but this is a generic class without any knowledge of the fact that there are images that need to be downloaded upon scroll. This would be an application specific task and it is impossible for the <code>UIScrollView</code> to perform any such tasks.</p>
<p>So how does the <code>UIScrollView</code> notify the application of scrolling events? It uses a delegate class called <code>UIScrollViewDelegate</code> which defines all the scrolling events available. The application can then implement this delegate and intercept those scrolling events.</p>
<p><img src="http://i.imgur.com/G1KbN.jpg" alt="UIScrollView and UIScrollViewDelegate" /></p>
<h2>Delegate property</h2>
<p><img src="http://i.imgur.com/DhacH.jpg" alt="UIScrollView and UIScrollViewDelegate" /></p>
<p>In the example above, the application creates and displays an instance of the scroll view which then contains a reference to the delegate. The delegate is a property of the <code>UIScrollView</code> which tells the view that another class will contain an implementation of the methods defined in <code>UIScrollViewDelegate</code>. Therefore, when scrolling occurs it refers to its delegate and accordingly calls the methods. Another way to look at it would be a method callback.</p>
<h2>Delegate protocol</h2>
<p>The delegating class (such as <code>UIScrollView</code> in the above example) contains a property, usually named delegate and it declares one or more methods that constitute a formal or informal protocol.</p>
<p>A formal protocol (such as <code>UIScrollViewDelegate</code> in the above example) declares all the methods that can be implemented by a class. It can also mark methods as required or optional.</p>
<p>The informal protocol declares methods on a category of NSObject. A category is a feature that enables you to add methods to a class without subclassing it. However, Apple is phasing out this approach.</p>
<p>The mechanism of delegation gives objects a chance to coordinate their appearance and state with changes occurring elsewhere in an application usually brought about by user actions. More importantly, delegation makes it possible for one object to alter the behavior of another object without the need to inherit from it. The delegate is almost always one of your custom objects, and by definition it incorporates application-specific logic that the generic and delegating object cannot possibly know itself.</p>
<h2>Naming convention</h2>
<p>The delegate methods follow a standard naming convention. Starting with the name of the UIKit object doing the delegating which is followed by an auxiliary verb (such as: will, should, did or has) describing the status of the reported event. Let&#8217;s look at some of the methods within the <code>UIScrollViewDelegate</code>:</p>
<p><code>– scrollViewDidScroll:</code><br />
<code>– scrollViewWillBeginDragging:</code><br />
<code>– scrollViewWillEndDragging:withVelocity:targetContentOffset:</code><br />
<code>– scrollViewDidEndDragging:willDecelerate:</code><br />
<code>– scrollViewWillBeginDecelerating:</code><br />
<code>– scrollViewDidEndDecelerating:</code></p>
<h2>Data Sources</h2>
<p>The data source is just like the delegate except it has a different purpose. Instead of delegating control of the user interface it delegates control of data. For example, a table view has a data source which provides information on which rows to display with what data. Data sources are responsible for the memory management of their data objects.</p>
<h3>Related posts</h3>
<p>Check out the other posts in this series:<br />
<a href="http://thinkvitamin.com/code/ios/ios-design-patterns-target-action-part-1/" title="iOS design patterns">iOS Design Patterns: Target-action (Part 1)</a></p>
<p>If you are interested in learning more do check out the <a href="http://membership.thinkvitamin.com/library/ios-development">iOS development</a> course.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/ios-design-patterns-delegation-part-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Free Video:  Objective-C Basics &#8211; Properties &amp; Methods</title>
		<link>http://thinkvitamin.com/code/ios/free-video-objective-c-basics-properties-methods/</link>
		<comments>http://thinkvitamin.com/code/ios/free-video-objective-c-basics-properties-methods/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 01:36:54 +0000</pubDate>
		<dc:creator>Amit Bijlani</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://thinkvitamin.com/?p=16863</guid>
		<description><![CDATA[In this 9.5 minute video, you will learn the basics of Objective-C such as: syntax, instance variables and properties. This video is from Think Vitamin Membership, a high-quality video training site, curated by us at Carsonified and Think Vitamin, with hundreds of short videos on topics like &#8230; Accessibility CSS3 Design Django HTML &#38; CSS HTML5 [...]]]></description>
			<content:encoded><![CDATA[<p>In this <a href="http://membership.thinkvitamin.com/library/ios-development/objective-c/properties-methods-part-1?cid=106">9.5 minute video</a>, you will learn the basics of Objective-C such as: syntax, instance variables and properties.</p>
<p><a href="http://membership.thinkvitamin.com/library/ios-development/objective-c/properties-methods-part-1?cid=106"><img src="http://i.imgur.com/kgE7p.png" /></a></p>
<p>This video is from <a href="http://membership.thinkvitamin.com/?cid=106">Think Vitamin Membership</a>, a high-quality video training site, curated by us at Carsonified and Think Vitamin, with hundreds of short videos on topics like &#8230;</p>
<ul>
<li><a href="http://membership.thinkvitamin.com/library/accessibility/?cid=106">Accessibility</a></li>
<li><a href="http://membership.thinkvitamin.com/library/css3/?cid=106">CSS3</a></li>
<li><a href="http://membership.thinkvitamin.com/library/design/?cid=106">Design</a></li>
<li><a href="http://membership.thinkvitamin.com/library/design/?cid=106"></a><a href="http://membership.thinkvitamin.com/library/django/?cid=106">Django</a></li>
<li><a href="http://membership.thinkvitamin.com/library/html-css/?cid=106">HTML &amp; CSS</a></li>
<li><a href="http://membership.thinkvitamin.com/library/html5/?cid=106">HTML5</a></li>
<li><a href="http://membership.thinkvitamin.com/library/ios-development/?cid=106">iOS Development</a></li>
<li><a href="http://membership.thinkvitamin.com/library/javascript/?cid=106">JavaScript</a></li>
<li><a href="http://membership.thinkvitamin.com/library/jquery/?cid=106">jQuery</a></li>
<li><a href="http://membership.thinkvitamin.com/library/nosql/?cid=106">NoSQL</a></li>
<li><a href="http://membership.thinkvitamin.com/library/php/?cid=106">PHP</a></li>
<li><a href="https://membership.thinkvitamin.com/library/responsive-web-design/?cid=106">Responsive Web Design</a></li>
<li><a href="http://membership.thinkvitamin.com/library/ruby/?cid=106">Ruby</a></li>
<li><a href="http://membership.thinkvitamin.com/library/ruby-on-rails/?cid=106">Ruby on Rails</a></li>
<li><a href="http://membership.thinkvitamin.com/library/html-css/?cid=106">SASS</a></li>
<li><a href="http://membership.thinkvitamin.com/library/ux/?cid=106">UX</a></li>
<li><a href="http://membership.thinkvitamin.com/library/version-control?cid=106">Version Control</a></li>
<li><a href="http://membership.thinkvitamin.com/library/wordpress?cid=106">WordPress Theme Design</a></li>
</ul>
<p>New videos are added every week, so it&#8217;s a great way to stay up-to-date on all the latest technology and methods. Browse the entire <a href="http://membership.thinkvitamin.com/library/?cid=106">library of videos</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://thinkvitamin.com/code/ios/free-video-objective-c-basics-properties-methods/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 3.366 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2012-02-10 03:15:16 -->

