<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Phatness.com</title>
	
	<link>http://phatness.com</link>
	<description>- Still kickin</description>
	<lastBuildDate>Tue, 24 Apr 2012 01:16:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/phatness" /><feedburner:info uri="phatness" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>42.768373</geo:lat><geo:long>-83.378059</geo:long><item>
		<title>Taking a Button from PSD to HTML5/CSS3 using SASS</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/KjDrBCw-67U/</link>
		<comments>http://phatness.com/2012/03/taking-a-button-from-psd-to-html5-css3-using-sass/#comments</comments>
		<pubDate>Fri, 02 Mar 2012 19:27:08 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://phatness.com/?p=2692</guid>
		<description><![CDATA[This article is about several things. Primarily, it is about how to realize a button design using the latest web technology available to us. The resulting button is progressively enhanced so that it looks okay in IE 7, a little bit better in IE 8, great in IE 9, and fantastic in all modern browsers. [...]]]></description>
			<content:encoded><![CDATA[<p>This article is about several things.  Primarily, it is about how to realize a button design using the latest web technology available to us.   The resulting button is progressively enhanced so that it looks okay in IE 7, a little bit better in IE 8, great in IE 9, and fantastic in all modern browsers.  (Yes, IE 9 isn&#8217;t modern by my standards)</p>
<p><em>[Note: this article went long.  The story of the IE "mutation" will happen in a follow up post.]</em></p>
<p>Also, I&#8217;m going to use SASS to create the CSS for this button.  There are many timesaving features of SASS and that is a secondary theme of this post.  You can learn about SASS here: <a href="http://sass-lang.com">http://sass-lang.com</a>.  I can&#8217;t recommend it enough.  It actually renewed my love for web development.</p>
<p><span id="more-2692"></span></p>
<p>I recently created an HTML5 site for a client.  They needed some help and in particular, they were trying to match the button design as close as possible.  There were a few goals:</p>
<ol>
<li>Match the design.</li>
<li>The markup should be simple.</li>
<li>No images!</li>
<li>IE 9, 8, and 7 support.  :/</li>
</ol>
<p>That last one  a tall order!  Fortunately, they were fine with progressive enhancement under IE which meant that things would look similar, but not pixel perfect.  So let&#8217;s see what we had to do&#8230;</p>
<p>Here is the original button design:</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-21-at-12.06.20-PM.png" alt="" title="Screen Shot 2012-02-21 at 12.06.20 PM" width="288" height="217" class="alignnone size-full wp-image-2695" /></p>
<p>Before we can start to build this button in HTML, we need to understand how it is built visually.  Let&#8217;s zoom in on the PSD to get a closer look.  Hover over (or tap) the image to see the critical design elements&#8230;</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-21-at-12.08.55-PM.png" alt="" title="" width="710" height="359" class="size-full wp-image-2697" id="psd-breakdown"/></p>
<p><script type="text/javascript">
	$(document).ready(function() {
		$("#psd-breakdown").live('tap',function(event) {
			if($(this).hasClass("alternate")) {
				off();
			} else {
				on();	
			}
		});
		function on() {
console.log("on()");
			$(this).addClass("alternate");
			$(this).attr('src', "http://phatness.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-21-at-12.08.55-PM1.png");
		}
		function off() {
console.log("off()");
			$(this).removeClass("alternate");
			$(this).attr('src', "http://phatness.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-21-at-12.08.55-PM.png");
		}
$("#psd-breakdown").hover(on, off);
	});
</script></p>
<style>
pre strong {
font-weight: bold !important;
}
</style>
<p>To describe this button we have:</p>
<ol>
<li>The background color of the button is a solid orange.  I.e., there is no gradient.</li>
<li>Rounded corners of about 4px</li>
<li>A darker orange 1px border (stroke)</li>
<li>An inner shadow that gives a highlight, but it isn&#8217;t on every edge</li>
<li>A faint text shadow of about 2px blur</li>
<li>A faint drop shadow on the entire button of about 2px blur</li>
</ol>
<p>Looking at this shopping list of CSS3 features, I can tell already that we are going to be hurting on all versions of Internet Explorer except the unreleased version of IE 10.  Bummer.</p>
<p>&#8230;or maybe not&#8230;  I know there are a few things we can hack to make IE work.  But first, let&#8217;s get the easy stuff out of the way and make this button work for Safari, Chrome, and Firefox.</p>
<p>We start with a basic link and then use CSS3 features to style it according to our list.  Here is our starting markup:</p>
<p><code>&lt;a href=&quot;#&quot; class=&quot;button&quot;&gt;Clickity Clickity&lt;/a&gt;</code></p>
<p>(For this example, I am using &gt;a&lt; because the markup is simple.  But this will also work with input buttons.)</p>
<p>Let&#8217;s setup our SASS file, we need to include the CSS3 mixins:</p>
<pre>
<strong>@import "compass/css3"</strong>
</pre>
<p>The @import declaration simply brings in a standard library that is packaged with compass and SASS.  It gives us a bunch of time saving goodies so that we can do things like write:</p>
<pre>
+single-box-shadow(rgba(0,0,0,.25), 0, 2px, 2px)
</pre>
<p>Instead of this:</p>
<pre>
-moz-box-shadow: rgba(0, 0, 0, 0.25) 0 2px 2px;
-webkit-box-shadow: rgba(0, 0, 0, 0.25) 0 2px 2px;
-o-box-shadow: rgba(0, 0, 0, 0.25) 0 2px 2px;
box-shadow: rgba(0, 0, 0, 0.25) 0 2px 2px;
</pre>
<p>Time savings, yes?  It doesn&#8217;t stop there.  Did I mention you should go look at <a href="http://sass-lang.com">http://sass-lang.com</a>?</p>
<p>Now, let&#8217;s work down that list of attributes.  We need to have padding and margin on this button.  That means the default display of a link needs to be changed from inline to inline-block.  There is also significant amount of padding, so we will add that in.  Let&#8217;s specify a font-size of 16px so we aren&#8217;t relying on body copy size which can change without us knowing.  If we left the font-size as is, the text of the button wouldn&#8217;t be vertically centered when we apply this style to our input buttons.  To vertically align, we give it a line-height of 22px.  Here is our class so far:</p>
<pre>
@import "compass/css3"
<strong>
.button
	display: inline-block
	padding: 7px 24px 8px 24px
	font-size: 16px
	font-weight: 400
	line-height: 22px
</strong>
</pre>
<p>Here is our button so far:</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/03/Screen-Shot-2012-03-02-at-2.00.38-PM.png" alt="" title="Screen Shot 2012-03-02 at 2.00.38 PM" width="129" height="43" class="alignleft size-full wp-image-2763" /></p>
<p>Not very interesting&#8230;</p>
<p>Moving on, it would just look weird if our button ever wrapped to multiple lines of text.  So, let&#8217;s fix the whitespace with nowrap.  Further, we need to make sure the text is centered and because this is an &lt;a&gt; tag, we need to remove the text-decoration.</p>
<p>Our design calls for white text and an orange background color of #f38f01.  Zoomed in, we see that the 1px outline of the button is a dark orange #c87704.</p>
<pre>
@import "compass/css3"

.button
	display: inline-block
	padding: 7px 24px 8px 24px
	font-size: 16px
	font-weight: 400
	line-height: 22px
<strong>	whitespace: nowrap
	text-align: center
	text-decoration: none
	color: #fff !important
	background-color: #f38f01
	border: 1px solid #c87704
</strong>
</pre>
<p>How does that all look under our test browser?</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/03/Screen-Shot-2012-03-02-at-2.03.28-PM.png" alt="" title="Screen Shot 2012-03-02 at 2.03.28 PM" width="147" height="46" class="alignleft size-full wp-image-2764" /></p>
<p>A pretty, plain, orange rectangle.  Now, let&#8217;s add the &#8220;shiny&#8221;.</p>
<p>We need rounded rectangles, shadow on the text, a highlight shine on the top and left sides, and a drop shadow under the button.  A white inset shadow will be used for the &#8220;shine&#8221; on top &#038; left sides.  A feature of CSS3 shadows that let us specify multiple shadows to apply.  We will use this to specify both the drop shadow and shine of the button at the same time.</p>
<pre>
@import "compass/css3"

.button
	display: inline-block
	padding: 7px 24px 8px 24px
	font-size: 16px
	font-weight: 400
	line-height: 22px
	whitespace: nowrap
	text-align: center
	text-decoration: none
	color: #fff !important
	background-color: #f38f01
	border: 1px solid #c87704
<strong>	+border-radius(4px, 4px)
	+text-shadow(rgba(0,0,0,.5), 1px, 1px, 3px)
	+box-shadow(rgba(black,.3) 0px 1px 1px, rgba(white,.25) 1px 1px 0px inset)
</strong>
</pre>
<p>(You can see that special SASS syntax we are using again: +border-radius and such.)</p>
<p>In the last line, the first shadow is the the drop shadow, and the second is the white shine.  Here we go:</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/03/Screen-Shot-2012-03-02-at-2.08.41-PM.png" alt="" title="Screen Shot 2012-03-02 at 2.08.41 PM" width="148" height="48" class="alignleft size-full wp-image-2765" /></p>
<p>Finally, we need the button to reflect a change in its state.  When a mouse hovers over, let&#8217;s lighten it a bit.  And when someone clicks or touches it, let&#8217;s make it darker.</p>
<pre>
@import "compass/css3"

.button
	display: inline-block
	padding: 7px 24px 8px 24px
	font-size: 16px
	font-weight: 400
	line-height: 22px
	whitespace: nowrap
	text-align: center
	text-decoration: none
	color: #fff !important
	background-color: #f38f01
	border: 1px solid #c87704
	+border-radius(4px, 4px)
	+text-shadow(rgba(0,0,0,.5), 1px, 1px, 3px)
	+box-shadow(rgba(black,.3) 0px 1px 1px, rgba(white,.25) 1px 1px 0px inset)
<strong>
	&#038;:hover
		background-color: #ff9c0e

	&#038;:active
		background-color: #da8001
</strong>
</pre>
<p>Okay, how does it look in Safari compared to the original PSD?</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/safari-comparison.png" alt="" title="safari-comparison" width="290" height="80" class="alignnone size-full wp-image-2739" /></p>
<p>Wow, that&#8217;s not bad at all!  Firefox is the same.  Let&#8217;s check Chrome and&#8230; ruh roh!  Take a look:</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/Screen-Shot-2012-02-22-at-1.52.30-PM.png" alt="" title="Chrome Font Difference" width="146" height="47" class="alignnone size-full wp-image-2741" /></p>
<p>Chrome actually renders fonts differently then other browsers.  Type appears at what seems like one weight lighter (400 to 300, in this case).  So we are going to adjust that here:</p>
<pre>
// Chrome renders font one weight lighter than every other browser.
// Their text shadow also appears to be a bit darker, though that could
// be because of the step up in font weight
.chrome
	.button
		font-weight: 700
		+text-shadow(rgba(0,0,0,.40), 1px, 1px, 3px)
</pre>
<p>Since discovering this font &#8220;bug&#8221;, I&#8217;ve started the practice of tagging every page body with a .chrome class if that browser is being used.  Yeah, I know, don&#8217;t target browsers&#8230;  Well, someone get Google to fix it and we can stop that&#8230;</p>
<p>Let&#8217;s see where we stand in Safari, Chrome, and Firefox:</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/non-ie-comparison.png" alt="" title="non-ie-comparison" width="591" height="80" class="alignnone size-full wp-image-2743" /></p>
<p>Damn, that is spot on!</p>
<p>Okay, now that sinking feeling in your stomach is the realization that we are only 10% of the way done.  I.e., we still need to fix IE.  I&#8217;ll cover that out in a follow-up blog post.</p>
<div class="well">
<h3>Notes:</h3>
<p>The title of this post includes the buzzword, HTML5.  Though, not a single HTML5 tag was used in the making of this button.  Sorry about that.  For those seeking the &#8220;truth&#8221;, know that the polish of this button was derived entirely with CSS2 and 3 features.</p>
<p><a href="http://phatness.com/wp-content/uploads/2012/03/Screen-Shot-2012-03-02-at-2.21.46-PM.png"><img src="http://phatness.com/wp-content/uploads/2012/03/Screen-Shot-2012-03-02-at-2.21.46-PM-150x132.png" alt="" title="Scaled Button" width="150" height="132" class="alignright size-thumbnail wp-image-2782" /></a><br />
Also, note that there is neither width nor height specified in the style of this button!  What does that mean?  It will scale beautifully and maintain its proportions:</p>
<div style="clear:both">&nbsp;</div>
</div>
<img src="http://feeds.feedburner.com/~r/phatness/~4/KjDrBCw-67U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/03/taking-a-button-from-psd-to-html5-css3-using-sass/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/03/taking-a-button-from-psd-to-html5-css3-using-sass/</feedburner:origLink></item>
		<item>
		<title>Twitter Bootstrap – How to Pad Columns</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/RA9vdFCfF2s/</link>
		<comments>http://phatness.com/2012/02/twitter-bootstrap-how-to-pad-columns/#comments</comments>
		<pubDate>Tue, 21 Feb 2012 08:24:21 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://phatness.com/?p=2671</guid>
		<description><![CDATA[I have much love for Bootstrap by Twitter. But there are some things that I was slow to figure out, see my earlier post on this: How to style Rows in Bootstrap. Similarly to the style issue, you can&#8217;t easily add padding to elements within a row. Say you want to to have a row [...]]]></description>
			<content:encoded><![CDATA[<p>I have much love for Bootstrap by Twitter.  But there are some things that I was slow to figure out, see my earlier post on this: <a href="http://phatness.com/2012/02/twitter-bootstrap-how-to-style-rows">How to style Rows in Bootstrap</a>.</p>
<p>Similarly to the style issue, <strong>you can&#8217;t easily add padding to elements within a row.</strong>  Say you want to to have a row that has multiple columns.  But you need to have a 15px padding for each column.  (The row has a styled background and we don&#8217;t want the columns to touch the edges).  If you try and target your columns directly via the .spanXX class with a descendant selector, you&#8217;ll have headaches later on when you change your column width, or add another row that had different needs.  (I should mention, this isn&#8217;t a unique problem to Bootstrap.  Most, if not all, grid systems have this issue.)</p>
<p>The solution is to place a &lt;div&gt; element within the .spanXX column container.  This div is then padded and your content is then placed within.</p>
<p>Nice and simple:</p>
<style>
pre strong {
font-weight: bold !important;
}
</style>
<pre>
&lt;div class=&quot;row&quot;&gt;
	&lt;div class=&quot;span6&quot;&gt;
		<strong>&lt;div class=&quot;extraneous-non-semantic-markup&quot;&gt;</strong>
			&lt;p&gt;Your Content is Padded!&lt;/p&gt;
		<strong>&lt;/div&gt;</strong>
	&lt;/div&gt;

	&lt;div class=&quot;span6&quot;&gt;
		<strong>&lt;div class=&quot;extraneous-non-semantic-markup&quot;&gt;</strong>
			&lt;p&gt;Yay!&lt;/p&gt;
		<strong>&lt;/div&gt;</strong>
	&lt;/div&gt;
&lt;/div&gt;
</pre>
<p>And the styling on the class:</p>
<pre>
.extraneous-non-semantic-markup {
	padding: 15px
}
</pre>
<p>And that feels so dirty.  But it&#8217;s a compromise that works because we gain so much more from grid layouts.</p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/RA9vdFCfF2s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/02/twitter-bootstrap-how-to-pad-columns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/02/twitter-bootstrap-how-to-pad-columns/</feedburner:origLink></item>
		<item>
		<title>Twitter Bootstrap – How to Style Rows</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/_ZJ9AaVsIik/</link>
		<comments>http://phatness.com/2012/02/twitter-bootstrap-how-to-style-rows/#comments</comments>
		<pubDate>Wed, 15 Feb 2012 14:44:34 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://phatness.com/?p=2669</guid>
		<description><![CDATA[There is a lot of great things going on with the new CSS framework from Twitter, Bootstrap -> http://twitter.github.com/bootstrap/. I used 1.0 for creating this site and a few others. Version 2.0 was just released and it fixed a lot of issues and is really just plain awesome. Unfortunately, there have been a few things [...]]]></description>
			<content:encoded><![CDATA[<p>There is a lot of great things going on with the new CSS framework from Twitter, Bootstrap -> <a href="http://twitter.github.com/bootstrap/">http://twitter.github.com/bootstrap/</a>.  I used 1.0 for creating this site and a few others.  Version 2.0 was just released and it fixed a lot of issues and is really just plain awesome.</p>
<p>Unfortunately, there have been a few things that have been bothering me about it, particularly the grid system.  I felt constrained by the requirement of a containing .row around the spans.  I couldn&#8217;t quite put a finger on what it was though.  Then after doing a project with Blueprint -> <a href="http://blueprintcss.org/">http://blueprintcss.org/</a> last month, it hit me.  <strong>In Bootstrap, you can&#8217;t style rows.</strong></p>
<p>Bootstrap&#8217;s grid system will use left-margin in between columns to have built in padding between content areas.  By default, it is 20px.  Everyone does this.  The problem that happens though is that the first column can&#8217;t have any left-margin or your content won&#8217;t be centered.  (And likely be over 960px)  To get around this, most frameworks will nip off the left-margin on the first column by using a pseudo css selector: first-child.  </p>
<p>Boostrap uses a different technique.  <strong>It places a negative left-margin on the containing .row</strong> instead of using a pseudo class.  For the following markup, imagine we want to put a border around the row:</p>
<pre class="lang-html">
&lt;div class=&quot;container&quot;&gt;
    &lt;div class=&quot;row&quot;&gt;
        &lt;div class=&quot;span6&quot;&gt;&lt;/div&gt;
        &lt;div class=&quot;span6&quot;&gt;&lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;
</pre>
<p>Yields:</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/bootstrap-row2.png" alt="" title="bootstrap-row" width="660" height="357" class="alignnone size-full wp-image-2683" /></p>
<p>Notice how the row in the above illustration sticks out past the .container element?</p>
<p>Their reason for this is valid.  :first-child causes problems with calculating widths and makes things more complicated.  But using a .row with negative left-margin means that any styling applied to the row (borders, backgrounds, etc) will stick out on the left hand side by an extra 20px.  In the simplest case illustrated above, this is exactly how it occurs in your page.</p>
<p>So how do we fix this?</p>
<p>Simple.  Add a <strong>&lt;div&gt;</strong> or HTML5 element like <strong>&lt;article&gt;</strong> or <strong>&lt;section&gt;</strong> as a parent to the row.  Then style the parent element.  Because of the .container that is used for the entire page, this div will be the appropriate width.  When using a &lt;section&gt; tag, it even feels right, semantically.  So, yay!</p>
<p>Here we have the fix:</p>
<pre class="lang-html">
&lt;div class=&quot;container&quot;&gt;
    &lt;section&gt;
        &lt;div class=&quot;row&quot;&gt;
            &lt;div class=&quot;span6&quot;&gt;&lt;/div&gt;
            &lt;div class=&quot;span6&quot;&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/section&gt;
&lt;/div&gt;
</pre>
<p>Which results in:</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/bootstrap-styled1.png" alt="" title="bootstrap-styled" width="660" height="357" class="alignnone size-full wp-image-2684" /></p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/_ZJ9AaVsIik" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/02/twitter-bootstrap-how-to-style-rows/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/02/twitter-bootstrap-how-to-style-rows/</feedburner:origLink></item>
		<item>
		<title>For My Wife</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/xYTW6eL4a0w/</link>
		<comments>http://phatness.com/2012/02/for-my-wife/#comments</comments>
		<pubDate>Tue, 14 Feb 2012 18:00:38 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://phatness.com/?p=2664</guid>
		<description><![CDATA[Happy Valentine&#8217;s Day Babe. There are so many things I never get to tell you. You are as beautiful on the inside as you are on the outside. My hot mama is caring and sweet and I probably don&#8217;t deserve her. I love you because you care about the kids and me more than yourself. [...]]]></description>
			<content:encoded><![CDATA[<p>Happy Valentine&#8217;s Day Babe.  There are so many things I never get to tell you.  </p>
<p>You are as beautiful on the inside as you are on the outside.  My hot mama is caring and sweet and I probably don&#8217;t deserve her.</p>
<p>I love you because you care about the kids and me more than yourself.  You are always thinking of us first.  You keep me centered about what is important in life and what is best for our family.  You help me work towards a better life.  I&#8217;m a better person because of you and truly blessed to have you.</p>
<p>Best of all, you are so thankful for everything we have.</p>
<p>It&#8217;s my turn to be thankful.  Thank you for everything you have done for me.  Thank you for being an amazing mother.  Thank you for being a better wife than I could have ever hoped for.  I love you.</p>
<p>What a great match.  <img src='http://phatness.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><img src="http://phatness.com/wp-content/uploads/2012/02/DSC05623-506x675.jpg" alt="" title="Dorthy &amp; The Lion" width="506" height="675" class="aligncenter size-large wp-image-2665" /></p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/xYTW6eL4a0w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/02/for-my-wife/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/02/for-my-wife/</feedburner:origLink></item>
		<item>
		<title>Building Out vs Up</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/mWoCzv-UXn0/</link>
		<comments>http://phatness.com/2012/02/building-out-vs-up/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 22:04:36 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://phatness.com/2012/02/building-out-vs-up/</guid>
		<description />
			<content:encoded><![CDATA[<p><a href="http://distilleryimage0.instagram.com/a75f76ec54f911e19896123138142014_7.jpg" title="Building Out vs Up"><img src="http://distilleryimage0.instagram.com/a75f76ec54f911e19896123138142014_7.jpg"  alt="Building Out vs Up"  /></a></p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/mWoCzv-UXn0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/02/building-out-vs-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/02/building-out-vs-up/</feedburner:origLink></item>
		<item>
		<title>Brilliant Chemistry / Plodding Landlord</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/hGV56WDnG0k/</link>
		<comments>http://phatness.com/2012/02/brilliant-chemistry-plodding-landlord/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 18:48:44 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://phatness.com/2012/02/brilliant-chemistry-plodding-landlord/</guid>
		<description />
			<content:encoded><![CDATA[<p><a href="http://distilleryimage2.instagram.com/3f72eb5054df11e19896123138142014_7.jpg" title="Brilliant Chemistry / Plodding Landlord"><img src="http://distilleryimage2.instagram.com/3f72eb5054df11e19896123138142014_7.jpg"  alt="Brilliant Chemistry / Plodding Landlord"  /></a></p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/hGV56WDnG0k" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/02/brilliant-chemistry-plodding-landlord/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/02/brilliant-chemistry-plodding-landlord/</feedburner:origLink></item>
		<item>
		<title>Sun and Ice</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/Jx0_znOomdU/</link>
		<comments>http://phatness.com/2012/02/sun-and-ice/#comments</comments>
		<pubDate>Sat, 11 Feb 2012 17:49:38 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://phatness.com/2012/02/sun-and-ice/</guid>
		<description />
			<content:encoded><![CDATA[<p><a href="http://distilleryimage3.s3.amazonaws.com/6f591e3c52ca11e1b9f1123138140926_7.jpg" title="Sun and Ice"><img src="http://distilleryimage3.s3.amazonaws.com/6f591e3c52ca11e1b9f1123138140926_7.jpg"  alt="Sun and Ice"  /></a></p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/Jx0_znOomdU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/02/sun-and-ice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/02/sun-and-ice/</feedburner:origLink></item>
		<item>
		<title>American Idiot @ Detroit Opera House</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/eGfIy_X-JOU/</link>
		<comments>http://phatness.com/2012/01/2645/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 00:49:38 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://phatness.com/2012/02/2645/</guid>
		<description />
			<content:encoded><![CDATA[<p><a href="http://distilleryimage1.s3.amazonaws.com/4671cdec52cb11e19896123138142014_7.jpg" title=""><img src="http://distilleryimage1.s3.amazonaws.com/4671cdec52cb11e19896123138142014_7.jpg"  alt=""  /></a></p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/eGfIy_X-JOU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/01/2645/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/01/2645/</feedburner:origLink></item>
		<item>
		<title>Merging With Git and P4Merge</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/itGHNarEMzE/</link>
		<comments>http://phatness.com/2012/01/merging-with-git-and-p4merge/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 13:37:10 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[The Setup]]></category>

		<guid isPermaLink="false">http://phatness.com/?p=2572</guid>
		<description><![CDATA[While there are some great diff tools out there, there are very few good merge tools. My favorite diff tool is Kaleidoscope. And there are several others I wouldn&#8217;t mind using. However, Kaleidoscope does not do merging. Too me, software development requires much more merging then diff&#8217;ing. And many times, github.com&#8217;s HTML diff view is [...]]]></description>
			<content:encoded><![CDATA[<p>While there are some great diff tools out there, there are very few good merge tools.  My favorite diff tool is <a href="http://phatness.com/2011/01/kaleidoscope-text-comparison/">Kaleidoscope.</a>  And there are several others I wouldn&#8217;t mind using.</p>
<p>However, Kaleidoscope does not do merging.  Too me, software development requires much more merging then diff&#8217;ing.  And many times, <a href="http://github.com/">github.com&#8217;s</a> HTML diff view is more than sufficient.  Heck, even command line diff works just fine for small differences.  Looking at diff&#8217;s is easy and paying money for a tool that only does diffs is something I find hard to swallow.<br />
<span id="more-2572"></span><br />
Taking three files, and coming up with a new one is quite a bit more difficult.  In my experience, not many tools handle it well.  The biggest problems are:</p>
<ul>
<li>Integration and interoperability with the OS (cough, OS X native)</li>
<li>Intelligent resolution of conflicts</li>
<li>Differences within a line</li>
<li>Easily choosing which diff chunks to take</li>
<li>Being able to edit the final merged file</li>
</ul>
<p>Many times, the merge tool will not be fine grained enough to allow for differences within a line to be accurately merged.  You&#8217;ll even have problems with whole lines of code not being intelligently merged.  </p>
<p>The two best tools I&#8217;ve found to handle this are:</p>
<ul>
<li><a href="http://www.araxis.com/merge/">Araxis Merge</a></li>
<li><a href="http://www.perforce.com/product/components/perforce_visual_merge_and_diff_tools">P4Merge</a></li>
</ul>
<p>Araxis Merge was originally a windows product that I used in a previous life.  It was great because it offered not just merging, but standard diffs, as well as directory diffs.  Really nice and I highly recommend.  However, I don&#8217;t use it anymore, even though they have a  Mac version.  The problem is the price is absurd: $269 and then $49 a year, thereafter.  That&#8217;s insane.</p>
<p>Especially insane, when the next best tool is free!  P4Merge is actually from another SCM company, <a href="http://perforce.com">Perforce.</a>  It is more of a single purpose tool then something like Araxis Merge.  However, it does do merging very well.  I&#8217;ve found that it can start to get confused on resolving conflicts, such as when an existing chunk of code is just moved down the file while another commit inserted new code at the same spot.  But that&#8217;s where being able to edit the final merged file at the same time helps.</p>
<p><img src="http://phatness.com/wp-content/uploads/2012/01/Screen-Shot-2012-01-04-at-3.59.04-PM-675x526.png" alt="P4Merge" title="P4Merge" width="675" height="526" class="size-large wp-image-2574" /></p>
<p>(Notice the yellow, blue, and green icons on the right side of the bottom pane.  You click each one to switch which code is used in the final output.)</p>
<p>You would think that using P4Merge with a competing SCM like git would not be easy.  But it&#8217;s actually quite straightforward.  Go install <a href="http://www.perforce.com/product/components/perforce_visual_merge_and_diff_tools">P4Merge</a> and then just add this to ~/.gitconfig:</p>
<pre>
[merge]
        keepBackup = false
        tool = custom

[mergetool "P4Merge"]
        cmd = /Applications/p4merge.app/Contents/Resources/launchp4merge "$PWD/$BASE" "$PWD/$REMOTE" "$PWD/$LOCAL" "$PWD/$MERGED"
        keepTemporaries = false
        trustExitCode = false
        keepBackup = false
</pre>
<p>When you need to merge with git, run</p>
<pre>
git mergetool
</pre>
<p>Instead of the normal, git merge.  The one problem I&#8217;ve run into is that even though keepTemoraries/keepBackup is false, I still get .orig files littered about when a merge happens.  These have to be cleaned up manually.</p>
<img src="http://feeds.feedburner.com/~r/phatness/~4/itGHNarEMzE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/01/merging-with-git-and-p4merge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/01/merging-with-git-and-p4merge/</feedburner:origLink></item>
		<item>
		<title>Add Some Color to Git</title>
		<link>http://feedproxy.google.com/~r/phatness/~3/O-HcAtgmpL4/</link>
		<comments>http://phatness.com/2012/01/add-some-color-to-git/#comments</comments>
		<pubDate>Thu, 05 Jan 2012 14:30:59 +0000</pubDate>
		<dc:creator>mike</dc:creator>
				<category><![CDATA[The Setup]]></category>

		<guid isPermaLink="false">http://phatness.com/?p=2550</guid>
		<description><![CDATA[By default, git is colorless. What decade is this again? &#8220;Squirt&#8221; this crap in your prompt and things will be better. git config --global color.ui "auto" git config --global color.branch "auto" git config --global color.status "auto" git config --global color.diff "auto"]]></description>
			<content:encoded><![CDATA[<p>By default, git is colorless.  What decade is this again?  &#8220;Squirt&#8221; this crap in your prompt and things will be better.</p>
<pre class="bash">
git config --global color.ui "auto"
git config --global color.branch "auto"
git config --global color.status "auto"
git config --global color.diff "auto"
</pre>
<img src="http://feeds.feedburner.com/~r/phatness/~4/O-HcAtgmpL4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://phatness.com/2012/01/add-some-color-to-git/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://phatness.com/2012/01/add-some-color-to-git/</feedburner:origLink></item>
	</channel>
</rss><!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic
Page Caching using disk: enhanced

Served from: phatness.com @ 2012-04-23 20:25:06 -->

