<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>GREATseth &#187; code</title>
	<atom:link href="http://greatseth.wordpress.com/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://greatseth.wordpress.com</link>
	<description>The wordsmithery of exactly one Seth Thomas Rasmussen</description>
	<lastBuildDate>Thu, 09 Oct 2008 05:57:36 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='greatseth.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1747a50a95423f70f237c1f0f1253b4b?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>GREATseth &#187; code</title>
		<link>http://greatseth.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://greatseth.wordpress.com/osd.xml" title="GREATseth" />
		<item>
		<title>geocoding info in Ruby.</title>
		<link>http://greatseth.wordpress.com/2008/07/24/geocoding-info-in-ruby/</link>
		<comments>http://greatseth.wordpress.com/2008/07/24/geocoding-info-in-ruby/#comments</comments>
		<pubDate>Thu, 24 Jul 2008 20:17:55 +0000</pubDate>
		<dc:creator>Seth Rasmussen</dc:creator>
				<category><![CDATA[everything else]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://greatseth.wordpress.com/?p=26</guid>
		<description><![CDATA[Sometime last year, around the time of the 2007 RailsConf if I recall correctly, I wrote a tiny little gem called google-geo. It's a simple group of classes for making queries against Google's geocoding service and getting some classy objects in return.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=26&subd=greatseth&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Sometime last year, around the time of the 2007 RailsConf if I recall correctly, I wrote a tiny little gem called <a title="Visit the project on GitHub" href="http://github.com/greatseth/google-geo">google-geo</a>. It&#8217;s a simple group of classes for making queries against <a href="http://code.google.com/apis/maps/documentation/services.html#Geocoding">Google&#8217;s geocoding service</a> and getting some classy objects in return.</p>
<p>Here are some choice examples from the README.</p>
<pre><code>geo = Google::Geo.new API_KEY

addresses = geo.locate '1600 Amphitheatre Parkway, Mountain View, CA'
addresses.size # 1, :locate always returns an Array

address = addresses.first

address.country      # 'US'
address.city         # 'Mountain View'
address.full_address # '1600 Amphitheatre Pkwy, Mountain View, CA 94043, USA'

address.query        # '1600 Amphitheatre Parkway, Mountain View, CA'
address.accuracy     # 8</code></pre>
<p>In the case of sufficiently vague queries, Google::Geo will return more than one:</p>
<pre><code>addresses = geo.locate 'hell'
addresses.size                # 2
addresses.map { |a| a.state } # ['PA', 'NC']</code></pre>
<p>Somebody recently contacted me about including this gem in a OpenBSD package, so I added in a LICENSE and put the project up on <a href="http://github.com">GitHub</a>.</p>
<blockquote><p>The &#8220;package&#8221; is just an OpenBSD application package. It would be similar to FreeBSD or NetBSD&#8217;s ports or Debian&#8217;s apt-get system. I&#8217;m using your Google-geo library in the web app I&#8217;m currently building. I found it very clean and helpful and though the rest of the OpenBSD community should know about it, so I&#8217;m creating an application package for it. Therefore, someone can just do a `pkg_add ruby-google-geo` and have your library installed. Also, if someone queries the OpenBSD packages looking for some kind of geo coding library, your library will pop up.</p></blockquote>
<p>Very cool! Thanks, Clint.</p>
<p>I&#8217;ve always been pleased with this library. I think it&#8217;s a great example of simple quality.</p>
<ul>
<li>First, it has tests. The tests use fixtures based on reasonable assumptions about what we can expect from Google&#8217;s service. This means that you can run the tests anytime and very quickly.</li>
<li>Second, it has no dependencies outside the standard Ruby libraries. XML parsing is relegated to a couple simple methods that use regular expressions to extract values from the response markup. Heresy, eh? No, quality. The overhead and complexity of a &#8220;real&#8221; parsing library is simply. not. needed.</li>
<li>Aaannnd you get great objects to work with.</li>
</ul>
<p>Score!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/greatseth.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/greatseth.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/greatseth.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/greatseth.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/greatseth.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/greatseth.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/greatseth.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/greatseth.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/greatseth.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/greatseth.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/greatseth.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/greatseth.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=26&subd=greatseth&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://greatseth.wordpress.com/2008/07/24/geocoding-info-in-ruby/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40823088cec28c3224ff4c46ced1beda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sethrasmussen</media:title>
		</media:content>
	</item>
		<item>
		<title>runpacker.</title>
		<link>http://greatseth.wordpress.com/2008/06/09/runpacker/</link>
		<comments>http://greatseth.wordpress.com/2008/06/09/runpacker/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 01:29:53 +0000</pubDate>
		<dc:creator>Seth Rasmussen</dc:creator>
				<category><![CDATA[everything else]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://greatseth.wordpress.com/?p=23</guid>
		<description><![CDATA[I&#8217;ve noticed that RubyGems(as of version 1.0.1, anyway) does not offer a convenient way to unpack a specified gem and all of its dependencies. So, I decided to try to come up with something simple to work around that. After a few minutes inspecting the Gem API and some help from drbrain, I ended up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=23&subd=greatseth&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve noticed that RubyGems(as of version 1.0.1, anyway) does not offer a convenient way to unpack a specified gem <em>and</em> all of its dependencies. So, I decided to try to come up with something simple to work around that. After a few minutes inspecting the <code>Gem</code> API and some help from <a href="http://blog.segment7.net/"><abbr title="Eric Hodel">drbrain</abbr></a>, I ended up with this:</p>
<pre><code>#!/usr/bin/env ruby

if ARGV.empty?
  puts "Usage: runpack gem_name"
  exit
end

require "rubygems"
gem_specified = ARGV.first
Gem.gem gem_specified
gems_to_unpack = [gem_specified] +
  Gem.loaded_specs[gem_specified].dependencies.map { |d| d.name }
gems_to_unpack.each { |g| system "gem unpack #{g}" }
</code></pre>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/greatseth.wordpress.com/23/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/greatseth.wordpress.com/23/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/greatseth.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/greatseth.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/greatseth.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/greatseth.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/greatseth.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/greatseth.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/greatseth.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/greatseth.wordpress.com/23/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/greatseth.wordpress.com/23/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/greatseth.wordpress.com/23/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=23&subd=greatseth&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://greatseth.wordpress.com/2008/06/09/runpacker/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40823088cec28c3224ff4c46ced1beda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sethrasmussen</media:title>
		</media:content>
	</item>
		<item>
		<title>a poor man&#8217;s YouTube API in Ruby.</title>
		<link>http://greatseth.wordpress.com/2008/06/04/a-poor-mans-youtube-api-in-ruby/</link>
		<comments>http://greatseth.wordpress.com/2008/06/04/a-poor-mans-youtube-api-in-ruby/#comments</comments>
		<pubDate>Wed, 04 Jun 2008 23:40:51 +0000</pubDate>
		<dc:creator>Seth Rasmussen</dc:creator>
				<category><![CDATA[everything else]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://greatseth.wordpress.com/?p=20</guid>
		<description><![CDATA[I&#8217;ve been playing with a little Merb app for my new personal website. One of the focuses of the project is for me to focus less on engineering principles and so-called best practices and more on features and doing new, creative things.
Recently I thought it would be cool if YouTube videos I linked to via [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=20&subd=greatseth&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;ve been playing with a little <a href="http://merbivore.com">Merb</a> app for <a href="http://greatseth.com">my new personal website</a>. One of the focuses of the project is for me to focus less on engineering principles and so-called best practices and more on features and doing new, creative things.</p>
<p>Recently I thought it would be cool if <a href="http://youtube.com">YouTube</a> videos I linked to via <a href="http://delicious.com/sethrasmussen">my Delicious account</a> were automatically embedded in the HTML representation of the <a href="http://pipes.yahoo.com">Yahoo! Pipes</a> <a href="http://greatseth.com/feeds/combined">feed which powers the main view of my new site</a>. I came up with this:</p>
<div>
<pre><code>CGI.unescapeHTML Hpricot(open(link)).at("#embed_code")[:value]</code></pre>
</div>
<p>Now, if you want to split hairs, it&#8217;s definitely questionable. However, context is everything, and in my current one, this solution works great.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/greatseth.wordpress.com/20/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/greatseth.wordpress.com/20/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/greatseth.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/greatseth.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/greatseth.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/greatseth.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/greatseth.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/greatseth.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/greatseth.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/greatseth.wordpress.com/20/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/greatseth.wordpress.com/20/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/greatseth.wordpress.com/20/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=20&subd=greatseth&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://greatseth.wordpress.com/2008/06/04/a-poor-mans-youtube-api-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40823088cec28c3224ff4c46ced1beda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sethrasmussen</media:title>
		</media:content>
	</item>
		<item>
		<title>hacked bot.</title>
		<link>http://greatseth.wordpress.com/2008/05/23/hacked-bot/</link>
		<comments>http://greatseth.wordpress.com/2008/05/23/hacked-bot/#comments</comments>
		<pubDate>Sat, 24 May 2008 02:03:47 +0000</pubDate>
		<dc:creator>Seth Rasmussen</dc:creator>
				<category><![CDATA[everything else]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://greatseth.wordpress.com/?p=19</guid>
		<description><![CDATA[I was recently clued into Hackbot&#8217;s HaHa&#8217;s. It is a delightful and simple concept:

Images of robots from earlier science fiction are funny.
Cheesy computer synthesized voices saying things people might say are funny.
The two combined are even funnier.

So, I made an RSS feed for Hackbot. It is powered by Dreamweaver created HTML, some of the finest [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=19&subd=greatseth&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I was recently clued into <a href="http://www.funboxcomedy.com/Fun_with_FunBox/Hackbots_HaHas.htm">Hackbot&#8217;s HaHa&#8217;s</a>. It is a delightful and simple concept:</p>
<ul>
<li>Images of robots from earlier science fiction are funny.</li>
<li>Cheesy computer synthesized voices saying things people might say are funny.</li>
<li>The two combined are even funnier.</li>
</ul>
<p>So, I made an <a href="http://greatseth.com/feeds/hackbot">RSS feed for Hackbot</a>. It is powered by Dreamweaver created HTML, some of the finest quick hackery this side of The Appalachians, and the promise that new jokes are published every Tuesday.</p>
<p>Here&#8217;s hoping..</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/greatseth.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/greatseth.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/greatseth.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/greatseth.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/greatseth.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/greatseth.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/greatseth.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/greatseth.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/greatseth.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/greatseth.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/greatseth.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/greatseth.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=19&subd=greatseth&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://greatseth.wordpress.com/2008/05/23/hacked-bot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40823088cec28c3224ff4c46ced1beda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sethrasmussen</media:title>
		</media:content>
	</item>
		<item>
		<title>bash stuff.</title>
		<link>http://greatseth.wordpress.com/2008/04/22/bash-stuff/</link>
		<comments>http://greatseth.wordpress.com/2008/04/22/bash-stuff/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 07:01:19 +0000</pubDate>
		<dc:creator>Seth Rasmussen</dc:creator>
				<category><![CDATA[everything else]]></category>
		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://greatseth.wordpress.com/?p=18</guid>
		<description><![CDATA[Chris recently wrote about bash aliases for git development. It reminded me of some bash profile tweaking I have done as I&#8217;ve gotten into git.
I use subversion as well as git, and I already had some terse aliases ingrained.
alias up='svn up'
alias upi='svn up --ignore-externals'
alias st='clear; svn st --ignore-externals'
alias sv='svn revert'
alias sc='svn ci -m'
alias sd='svn diff [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=18&subd=greatseth&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a rel="friend met" href="http://ozmm.org">Chris</a> recently wrote about <a href="http://ozmm.org/posts/git_bash_aliases.html">bash aliases for git development.</a> It reminded me of some bash profile tweaking I have done as I&#8217;ve gotten into git.</p>
<p>I use subversion as well as git, and I already had some terse aliases ingrained.</p>
<pre><code>alias up='svn up'
alias upi='svn up --ignore-externals'
alias st='clear; svn st --ignore-externals'
alias sv='svn revert'
alias sc='svn ci -m'
alias sd='svn diff | more'
alias svnc='clear; svn st | grep "^C"'
alias sres='svn resolved'</code></pre>
<p>After I make changes to my profile, I use <code>alias sp="source ~/.bash_profile"</code> to load them. To switch to git mode in a shell, I use <code>alias spgit="source ~/.git_profile"</code> which redefines all the subversion aliases as git commands. I like Chris&#8217; checkout function, but I&#8217;m going to keep my name for it.</p>
<pre><code>alias up='git pull'
alias st='clear; git status'
alias sd='git diff'
alias sc='git commit -m'
alias sa='git add .'

# sb      =&gt; git checkout master
# sb bugs =&gt; git checkout bugs
function sb {
  if [ -z "$1" ]; then
    git checkout master
  else
    git checkout $1
  fi
}</code></pre>
<p>Keeping the same aliases for conceptually similar tasks has helped to keep me from slowing down as I ease into git development.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/greatseth.wordpress.com/18/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/greatseth.wordpress.com/18/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/greatseth.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/greatseth.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/greatseth.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/greatseth.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/greatseth.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/greatseth.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/greatseth.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/greatseth.wordpress.com/18/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/greatseth.wordpress.com/18/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/greatseth.wordpress.com/18/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=greatseth.wordpress.com&blog=1629311&post=18&subd=greatseth&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://greatseth.wordpress.com/2008/04/22/bash-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/40823088cec28c3224ff4c46ced1beda?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sethrasmussen</media:title>
		</media:content>
	</item>
	</channel>
</rss>