<?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>tomauger.com</title>
	<atom:link href="http://www.tomauger.com/feed" rel="self" type="application/rss+xml" />
	<link>http://www.tomauger.com</link>
	<description>Development news, browser quirks, design factoids. Good stuff.</description>
	<lastBuildDate>Thu, 17 May 2012 16:06:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Randomizing lettering baseline with vertical-align, jQuery and lettering.js</title>
		<link>http://www.tomauger.com/2012/javascript/jquery/randomizing-lettering-baseline-with-vertical-align-jquery-and-lettering-js?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=randomizing-lettering-baseline-with-vertical-align-jquery-and-lettering-js</link>
		<comments>http://www.tomauger.com/2012/javascript/jquery/randomizing-lettering-baseline-with-vertical-align-jquery-and-lettering-js#comments</comments>
		<pubDate>Thu, 17 May 2012 16:03:09 +0000</pubDate>
		<dc:creator>tomauger</dc:creator>
				<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://www.tomauger.com/?p=368</guid>
		<description><![CDATA[Check this code snippet out. Include jQuery and the most excellent lettering.js jQuery plugin by Dave Rupert and the guys at Paravel, inc, and then paste this into a script tag, or whatever you do to get JavaScript on your page. Then, just customize the list of classes that will be &#8220;bumped&#8221;. // Bump.js by [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tomauger.com/2012/javascript/jquery/randomizing-lettering-baseline-with-vertical-align-jquery-and-lettering-js/attachment/lettering_bump" rel="attachment wp-att-369"><img class="alignnone size-full wp-image-369" title="lettering_bump" src="http://www.tomauger.com/blog/wp-content/uploads/2012/05/lettering_bump.jpg" alt="" width="382" height="167" /></a></p>
<p>Check this code snippet out. Include <a title="Dowload the latest jQuery" href="http://docs.jquery.com/Downloading_jQuery" target="_blank">jQuery </a>and the most excellent <a title="Lettering.js jQuery plugin" href="http://letteringjs.com/" target="_blank">lettering.js</a> jQuery plugin by <a title="Follow Dave Rupert (@davatron5000) on Twitter" href="https://twitter.com/#!/davatron5000" target="_blank">Dave Rupert</a> and the guys at <a title="Paravel, inc, creators of lettering.js" href="http://paravelinc.com/about/" target="_blank">Paravel, inc</a>, and then paste this into a script tag, or whatever you do to get JavaScript on your page. Then, just customize the list of classes that will be &#8220;bumped&#8221;.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Bump.js by Tom Auger (http://www.tomauger.com). Free to use for anything. Maybe leave this line intact?</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Set up some customization here for the randomness</span>
<span style="color: #003366; font-weight: bold;">var</span> classes <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
	<span style="color: #006600; font-style: italic;">// ['css selector', vertical-align variance (in pixels) eg: 2 = -2px to +2px, % chance of getting 'bumped']</span>
	<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'.text'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">10</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'#hours'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">50</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span>
	<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">'.textlist li'</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">20</span><span style="color: #009900;">&#93;</span>
<span style="color: #009900;">&#93;</span>
&nbsp;
jQuery<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>
	<span style="color: #006600; font-style: italic;">// Everything's been loaded, let's have some fun!</span>
	<span style="color: #000066; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">var</span> i<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">,</span> l<span style="color: #339933;">=</span>classes.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> i Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> $<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">css</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'vertical-align'</span><span style="color: #339933;">,</span> Math.<span style="color: #660066;">floor</span><span style="color: #009900;">&#40;</span>Math.<span style="color: #660066;">random</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">*</span><span style="color: #009900;">&#40;</span>shift<span style="color: #339933;">*</span><span style="color: #CC0000;">2</span><span style="color: #339933;">+</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span>shift <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot;px&quot;</span><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: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span id="more-368"></span></p>
<h2>Customizing Bump.js</h2>
<p>It&#8217;s really easy to customize how this script affects your HTML elements. You need to customize the &#8220;classes&#8221; array in order to reflect the css classes and selectors that your HTML document is using. The three examples that are provided will affect:</p>
<ul>
<li>all HTML elements that have a class of &#8220;text&#8221; assigned to them</li>
<li>any HTML element whose ID is &#8220;hours&#8221;</li>
<li>any LI element that&#8217;s inside any HTML element with a class of &#8220;textlist&#8221;</li>
</ul>
<p>It&#8217;s just jQuery, so if you&#8217;re familiar with jQuery <a title="jQuery selectors" href="http://api.jquery.com/category/selectors/" target="_blank">selectors</a>, this should be a breeze.</p>
<p>The next parameter is the amount of &#8220;bump&#8221;. This should always be a positive integer (ie: 1, 4, 10 but NOT -4, 3.6 or .0002). The script will take this number as a range. So a value of &#8220;2&#8243; actually translates into a random number between 2 and -2, inclusive. Do NOT add &#8220;px&#8221; to the end &#8211; the script takes care of that.</p>
<p>The final parameter is the % chance that each letter will be &#8220;bumped&#8221;. So 100 means 100%: every letter will be given some bump, based on the amount you specified in parameter 2. 10 means 10% &#8211; so 10% of all letters will get &#8220;bumped&#8221;.</p>
<p>Note that in this current algorithm, there&#8217;s a chance that, even if a letter is selected to be &#8220;bumped&#8221; it may be bumped by 0 px, so it will look like it wasn&#8217;t &#8220;bumped&#8221;. So even with a setting of 100% some letters will align to their original baseline.</p>
<h2>How it works</h2>
<p>The real heavy lifting, of course, is done with lettering.js. When you run the lettering() method on a jQuery element, lettering.js wraps each individual text character inside that element with its own &lt;span&gt; tag. So then my script comes along, and iterates through each of those &lt;span&gt;s and assigns a random vertical-align value to it (in an inline style attribute).</p>
<p>Cheap and cheerful!</p>
<p>I should turn this into a plugin, but that seems like more trouble than it&#8217;s worth. Let&#8217;s say if this post hits 5,000 reads or 20 comments asking me to do it, I&#8217;ll do it. For the children.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomauger.com/2012/javascript/jquery/randomizing-lettering-baseline-with-vertical-align-jquery-and-lettering-js/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux SVN 1-Liner: Add all new files except Dreamweaver LCK files</title>
		<link>http://www.tomauger.com/2012/tips-and-tricks/quickie/linux-svn-1-liner-add-all-new-files-except-dreamweaver-lck-files?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=linux-svn-1-liner-add-all-new-files-except-dreamweaver-lck-files</link>
		<comments>http://www.tomauger.com/2012/tips-and-tricks/quickie/linux-svn-1-liner-add-all-new-files-except-dreamweaver-lck-files#comments</comments>
		<pubDate>Fri, 20 Apr 2012 17:01:21 +0000</pubDate>
		<dc:creator>tomauger</dc:creator>
				<category><![CDATA[Quickie]]></category>
		<category><![CDATA[Subversion]]></category>
		<category><![CDATA[Unix / Linux]]></category>
		<category><![CDATA[1-liner]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[shell scripting]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[xargs]]></category>

		<guid isPermaLink="false">http://www.tomauger.com/?p=364</guid>
		<description><![CDATA[If you&#8217;re using DreamWeaver without its built-in Subversion support, or for whatever reason need to add newly-created files (that may still be checked out) to the repository, this one liner will do the trick: svn st &#124; grep &#34;^\?&#34; &#124; grep -v &#34;.LCK$&#34; &#124; awk '{print $2}' &#124; xargs svn add Let&#8217;s break it down, [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re using DreamWeaver without its built-in Subversion support, or for whatever reason need to add newly-created files (that may still be checked out) to the repository, this one liner will do the trick:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">svn</span> st <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;^\?&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #660033;">-v</span> <span style="color: #ff0000;">&quot;.LCK$&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">awk</span> <span style="color: #ff0000;">'{print $2}'</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">xargs</span> <span style="color: #c20cb9; font-weight: bold;">svn</span> add</pre></div></div>

<p lang="bash">Let&#8217;s break it down, by pipes (reading left to right):</p>
<ol>
<li>Give me a subversion status: a list of all files that have been added, modified, or otherwise</li>
<li>Using grep, only select those that start with a &#8220;?&#8221;, namely those files added to the working copy, but not yet under version control</li>
<li>Using reverse grep (the -v switch), exclude any of those records where the filename ends with &#8220;.LCK&#8221; (the DreamWeaver lock file that indicates something is checked out)</li>
<li>Using AWK, only output the second field (which translates to the filename without all the SVN flags in front of it)</li>
<li>Using XARGS, pipe this (now filtered) list of files to the svn add command.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://www.tomauger.com/2012/tips-and-tricks/quickie/linux-svn-1-liner-add-all-new-files-except-dreamweaver-lck-files/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I am a Yak Shaver.</title>
		<link>http://www.tomauger.com/2012/obscurica/i-am-a-yak-shaver?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=i-am-a-yak-shaver</link>
		<comments>http://www.tomauger.com/2012/obscurica/i-am-a-yak-shaver#comments</comments>
		<pubDate>Mon, 05 Mar 2012 20:23:28 +0000</pubDate>
		<dc:creator>tomauger</dc:creator>
				<category><![CDATA[Obscurica]]></category>

		<guid isPermaLink="false">http://www.tomauger.com/?p=356</guid>
		<description><![CDATA[I had no idea, but in researching the expression &#8220;Yak Shaving&#8221;, it appears that it applies to many, if not entirely all, of my daily activities. Including writing this post, as a natural result of trying to import a new project into my SVN repo while ignoring a directory. Totally relevant of course.]]></description>
			<content:encoded><![CDATA[<p>I had no idea, but in <a title="Yak Shaving at MIT" href="http://projects.csail.mit.edu/gsb/old-archive/gsb-archive/gsb2000-02-11.html" target="_blank">researching</a> the <a title="Wikipedia article" href="http://en.wiktionary.org/wiki/yak_shaving" target="_blank">expression </a>&#8220;Yak Shaving&#8221;, it appears that it applies to many, if not entirely all, of my daily activities.</p>
<p>Including writing this post, as a natural result of trying to import a new project into my SVN repo while ignoring a directory. Totally relevant of course.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tomauger.com/2012/obscurica/i-am-a-yak-shaver/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

