<?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>Jon Rohan</title>
	<atom:link href="http://www.dinnermint.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dinnermint.org</link>
	<description>I&#039;m a freelance web developer living in San Francisco. This is my portfolio where I share my work, thoughts, and whatever else.</description>
	<lastBuildDate>Sat, 24 Apr 2010 17:01:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
<cloud domain='www.dinnermint.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>This Little Market</title>
		<link>http://www.dinnermint.org/portfolio/this-little-market/</link>
		<comments>http://www.dinnermint.org/portfolio/this-little-market/#comments</comments>
		<pubDate>Sat, 24 Apr 2010 16:54:55 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2451</guid>
		<description><![CDATA[This Little Market let&#8217;s users find and share products in their world. This is a project I co-founded and do 100% of the engineering work, including Django, CSS, HTML, Design, Javascript, Sysadmin and Database.]]></description>
			<content:encoded><![CDATA[<p><a href="http://thislittlemarket.com/" target="_blank"><img src="http://www.dinnermint.org/wp-content/uploads/2010/04/thislittlemarket.png" alt="This Little Market" title="This Little Market" width="800" height="1035" class="alignright size-full wp-image-2313" /></a></p>
<section><a href="http://thislittlemarket.com/" target="_blank">This Little Market</a> let&#8217;s users find and share products in their world. This is a project I co-founded and do 100% of the engineering work, including Django, CSS, HTML, Design, Javascript, Sysadmin and Database.</section>
]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/portfolio/this-little-market/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using CSS3&#8242;s :target pseudo-class to Make a Slideshow</title>
		<link>http://www.dinnermint.org/css/using-css3s-target-pseudo-class-to-make-a-slideshow/</link>
		<comments>http://www.dinnermint.org/css/using-css3s-target-pseudo-class-to-make-a-slideshow/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 18:00:09 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[css3]]></category>
		<category><![CDATA[Ideas]]></category>
		<category><![CDATA[pseudo class]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[webkit]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2132</guid>
		<description><![CDATA[CSS3 has a lot of cool pseudo-classes. For this experiment I used the :target pseudo-class which lets you target css element based on the element targeted at the end of a url, for example. http://example.com/page#article1 The :target on this page would be the element with the id=&#34;article1&#34;. So if you wanted to place a red [...]]]></description>
			<content:encoded><![CDATA[<p>CSS3 has a lot of cool pseudo-classes. For this experiment I used the :target pseudo-class which lets you target css element based on the element targeted at the end of a url, for example.</p>
<p><pre><code>http://example.com/page#article1
</code></pre></p>
<p>The :target on this page would be the element with the <code>id=&quot;article1&quot;</code>. So if you wanted to place a red dotted border around <code>article1</code>, then you would use something like this.</p>
<p><pre><code>:target { 
&nbsp;&nbsp;border: 1px dotted #FF0000; 
}</code></pre></p>
<p>So I decided to try an experiment and make a slideshow using nothing but HTML and CSS. </p>
<h3>Demo</h3>
<p>Sorry, but no IE&#8217;s allowed. You prob won&#8217;t see anything.</p>
<p><a href="#1">Start Slideshow</a></p>
<ul class="book-pages">
<li id="1">
<div>
<h3>Taming CSS</h3>
<p><small>by Jon Rohan</small>
</div>
<p><span class="slide-info">Slide 1 of 3</span><br />
<a href="#2" class="next">Next</a>
</li>
<li id="2">
<div>
<h3>Never Assume you&#8217;ve mastered it</h3>
</div>
<p><span class="slide-info">Slide 2 of 3</span><br />
<a href="#1" class="last">Last</a><a href="#3" class="next">Next</a></li>
<li id="3">
<div>
<h3>The End</h3>
</div>
<p><span class="slide-info">Slide 3 of 3</span><br />
<a href="#2" class="last">Last</a></li>
</ul>
<h3>Code</h3>
<p><pre><code>&lt;ul class=&quot;book-pages&quot;&gt;
&nbsp;&nbsp;&lt;li id=&quot;1&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h3&gt;Taming CSS&lt;/h3&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;small&gt;by Jon Rohan&lt;/small&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;span class=&quot;slide-info&quot;&gt;Slide 1 of 3&lt;/span&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href=&quot;#2&quot; class=&quot;next&quot;&gt;Next&lt;/a&gt;
&nbsp;&nbsp;&lt;/li&gt;
&nbsp;&nbsp;&lt;li id=&quot;2&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h3&gt;Never Assume you&#039;ve mastered it&lt;/h3&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;span class=&quot;slide-info&quot;&gt;Slide 2 of 3&lt;/span&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href=&quot;#1&quot; class=&quot;last&quot;&gt;Last&lt;/a&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href=&quot;#3&quot; class=&quot;next&quot;&gt;Next&lt;/a&gt;
&nbsp;&nbsp;&lt;/li&gt;
&nbsp;&nbsp;&lt;li id=&quot;3&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h3&gt;The End&lt;/h3&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;span class=&quot;slide-info&quot;&gt;Slide 3 of 3&lt;/span&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;a href=&quot;#2&quot; class=&quot;last&quot;&gt;Last&lt;/a&gt;
&nbsp;&nbsp;&lt;/li&gt;
&lt;/ul&gt;</code></pre></p>
<p>The HTML is a basic unordered list. Each list item will be the slide. Inside each slide is the controls to navigate backward and forward. And a span to display the current slide number.</p>
<p>The main CSS that controls the slideshow, is to just display the current slide, like this.<br />
<pre><code>.book-pages li:target {
&nbsp;&nbsp;display:block;
}</code></pre></p>
<p>And here&#8217;s the rest of the CSS.</p>
<p><pre><code>.book-pages, .book-pages li {
&nbsp;&nbsp;list-style-type:none;
&nbsp;&nbsp;margin:0;
&nbsp;&nbsp;padding:0;
}
ul.book-pages {
&nbsp;&nbsp;margin:30px 0;
}
.book-pages li {
&nbsp;&nbsp;background-color:#111111;
&nbsp;&nbsp;display:none;
&nbsp;&nbsp;height:350px;
&nbsp;&nbsp;margin:0 auto;
&nbsp;&nbsp;position:relative;
&nbsp;&nbsp;text-align:center;
&nbsp;&nbsp;width:510px;
&nbsp;&nbsp;color: #ffffff;
}
.book-pages div {
&nbsp;&nbsp;font-size:1.8em;
&nbsp;&nbsp;padding:120px 25px 0;
&nbsp;&nbsp;line-height:2em;
}
.book-pages li:target {
&nbsp;&nbsp;display:block;
}
.book-pages .next {
&nbsp;&nbsp;position:absolute;
&nbsp;&nbsp;right:0;
&nbsp;&nbsp;bottom:-20px;
}
.book-pages .last {
&nbsp;&nbsp;position:absolute;
&nbsp;&nbsp;left:0;
&nbsp;&nbsp;bottom:-20px;
}
.book-pages .slide-info {
&nbsp;&nbsp;position:absolute;
&nbsp;&nbsp;bottom:-20px;
&nbsp;&nbsp;left:44%;
&nbsp;&nbsp;color:#333333;
}</code></pre></p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/tutorial/css3-font-face/' rel='bookmark' title='Permanent Link: CSS 3 @font-face'>CSS 3 @font-face</a></li>
<li><a href='http://www.dinnermint.org/tutorial/css3-text-rotation-clock/' rel='bookmark' title='Permanent Link: CSS Text Rotation Clock'>CSS Text Rotation Clock</a></li>
<li><a href='http://www.dinnermint.org/share/submit-to-digg/' rel='bookmark' title='Permanent Link: Submit to Digg Bookmarklet'>Submit to Digg Bookmarklet</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/css/using-css3s-target-pseudo-class-to-make-a-slideshow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JavaScript Classes and Inheritance</title>
		<link>http://www.dinnermint.org/javascript/javascript-classes-and-inheritance/</link>
		<comments>http://www.dinnermint.org/javascript/javascript-classes-and-inheritance/#comments</comments>
		<pubDate>Wed, 16 Sep 2009 17:30:19 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[classes]]></category>
		<category><![CDATA[javascript basics]]></category>
		<category><![CDATA[object oriented programming]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2295</guid>
		<description><![CDATA[Object oriented JavaScript is everywhere today, and its the type of thing that takes a developer from someone tinkering with JavaScript on the path to becoming a JavaScript ninja. In this post I&#8217;m gonna discuss the basics of creating a JavaScript class, and a subclass which inherits methods from the superclass. A JavaScript Class Let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Object oriented JavaScript is everywhere today, and its the type of thing that takes a developer from someone tinkering with JavaScript on the path to becoming a JavaScript ninja. In this post I&#8217;m gonna discuss the basics of creating a JavaScript class, and a subclass which inherits methods from the superclass.</p>
<h3>A JavaScript Class</h3>
<p>Let&#8217;s start out with a basic class. The Person class has one method getName, when you create a new instance of the Person class you will pass in the Person&#8217;s name. </p>
<h4>The Person class</h4>
<p><pre><code>function Person(name) {
&nbsp;&nbsp;this.name = name;
}
Person.prototype.getName = function() {
&nbsp;&nbsp;return this.name;
}
</code></pre></p>
<p>So in the above example I created a Person class with a name attribute and a function to retrieve the name. Now I&#8217;ll create a new person, &#8220;Jon Rohan&#8221;. </p>
<p><pre><code>var p = new Person(&quot;Jon Rohan&quot;);
// output: Jon Rohan
console.log(p.getName());
</code></pre></p>
<p>The <code>p</code> is a new Person with the name &#8220;Jon Rohan&#8221;, when I log to the console the result of p.getName() it returns &#8220;Jon Rohan&#8221;.</p>
<h3>Prototype Chain</h3>
<p>Now we bring in the prototype chain. The chain is like an inheritance chain. Developer inherits &rarr; from Person. So we are defining a Developer as a Person, cause developers are people too. ;-) The developer takes the name attribute like Person, and an array of skills. The first line of the Developer class is to <code>call</code> the Person class. This calls the Person&#8217;s constructor. The Developer class also has a new method getSkills, because a Person is too general to have skills, but as a Developer, there are skills that they have. </p>
<p>We also need to set Developer.prototype to the Person&#8217;s prototype, by creating a new Person. Now we set the Developer&#8217;s constructor to the Developer. And we have successfully created a prototype chain from Developer to Person.</p>
<h4>The Developer Class</h4>
<p><pre><code>function Developer(name, skills) {
&nbsp;&nbsp;Person.call(this, name); // we call the Person constructor since it&#039;s the superclass
&nbsp;&nbsp;this.skills = skills;
&nbsp;&nbsp;this.getSkills = function() {
&nbsp;&nbsp;&nbsp;&nbsp;return this.skills;
&nbsp;&nbsp;};
}
Developer.prototype = new Person();
Developer.prototype.constructor = Developer;
</code></pre></p>
<p>Now we&#8217;ll create a new Developer, with the name &#8220;Jon Rohan&#8221; and skills ["Javascript", "HTML", "CSS"]. When we create the new developer, he&#8217;ll also have the getName method inherited from the Person class, and the getSkills method from the Developer class.</p>
<p><pre><code>var d = new Developer(&quot;Jon Rohan&quot;,[&quot;Javascript&quot;, &quot;HTML&quot;, &quot;CSS&quot;]);
// output: Jon Rohan
console.log(d.getName());
// output: Javascript, HTML, CSS
console.log(d.getSkills().join(&quot;, &quot;)); 
</code></pre></p>
<p>This is the basic ideas behind Object Oriented Programming in JavaScript, I&#8217;ve only really scratched the surface in JavaScript OOP. Check my <a href="http://www.dinnermint.org/feed/">RSS</a> or <a href="http://www.twitter.com/jonrohan">Twitter</a> for new posts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/javascript/javascript-classes-and-inheritance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating Triangles in CSS</title>
		<link>http://www.dinnermint.org/css/creating-triangles-in-css/</link>
		<comments>http://www.dinnermint.org/css/creating-triangles-in-css/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 17:00:59 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[tricks]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2239</guid>
		<description><![CDATA[I&#8217;ve come across a few techniques and tips in my career, while working at my last gig a co-worker pointed me to this technique. I believe this was originally discovered by the legendary Eric Meyer, but I couldn&#8217;t find much documentation about it on the web so I thought I would describe it here. Demo [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve come across a few techniques and tips in my career, while working at my last gig a co-worker pointed me to this technique. I believe this was originally discovered by the legendary Eric Meyer, but I couldn&#8217;t find much documentation about it on the web so I thought I would describe it here.</p>
<h3>Demo</h3>
<div class="css-arrow-left"></div>
<div class="css-arrow-up"></div>
<div class="css-arrow-right"></div>
<div class="css-arrow-down"></div>
<div class="clearfix"></div>
<h3>How it works</h3>
<p>Few people realize when a browser draws the borders, it draws them at angles. This technique takes advantage of that. One side of the border is colored for the color of the arrow, and the rest are transparent. Then you set the width of the border to something large, the ones above are 20px. To demonstrate here is a div with all sides colored.</p>
<div class="css-arrow-multicolor"></div>
<p><pre><code>&lt;div class=&quot;css-arrow-multicolor&quot;&gt;&lt;/div&gt;

.css-arrow-multicolor {
&nbsp;&nbsp;border-color: red green blue orange;
&nbsp;&nbsp;border-style:solid;
&nbsp;&nbsp;border-width:20px;
&nbsp;&nbsp;width:0;
&nbsp;&nbsp;height:0;
}</code></pre><br />
As you can see there are triangles hidden in that square. These triangles are right triangles with a little tweaking with the border sizes you can get acute triangles.</p>
<div class="css-arrow-acute"></div>
<p><pre><code>.css-arrow-acute {
&nbsp;&nbsp;border-color: red green blue orange;
&nbsp;&nbsp;border-style:solid;
&nbsp;&nbsp;border-width:25px 10px 15px 30px;
&nbsp;&nbsp;width:0;
&nbsp;&nbsp;height:0;
}</code></pre><br />
With a little creativity and tweaking there are lots of shapes that can be made.<br />
<code>border-style:dotted;</code></p>
<div class="css-arrow-multicolor" style="border-style:dotted;"></div>
<p><br/><br />
<code>border-style:dashed;</code></p>
<div class="css-arrow-multicolor" style="border-style:dashed;"></div>
<p><br/><br />
<code>border-style:outset;</code></p>
<div class="css-arrow-multicolor" style="border-style:outset;"></div>
<p><br/><br />
<code>border-style:inset;</code></p>
<div class="css-arrow-multicolor" style="border-style:inset;"></div>
<p><br/><br />
<code>border-style:ridge;</code></p>
<div class="css-arrow-multicolor" style="border-style:ridge;"></div>
<p><br/><br />
<code>border-style:groove;</code></p>
<div class="css-arrow-multicolor" style="border-style:groove;"></div>
<p><br/><br />
<code>border-style:double;</code></p>
<div class="css-arrow-multicolor" style="border-style:double;"></div>
<p><br/><br />
Now for application:</p>
<div class="chat-bubble">
Buongiorno!</p>
<div class="chat-bubble-arrow-border"></div>
<div class="chat-bubble-arrow"></div>
</div>
<p>This is a classic chat bubble, no images used.</p>
<p><pre><code>
&lt;div class=&quot;chat-bubble&quot;&gt;
&nbsp;&nbsp;Buongiorno!
&nbsp;&nbsp;&lt;div class=&quot;chat-bubble-arrow-border&quot;&gt;&lt;/div&gt;
&nbsp;&nbsp;&lt;div class=&quot;chat-bubble-arrow&quot;&gt;&lt;/div&gt;
&lt;/div&gt;

.chat-bubble {
&nbsp;&nbsp;background-color:#EDEDED;
&nbsp;&nbsp;border:2px solid #666666;
&nbsp;&nbsp;font-size:35px;
&nbsp;&nbsp;line-height:1.3em;
&nbsp;&nbsp;margin:10px auto;
&nbsp;&nbsp;padding:10px;
&nbsp;&nbsp;position:relative;
&nbsp;&nbsp;text-align:center;
&nbsp;&nbsp;width:300px;
&nbsp;&nbsp;-moz-border-radius:10px;
&nbsp;&nbsp;-webkit-border-radius:10px;
&nbsp;&nbsp;-moz-box-shadow:0 0 5px #888888;
&nbsp;&nbsp;-webkit-box-shadow:0 0 5px #888888;
}

.chat-bubble-arrow-border {
&nbsp;&nbsp;border-color: #666666 transparent transparent transparent;
&nbsp;&nbsp;border-style: solid;
&nbsp;&nbsp;border-width: 10px;
&nbsp;&nbsp;height:0;
&nbsp;&nbsp;width:0;
&nbsp;&nbsp;position:absolute;
&nbsp;&nbsp;bottom:-22px;
&nbsp;&nbsp;left:30px;
}

.chat-bubble-arrow {
&nbsp;&nbsp;border-color: #EDEDED transparent transparent transparent;
&nbsp;&nbsp;border-style: solid;
&nbsp;&nbsp;border-width: 10px;
&nbsp;&nbsp;height:0;
&nbsp;&nbsp;width:0;
&nbsp;&nbsp;position:absolute;
&nbsp;&nbsp;bottom:-19px;
&nbsp;&nbsp;left:30px;
}</code></pre></p>
<p>This technique doesn&#8217;t work in ie6 as is, mainly because ie6 doesn&#8217;t allow transparent borders, but there is a fix for that. What you need to do is give the &#8220;transparent&#8221; sides a completely different color like pink and then use filter: chroma to turn that color transparent.<br />
<pre><code>&nbsp;&nbsp;/* IE6 */
.chat-bubble-arrow {
&nbsp;&nbsp;&nbsp;&nbsp;_border-left-color: pink;
&nbsp;&nbsp;&nbsp;&nbsp;_border-bottom-color: pink;
&nbsp;&nbsp;&nbsp;&nbsp;_border-right-color: pink;
&nbsp;&nbsp;&nbsp;&nbsp;_filter: chroma(color=pink);
}
</code></pre></p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/tutorial/css-clear-fixes/' rel='bookmark' title='Permanent Link: CSS Clear Fixes'>CSS Clear Fixes</a></li>
<li><a href='http://www.dinnermint.org/share/wed-development-bookmarklets/' rel='bookmark' title='Permanent Link: Web Development Bookmarklets'>Web Development Bookmarklets</a></li>
<li><a href='http://www.dinnermint.org/tutorial/targeting-ie6-with-html-css/' rel='bookmark' title='Permanent Link: Targeting IE6 for style'>Targeting IE6 for style</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/css/creating-triangles-in-css/feed/</wfw:commentRss>
		<slash:comments>75</slash:comments>
		</item>
		<item>
		<title>Redbeacon</title>
		<link>http://www.dinnermint.org/portfolio/redbeacon/</link>
		<comments>http://www.dinnermint.org/portfolio/redbeacon/#comments</comments>
		<pubDate>Tue, 15 Sep 2009 02:24:40 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2312</guid>
		<description><![CDATA[Redbeacon matches consumers needing virtually any service to qualified local businesses and professionals who can do the job at the time and place you need. I was contracted by them to work on their front end in preparation for their TechCruch50 launch. I worked on the JavaScript, CSS, HTML.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.redbeacon.com/" target="_blank"><img src="http://www.dinnermint.org/wp-content/uploads/2009/09/redbeacon.jpg" alt="redbeacon" title="redbeacon" width="800" height="851" class="alignright size-full wp-image-2313" /></a></p>
<section><a href="http://www.redbeacon.com/" target="_blank">Redbeacon</a> matches consumers needing virtually any service to qualified local businesses and professionals who can do the job at the time and place you need. I was contracted by them to work on their front end in preparation for their TechCruch50 launch. I worked on the JavaScript, CSS, HTML.</section>
]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/portfolio/redbeacon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&lt;!DOCTYPE HTML&gt;</title>
		<link>http://www.dinnermint.org/html/doctype-html/</link>
		<comments>http://www.dinnermint.org/html/doctype-html/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 17:00:58 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[dom]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[mobile web]]></category>
		<category><![CDATA[safari]]></category>
		<category><![CDATA[semantic]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[web standards]]></category>
		<category><![CDATA[XHTML]]></category>
		<category><![CDATA[XML]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2208</guid>
		<description><![CDATA[I like to mix it up on my blog, sometimes posting experiments, and sometimes posting fundamental front end posts. This is a fundamental, but a crucial step in creating a website. Choosing the correct DOCTYPE for your site. What is the Document Type Declaration? A proper DOCTYPE is essential for the correct rendering and functioning [...]]]></description>
			<content:encoded><![CDATA[<p>I like to mix it up on my blog, sometimes posting experiments, and sometimes posting fundamental front end posts. This is a fundamental, but a crucial step in creating a website. Choosing the correct <code>DOCTYPE</code> for your site. </p>
<h3>What is the Document Type Declaration?</h3>
<p>A proper DOCTYPE is essential for the correct rendering and functioning of a website in compliant browsers. If you forget to declare a DOCTYPE, on use an incomplete one, then the browser will render in quirks mode, in which the browser will try and be backward compliant leaving you with a website that might as well have the hard hat under construction animated gif on it. </p>
<p>There are typically 3 types associated with each lang version. Strict, transitional, and frameset. Use Strict when you want a pure website that only uses the lang version&#8217;s current tags. Use transitional, when you have a site that you will be using some depreciated tags. Use frameset, when you include frames.</p>
<h3>Pure Clean HTML</h3>
<p>The HTML DTD are the most typical you&#8217;d find on websites. Use the HTML definition when writing plain old standard HTML. Great thing about this is by using standards there&#8217;s no surprises for any browsers when parsing your page. </p>
<h4>HTML 4.01 Frameset</h4>
<p><pre><code>&lt;!DOCTYPE HTML PUBLIC&nbsp;&nbsp;&quot;-//W3C//DTD HTML 4.01 Frameset//EN&quot; 
&nbsp;&nbsp;&quot;http://www.w3.org/TR/html4/frameset.dtd&quot;&gt;</code></pre></p>
<h4>HTML 4.01 Transitional</h4>
<p><pre><code>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;
&nbsp;&nbsp;&quot;http://www.w3.org/TR/html4/loose.dtd&quot;&gt;</code></pre></p>
<h4>HTML 4.01 Strict</h4>
<p><pre><code>&lt;!DOCTYPE HTML PUBLIC&nbsp;&nbsp;&quot;-//W3C//DTD HTML 4.01//EN&quot;
&nbsp;&nbsp;&quot;http://www.w3.org/TR/html4/strict.dtd&quot;&gt;</code></pre></p>
<h4>HTML 5</h4>
<p>I love the new HTML 5 DOCTYPE. Why? Because this is all it is.</p>
<pre><code>&lt;!DOCTYPE HTML&gt;</code></pre>
<h3>X is for Extreme</h3>
<p>The X in XHTML actually is referring to the fact that XHTML documents are XML conforming. This means that XML tools can more easily validate and parse the HTML. Another advantage of XHTML is that it is as extensable as XML. Meaning you can create your own html tags and use them, here&#8217;s an example of what I mean.<br />
<pre><code>&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
&nbsp;&nbsp;&lt;head&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;A Math Example&lt;/title&gt;
&nbsp;&nbsp;&lt;/head&gt;
&nbsp;&nbsp;&lt;body&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;The following is MathML markup:&lt;/p&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;apply&gt; &lt;log/&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;logbase&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;cn&gt; 3 &lt;/cn&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/logbase&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ci&gt; x &lt;/ci&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/apply&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/math&gt;
&nbsp;&nbsp;&lt;/body&gt;
&lt;/html&gt;
</code></pre> </p>
<p>This can be extremely useful when you are using an unofficial webstandard like <a href="http://microformats.org/" target="_blank">microformats</a>, <a href="http://www.foaf-project.org/" target="_blank">foaf</a>, etc&#8230;</p>
<p>Here are the declarations for XHTML.</p>
<h4>XHTML 1.0 Strict</h4>
<p><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC&nbsp;&nbsp;&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;
&nbsp;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;</code></pre></p>
<h4>XHTML 1.0 Transitional</h4>
<p><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC&nbsp;&nbsp;&quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&nbsp;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;</code></pre></p>
<h4>XHTML 1.0 Frameset</h4>
<p><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC&nbsp;&nbsp;&quot;-//W3C//DTD XHTML 1.0 Frameset//EN&quot;
&nbsp;&nbsp;&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;</code></pre></p>
<h4>XHTML 1.1</h4>
<p><pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE html PUBLIC&nbsp;&nbsp;&quot;-//W3C//DTD XHTML 1.1//EN&quot;
&nbsp;&nbsp;&quot;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;</code></pre></p>
<h3>So which do I choose?</h3>
<p>Let me answer this question with a question. What will be the focus of your site? When you are building a site that will be viewed on non-standard browsers (eg. some mobile browsers, the kindle, the wii) then XHTML is your best choice. When you are building a site that&#8217;s gonna be viewed in standard browsers, (eg. firefox, safari, ie, opera) then HTML is what you should be using.</p>
<p>To decide how to pick between Strict, transitional, and frameset, this really depends on your coding style. I think you should use Strict and in special circumstances use transitional and frameset. My favorite at the moment is the HTML 5 DTD, it&#8217;s extremely simple to remember. <code>&lt;!DOCTYPE HTML&gt;</code> </p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/html/getting-started-with-html-5/' rel='bookmark' title='Permanent Link: Getting Started with HTML 5'>Getting Started with HTML 5</a></li>
<li><a href='http://www.dinnermint.org/tutorial/css3-font-face/' rel='bookmark' title='Permanent Link: CSS 3 @font-face'>CSS 3 @font-face</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/html/doctype-html/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Javascript Geolocation API</title>
		<link>http://www.dinnermint.org/javascript/javascript-geolocation-api/</link>
		<comments>http://www.dinnermint.org/javascript/javascript-geolocation-api/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 00:06:42 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[geolocation]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[mobile web]]></category>
		<category><![CDATA[safari]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2131</guid>
		<description><![CDATA[More and more devices today are connected, to the web and to your location. Some of the most recent browsers and OS&#8217;s have location built in, (eg. mobile safari, snow leopard, FF 3.5, &#8230;). The API doesn&#8217;t care what is updating the location, it just grabs the location from the navigator.geolocation object. Here&#8217;s a closer [...]]]></description>
			<content:encoded><![CDATA[<p>More and more devices today are connected, to the web and to your location. Some of the most recent browsers and OS&#8217;s have location built in, (eg. mobile safari, snow leopard, FF 3.5, &#8230;). </p>
<p>The API doesn&#8217;t care what is updating the location, it just grabs the location from the navigator.geolocation object. Here&#8217;s a closer look at the interface.</p>
<h3>Geolocation interface</h3>
<p><pre><code>interface Geolocation { 
&nbsp;&nbsp;&nbsp;&nbsp;void getCurrentPosition(in PositionCallback successCallback, [Optional] in PositionErrorCallback errorCallback, [Optional] in PositionOptions options);

&nbsp;&nbsp;&nbsp;&nbsp;long watchPosition(in PositionCallback successCallback, [Optional] in PositionErrorCallback errorCallback, [Optional] in PositionOptions options);

&nbsp;&nbsp;&nbsp;&nbsp;void clearWatch(in int watchId);
&nbsp;&nbsp;};

&nbsp;&nbsp;[Callback=FunctionOnly, NoInterfaceObject]
&nbsp;&nbsp;interface PositionCallback {
&nbsp;&nbsp;&nbsp;&nbsp;void handleEvent(in Position position);
&nbsp;&nbsp;};

&nbsp;&nbsp;[Callback=FunctionOnly, NoInterfaceObject]
&nbsp;&nbsp;interface PositionErrorCallback {
&nbsp;&nbsp;&nbsp;&nbsp;void handleEvent(in PositionError error);
&nbsp;&nbsp;};
</code></pre></p>
<p><strong>getCurrentPosition()</strong> &#8211; takes three arguments. The first (required) is the <code>successCallback</code> function which you define to handle the asynchronous call. The second (optional) is the <code>errorCallback</code> function, for when you can&#8217;t be found. The last is <code>PositionOptions</code> object which you can specify <code>Boolean enableHighAccuracy</code>, <code>long timeout</code> and <code>long maximumAge</code>. The function will get the position and pass it to the successCallback function as a position object. </p>
<p><strong>watchPosition()</strong> &#8211; takes the same three arguments as <code>getCurrentPosition</code>. And on the surface it does the same thing as it, with one big exception. <code>watchPosition</code> will call the successCallback every time the position changes. So if you wanted to create a mobile app that follows you walking down the street, this would be the function to use. When called the function returns a unique identifier, which you use to call the last function.</p>
<p><strong>clearWatch()</strong> &#8211; takes one argument, the unique identifier from the watchPosition method. This method will clear the watch timer.</p>
<h3>Demo</h3>
<p>I wrote a small example that will get your lat, long and display it.</p>
<p><pre><code>function getLocation() {
&nbsp;&nbsp;if(navigator.geolocation) {
&nbsp;&nbsp;&nbsp;&nbsp;navigator.geolocation.getCurrentPosition(foundLocation, noLocation);
&nbsp;&nbsp;} else {
&nbsp;&nbsp;&nbsp;&nbsp;noLocation();
&nbsp;&nbsp;}
}

function foundLocation(position) {
&nbsp;&nbsp;var lat = position.coords.latitude;
&nbsp;&nbsp;var long = position.coords.longitude;
&nbsp;&nbsp;$(&quot;#current-location&quot;).replaceWith(&#039;&lt;a id=&quot;current-location&quot; href=&quot;http://maps.google.com/?q=&#039; + lat + &#039;,&#039; + long + &#039;&quot; target=&quot;_blank&quot;&gt;&#039; + lat + &#039;, &#039; + long + &#039;&lt;/a&gt;&#039;);
}

function noLocation() {
&nbsp;&nbsp;$(&quot;#current-location&quot;).text(&#039;Could not find location&#039;);
}
$(&quot;#get-location&quot;).click(getLocation);</code></pre></p>
<p>Disclaimer: I&#8217;ve tested this in Firefox 3.5 on my Mac, and my iPhone mobile Safari.</p>
<p><strong>Coordinates: </strong><span id="current-location">Check location by clicking the button.</span></p>
<p><button id="get-location" type="button">Check My Location</button></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/javascript/javascript-geolocation-api/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Getting Started with HTML 5</title>
		<link>http://www.dinnermint.org/html/getting-started-with-html-5/</link>
		<comments>http://www.dinnermint.org/html/getting-started-with-html-5/#comments</comments>
		<pubDate>Tue, 01 Sep 2009 16:18:32 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[html5]]></category>
		<category><![CDATA[ie]]></category>
		<category><![CDATA[semantic]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=1972</guid>
		<description><![CDATA[HTML 5 is the next major iteration of HTML, and I know I&#8217;m excited about it. I recently added some new HTML 5 markup into dinnermint. It was a very quick and simple change, which I believe will help clear up some of the &#60;div&#62; soup. The New Tags There are some new tags in [...]]]></description>
			<content:encoded><![CDATA[<p>HTML 5 is the next major iteration of HTML, and I know I&#8217;m excited about it. I recently added some new HTML 5 markup into dinnermint. It was a very quick and simple change, which I believe will help clear up some of the <code>&lt;div&gt;</code> soup.</p>
<h3>The New Tags</h3>
<p>There are some <a href="http://www.w3schools.com/tags/html5.asp">new tags</a> in the HTML 5 specification, that I believe will lead to more semantic code. And what I mean by that is the code says what it does. You&#8217;re no longer left wondering what those <code>&lt;div&gt;</code> tags are for, when you see a tag like <code>&lt;header&gt;</code> you know what it is for.</p>
<h3>The Layout</h3>
<p>There are lost of tags I could have used, like <code>aside, audio, video</code>. I plan on playing around with those later, but for now I set up a basic layout consisting of a <code>header, nav, article, footer</code> like so.<br />
<pre><code>&lt;body&gt;
&nbsp;&nbsp;&lt;header&gt;
&nbsp;&nbsp;&nbsp;&nbsp;&lt;nav&gt;&lt;/nav&gt;
&nbsp;&nbsp;&lt;/header&gt;
&nbsp;&nbsp;&lt;article&gt;
&nbsp;&nbsp;&lt;/article&gt;
&nbsp;&nbsp;&lt;footer&gt;
&nbsp;&nbsp;&lt;/footer&gt;
&lt;/body&gt;
</code></pre></p>
<p>These elements behave like typical block level elements. But are more semantic, if you aren&#8217;t sure of the benefits of this check out this post I wrote on <a href="http://www.dinnermint.org/css/semantic-css-class-naming/" target="_blank">CSS class names</a>. If you are thinking about setting up your site, you can at least use <code>header, footer, nav</code>. If you do setup your site, there are a few things you should know. </p>
<ul>
<li><strong>DOCTYPE</strong> One of my favorite new features of HTML 5. Now you don&#8217;t have to remember a long DOCTYPE when starting a page, just use <code>&lt;!DOCTYPE HTML&gt;</code> and that&#8217;s it!</li>
<li><strong>HTML 4 Browsers</strong> Sigh, unfortunately not all browsers are on the same page, what you&#8217;ll need to do so these elements will be rendered like plain old block elements is below.</li>
</ul>
<p>Add this to your stylesheet, this just reminds the browsers how to display these tags.<br />
<pre><code>header, section, footer,
aside, nav, article, figure {
&nbsp;&nbsp;display: block;
}</code></pre></p>
<p>Add this to the <strong>Beginning</strong> of the <code>&lt;body&gt;</code> tag. This is important for IE browsers, all it is doing is creating an element in the dom for each of the html 5 tags so it doesn&#8217;t ignore them. It&#8217;s important you place this script before any html 5 tags are used, at the top of the page.<br />
<pre><code>&lt;!--[if IE]&gt;
&nbsp;&nbsp;&lt;script type=&quot;text/javascript&quot;&gt;
&nbsp;&nbsp;&nbsp;&nbsp;(function(){if(!/*@cc_on!@*/0)return;
&nbsp;&nbsp;&nbsp;&nbsp;var e = &quot;abbr,article,aside,audio,bb,canvas,datagrid,datalist,details,dialog,eventsource,&quot; +
&nbsp;&nbsp;&nbsp;&nbsp;&quot;figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,time,video&quot;;.
&nbsp;&nbsp;&nbsp;&nbsp;split(&#039;,&#039;),i=e.length;while(i--){document.createElement(e[i])}})()
&nbsp;&nbsp;&lt;/script&gt;
&lt;![endif]--&gt;
</code></pre></p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/html/doctype-html/' rel='bookmark' title='Permanent Link: &lt;!DOCTYPE HTML&gt;'>&lt;!DOCTYPE HTML&gt;</a></li>
<li><a href='http://www.dinnermint.org/tutorial/targeting-ie6-with-html-css/' rel='bookmark' title='Permanent Link: Targeting IE6 for style'>Targeting IE6 for style</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/html/getting-started-with-html-5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery Auto-growing Textarea Plugin</title>
		<link>http://www.dinnermint.org/javascript/jquery-growing-textbox-plugin/</link>
		<comments>http://www.dinnermint.org/javascript/jquery-growing-textbox-plugin/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 16:56:59 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2054</guid>
		<description><![CDATA[This is a ui element I created which takes inspiration from facebook's excellent growing textarea. Or at least I believe facebook was one of the first to create this. How it works is when text in typed into the textarea and it becomes longer than the textarea height, then the textarea will grow.]]></description>
			<content:encoded><![CDATA[<p>This is a ui element I created which takes inspiration from facebook&#8217;s excellent growing textarea. Or at least I believe facebook was one of the first to create this.</p>
<p>How it works is when text is typed into the textarea and it becomes longer than the textarea height, then the textarea will grow. I&#8217;m keeping this plugin in a github repository, fork it, clone it <a href="http://github.com/JonRohan/javascript/blob/9260a2bfd422aad895b3bec8444ae32eca0a512e/src/jquery/plugins/jquery.growing-textarea.js">My Javascript Git Repository</a>.</p>
<h3>Demo</h3>
<p><textarea class="ghost_text" placeholder="Type in me and watch me grow..." style="width:750px;"></textarea></p>
<p>The key to making something like this work, is you need to create div element that copies the text from the textarea to the div. The div naturally will grow when it has more text in it. When it does, you get the height of the div element and apply it to the textarea. </p>
<p>Here&#8217;s how you would init the growing text box.</p>
<pre><code>$(&quot;textarea&quot;).growing();</code></pre>
<p>I&#8217;ve also added some options you can pass in, growning({maxHeight:300,minHeight:40,buffer:20}) the max and min height are pretty self explainitory. The buffer is the space below the text in the textarea, if you want an extra line below the currently typing line.</p>
<h3>The Code</h3>
<p>Currently I&#8217;m adding a class to the div called faketextarea so I can style it the same as the textarea. This is important becuase if one element has more padding than the other, then the heights will be messed up. and this plugin won&#8217;t work exactly right.</p>
<p><pre><code>.faketextarea, textarea {
&nbsp;&nbsp;padding: 5px;
&nbsp;&nbsp;border: 1px solid #efefef;
}</code></pre></p>
<p><pre><code>/* Copyright (c) 2009 Jon Rohan (http://dinnermint.org)
 * Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
 * and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
 *
 * Version: 1.0.0
 * Written with jQuery 1.3.2
 */
(function($){
&nbsp;&nbsp;$.fn.growing = function(options){
&nbsp;&nbsp;&nbsp;&nbsp;var settings = $.extend({
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; maxHeight: 400,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; minHeight: 40,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; buffer: 0
&nbsp;&nbsp;&nbsp;&nbsp;}, options);
&nbsp;&nbsp;&nbsp;&nbsp;return this.each(function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var textarea = $(this); //cache the textarea
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var minh = textarea.height()&gt;settings.minHeight?textarea.height():settings.minHeight;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var w = parseInt(textarea.width()||textarea.css(&quot;width&quot;)); //get the width of the textarea
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var div = $(&quot;&lt;div class=&#039;faketextarea&#039; style=&#039;position:absolute;left:-10000px;width:&quot; + w + &quot;px;padding:&quot; + textarea.css(&quot;padding&quot;) +&quot;;border:&quot; + textarea.css(&quot;border&quot;) + &quot;;&#039;&gt;&lt;/div&gt;&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textarea.after(div);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var resizeBox = function(){
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var html = textarea.val().replace(/(&lt;|&gt;)/g, &#039;&#039;).replace(/n/g,&quot;&lt;br&gt;|&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(html!=div.html()) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;div.html(html);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var h = div.height();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;prevh = textarea.height();
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var newh = h&lt;=minh?minh:(h&gt;settings.maxHeight?settings.maxHeight:h);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;newh += settings.buffer;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(newh&gt;=settings.maxHeight) {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textarea.css(&quot;overflow&quot;,&quot;auto&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;} else {
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textarea.css(&quot;overflow&quot;,&quot;hidden&quot;);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textarea.css({&quot;height&quot;:newh+&quot;px&quot;});
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textarea.keydown(resizeBox);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;textarea.keyup(resizeBox);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resizeBox();
&nbsp;&nbsp;&nbsp;&nbsp;});
&nbsp;&nbsp;};
})(jQuery);</code></pre></p>
<p>Again if you want to keep up with an updated version of this plugin check it out in <a href="http://github.com/JonRohan/javascript/blob/9260a2bfd422aad895b3bec8444ae32eca0a512e/src/jquery/plugins/jquery.growing-textarea.js">My Javascript Git Repository</a>.</p>


<p>Related posts:<ol><li><a href='http://www.dinnermint.org/share/jquery-ghost-text-plugin/' rel='bookmark' title='Permanent Link: jQuery Ghost Textbox plugin'>jQuery Ghost Textbox plugin</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/javascript/jquery-growing-textbox-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Dead Simple Git Workflow</title>
		<link>http://www.dinnermint.org/tutorial/dead-simple-git-workflow-for-agile-teams/</link>
		<comments>http://www.dinnermint.org/tutorial/dead-simple-git-workflow-for-agile-teams/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 20:00:55 +0000</pubDate>
		<dc:creator>Jon Rohan</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[pivotaltracker]]></category>

		<guid isPermaLink="false">http://www.dinnermint.org/?p=2006</guid>
		<description><![CDATA[Recently I have had the privilege to work with a few excellent small agile teams. With each team, they have their own process, which works best for them. And there&#8217;s nothing wrong with that, a team should work in it&#8217;s most effective way. But I came across a team recently that had a workflow that [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I have had the privilege to work with a few excellent small agile teams. With each team, they have their own process, which works best for them. And there&#8217;s nothing wrong with that, a team should work in it&#8217;s most effective way. But I came across a team recently that had a workflow that really impressed me. To put it simply it&#8217;s described as an extremely cool Git workflow. </p>
<p>I can&#8217;t take credit for coming up with this workflow, but I&#8217;m gonna do my best to re-describe it here so it can be shared. The basis for this post comes from reinh.com&#8217;s posts <a href="http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html">A git workflow for Agile Teams</a> and <a href="http://reinh.com/blog/2008/08/27/hack-and-and-ship.html">Hack &#038;&#038; Ship</a>. Also this workflow pulls alot from Josh Susser&#8217;s post on the <a href="http://blog.hasmanythrough.com/2008/12/18/agile-git-and-the-story-branch-pattern">story branch pattern</a>.</p>
<p>Let&#8217;s start by summarizing Josh&#8217;s post. In his post he describes a 7 step process that begins with <a href="http://www.pivotaltracker.com">Pivotal Tracker</a>. The idea being you locate a story on pivotal tracker, like a bug, or feature, or chore. Then you update your working master by pulling from the origin, and create a whole branch just for that bug. Once you&#8217;ve fixed the bug, commited it to your branch, you then merge your branch with the master and push it all back up to the origin. Then just remove the old branch and you&#8217;re done. </p>
<p>That&#8217;s the basic workflow, but there is alot of automation that can be done. The first is the creation of the branch. This isn&#8217;t terribly long command &#8216;git checkout -b&#8217; but I went ahead and created a shell alias &#8216;gcb&#8217;.</p>
<pre><code>alias gcb=&#039;git checkout -b&#039;</code></pre>
<p>So now when creating my branch for working on my bug I just type</p>
<pre><code>gcb fix_ie_bug_Story123456</code></pre>
<p>After creating my branch I would work on it normally doing &#8216;git commits&#8217; when needed. Then when I&#8217;m ready comes the cool part. Hack &#038; Ship. Hack is what it&#8217;s called when you pull the lastest code from the origin and merge it with your branch. It&#8217;s a good idea to do this often, just to keep everything up to date. To not have to type and remember the few commands for accomplishing this, I use a shell script.</p>
<p>hack.sh<br />
<pre><code>#!/bin/sh -x
# hack: Merge the latest changes from the master branch into your current branch
ref=$(git symbolic-ref HEAD 2&gt; /dev/null) || exit 0
CURRENT=&quot;${ref#refs/heads/}&quot;
git checkout master
git pull origin master
git checkout ${CURRENT}
git rebase master</code></pre></p>
<p>So during my coding, I can at anytime just type the command hack. And my branch is updated!</p>
<p>Once I&#8217;ve finished my bug and I&#8217;m ready to send it back to the origin I do one more &#8216;hack&#8217;, make sure it&#8217;s all updated. And then I ship. This will checkout the master merge my branch with it, and then push it to the origin. Once again I use a shell script for this.</p>
<p>ship.sh<br />
<pre><code>#!/bin/sh -x
# Git workflow ship script from: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
# git name-rev is fail
ref=$(git symbolic-ref HEAD 2&gt; /dev/null) || exit 0
CURRENT=&quot;${ref#refs/heads/}&quot;
git checkout master
git merge ${CURRENT}
git push origin master
git checkout ${CURRENT}</code></pre></p>
<p>Now I&#8217;m done with my bug, and there&#8217;s a script for that &#8216;dwf&#8217;. This will move me back to the master, and delete my old branch.</p>
<p>dwf.sh<br />
<pre><code>#!/bin/sh -x
# dwf, aka &quot;Done With Feature&quot; script: deletes current branch and puts you back on master
ref=$(git symbolic-ref HEAD 2&gt; /dev/null) || exit 0
CURRENT=&quot;${ref#refs/heads/}&quot;
git checkout master
git branch -d ${CURRENT}</code></pre></p>
<p>And we&#8217;re ready to repeat the whole process on a new bug/feature/chore.</p>
<p>To summarize:</p>
<p><pre><code>gcb awesome_new_feature_Story12345

develop...
commit....
hack....
[repeat]

hack
ship
dwf
</code></pre></p>
<p>You can even take this a bit farther, and create an alias for the last three commands &#8216;hsd&#8217; (hack ship done)</p>
<pre><code>alias hsd=&quot;hack &amp;&amp; ship &amp;&amp; dwf&quot;</code></pre>
<p>Which cuts our workflow to<br />
<pre><code>gcb awesome_new_feature_Story12345

develop...
commit....
hack....
[repeat]

hsd</code></pre></p>
<p>Pretty awesome! I&#8217;m sure there are hundreds of awesome workflows out there. What do you guys use on your projects?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dinnermint.org/tutorial/dead-simple-git-workflow-for-agile-teams/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
