<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>matt-darby.com posts</title>
    <link>http://matt-darby.com/feed</link>
    <description>Posts from matt-darby.com</description>
    <language>en-us</language>
    <item>
      <title>How to properly commit to a git repository</title>
      <author>Matt Darby</author>
      <link>/posts/765-how-to-properly-commit-to-a-git-repository</link>
      <description>&lt;p&gt;I&amp;#8217;ve used git for over two years now and have finally realized the proper way to commit changes.&lt;/p&gt;
&lt;p&gt;I usually commit a file and its associated RSpec spec file and list what I&amp;#8217;ve changed in the logic. This usually leads to a series of commits that describe small changes as part of a larger feature.&lt;/p&gt;
&lt;p&gt;The better way to commit (and I&amp;#8217;m sure I&amp;#8217;ve heard this before, but I guess it never really sunk in) is to commit all changed files in one commit as it (describes|creates|updates) one feature. All changed files are part of one &amp;#8220;thing&amp;#8221;, so commit them together.&lt;/p&gt;
&lt;p&gt;The committing the &amp;#8220;one file and its spec&amp;#8221; way only tells us what you changed and not necessarily &lt;em&gt;why&lt;/em&gt; you changed it. Readers can gleam what you changed by looking at the diff, they don&amp;#8217;t need you to explain.&lt;/p&gt;
&lt;p&gt;This now seems like rookie stuff (and I&amp;#8217;m sure it is), but it&amp;#8217;s something I&amp;#8217;ve missed all this time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Bonus points&lt;/strong&gt;: Use the first line of the commit message to write up a short summary (&amp;lt;= 80 characters) of the feature along with a pointer towards a (bug|feature) tracker&amp;#8217;s listing of the feature. I use &lt;code&gt;gh-01&lt;/code&gt; for the first GitHub issue. Add a blank line then give a full write up of what you did and &lt;em&gt;why&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a recent commit of mine that illustrates this point:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Added landing page, User and Wiki Dashboards (gh-64)

If you're not logged in, you will be presented with a marketing landing
page. If you're logged in and hit "/", you'll be redirected to the
"User" dashboard which shows DashboardItems from all of your Wikis. When
you go to a Wiki's #show page you'll see a dashboard of recent items
from just that Wiki. DashboardItem listings now show the Wiki in which
the event occurred.&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Sun, 21 Mar 2010 20:23:19 -0400</pubDate>
      <guid>/posts/765-how-to-properly-commit-to-a-git-repository</guid>
    </item>
    <item>
      <title>Setting default message on #errors_for in Rails' FormBuilder</title>
      <author>Matt Darby</author>
      <link>/posts/764-setting-default-message-on-errors_for-in-rails-formbuilder</link>
      <description>&lt;p&gt;I wanted to change the default message that Rails&amp;#8217; FormBuilder provides. &amp;#8220;X errors prohibited this Y from being created&amp;#8221; is just a little stiff. I dig something a little more conversational; something like &amp;#8220;Oh uh&#8230;&amp;#8221;. Being a programmer, I&amp;#8217;m lazy. I don&amp;#8217;t want to set this on every form in my app. This calls for a monkey patch. Add the below code  into a file, say something like &lt;code&gt;config/initializers/form_builder.rb&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;module ActionView
  module Helpers
    class FormBuilder

      def errors
        if error_messages.present?
          error_messages(:message =&amp;gt; "", :header_message =&amp;gt; "Oh uh&#8230; Something's up.")
        end
      end

    end
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To use this new method just add it into your form like so:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- form_for(@page) do |f|
  = f.errors
  = f.text_field :page
  = f.submit "Create Page"
  == -or-
  = link_to "Cancel", pages_path
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This gives us something a little more friendly:&lt;/p&gt;
&lt;h2&gt;Oh uh&#8230; Something&amp;#8217;s up.&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;Title can&amp;#8217;t be blank&lt;/li&gt;
&lt;/ul&gt;</description>
      <pubDate>Sun, 21 Mar 2010 01:18:55 -0400</pubDate>
      <guid>/posts/764-setting-default-message-on-errors_for-in-rails-formbuilder</guid>
    </item>
    <item>
      <title>REWORK</title>
      <author>Matt Darby</author>
      <link>/posts/763-rework</link>
      <description>&lt;p&gt;Jason Fried and &lt;span class="caps"&gt;DHH&lt;/span&gt; have written new book named &lt;a href="http://www.amazon.com/Rework-Jason-Fried/dp/0307463745/ref=sr_1_1?ie=UTF8&amp;amp;s=books&amp;amp;qid=1268954421&amp;amp;sr=8-1"&gt;&lt;span class="caps"&gt;REWORK&lt;/span&gt;&lt;/a&gt;. It&amp;#8217;s made me realize that many ideas I&amp;#8217;ve held aren&amp;#8217;t revolutionary, and yet more optimistically, not unfounded.&lt;/p&gt;
&lt;p&gt;In the book, they outline the ideas of being more personal with your process, coworkers, clients, and process. Being real over bullshit. George Carlin is nodding. When George smiles, I smile.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been inspired to blog more. Share more. I&amp;#8217;ll try.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been working on a new project that I hope to launch in the next month. It&amp;#8217;s not a revolutionary idea, but it aims to occupy a space that hasn&amp;#8217;t been filled. It scratches an itch I have, and I hope there are others out there have the same itch.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ll post more soon.&lt;/p&gt;</description>
      <pubDate>Thu, 18 Mar 2010 19:22:04 -0400</pubDate>
      <guid>/posts/763-rework</guid>
    </item>
    <item>
      <title>Reading forgotten code</title>
      <author>Matt Darby</author>
      <link>/posts/762-reading-forgotten-code</link>
      <description>&lt;div class="float_left"&gt;&lt;img src="http://content.matt-darby.com/files/104/medium/Screen_shot_2009-09-23_at_2.52.53_PM.png?1253744729" alt="" /&gt;&lt;/div&gt;
&lt;p&gt;I recently found twenty old Subversion repositories I&amp;#8217;d forgotten about on my home Linux server. They seem to be from early 2004 to the end of 2007, and most hold code developed during and for my graduate studies.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m pleased to say that the code is horrifically bad. I&amp;#8217;ve learned quite a lot in the last few years, and I can&amp;#8217;t wait to look back at this era of code and shudder.&lt;/p&gt;
&lt;p&gt;The image above is from a &lt;span class="caps"&gt;PHP&lt;/span&gt; function that counts the number of neighbors a given cell has in a generation instance in &lt;a href="http://en.wikipedia.org/wiki/Conway%27s_Game_of_Life"&gt;Conway&amp;#8217;s Game Of Life&lt;/a&gt; . While the Game of Life is normally played in two dimensions, this function actually incorporates the third dimension, so a cell could have twenty-six neighbors instead of the standard eight. It is also edge-aware and wraps the playing surface appropriately.&lt;br /&gt;
&lt;div class="clear"&gt;&lt;/div&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 23 Sep 2009 18:33:06 -0400</pubDate>
      <guid>/posts/762-reading-forgotten-code</guid>
    </item>
    <item>
      <title>Brewing your own beer</title>
      <author>Matt Darby</author>
      <link>/posts/761-brewing-your-own-beer</link>
      <description>&lt;p&gt;I&amp;#8217;ve had several friends ask how the home beer brewing process works so I figured I would document my latest batch, a Belgian Ale.&lt;/p&gt;
&lt;h3&gt;Terms&lt;/h3&gt;
&lt;p&gt;&lt;strong&gt;wort&lt;/strong&gt; (pronounced &lt;em&gt;wert&lt;/em&gt;) &amp;#8211; This is your beer before it&amp;#8217;s actually &amp;#8216;beer&amp;#8217;. &lt;br /&gt;
&lt;strong&gt;racking&lt;/strong&gt; &amp;#8211; The process of transferring your wort into the carboy, or bottling the finished beer&lt;br /&gt;
&lt;strong&gt;trub&lt;/strong&gt; &amp;#8211; The sediment at the bottom of the carboy after fermentation&lt;/p&gt;
&lt;h3&gt;Equipment&lt;/h3&gt;
&lt;p&gt;First off, you will need to buy a home brewing kit. &lt;a href="http://www.homebrewery.com/beer/beer-gs-basic-kit.shtml"&gt;Here is the kit I purchased&lt;/a&gt;. Good kits will come with:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;&lt;span class="caps"&gt;PET&lt;/span&gt; Carboy &amp;#8211; This looks like a large water cooler jug and is used to house your wort during the fermentation process. &lt;span class="caps"&gt;PET&lt;/span&gt; is a special type of plastic that is highly resistant to absorbing odors and is generally preferred to glass carboys as they are lightweight, unbreakable and easier to clean.&lt;/li&gt;
	&lt;li&gt;Carboy brush &amp;#8211; A long bendable soft brush for cleaning your carboy&lt;/li&gt;
	&lt;li&gt;Long spoon &amp;#8211; A really long plastic stirring spoon (don&amp;#8217;t use wood!)&lt;/li&gt;
	&lt;li&gt;Bottling Bucket &amp;#8211; This is a food-grade bucket with a spigot near the bottom&lt;/li&gt;
	&lt;li&gt;Bottling wand &amp;#8211; A tool that has a spring activated release at the end that greatly simplifies bottling&lt;/li&gt;
	&lt;li&gt;Hydrometer &amp;#8211; A Hydrometer checks the gravity (more on that soon) of your wort&lt;/li&gt;
	&lt;li&gt;Racking cane &amp;#8211; A straight metal tube that siphons your wort at bottling time&lt;/li&gt;
	&lt;li&gt;Air lock &amp;#8211; A device that allows carbon dioxide to escape, but keeps air out&lt;/li&gt;
	&lt;li&gt;Drilled Bung &amp;#8211; A rubber stopper with a hole in the middle&lt;/li&gt;
	&lt;li&gt;Bottle capper &amp;#8211; A handheld tool that caps your bottles&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You&amp;#8217;ll also need a good sized kettle. I use a 21 quart pot I picked up from a grocery store.&lt;br /&gt;
Oh yeah, and about 50 pop-top beer bottles &amp;#8212; so start saving them! Screw-top bottles won&amp;#8217;t work!&lt;/p&gt;
&lt;h3&gt;Ingredient Kit&lt;/h3&gt;
&lt;div class="float_left"&gt;
&lt;a href="http://content.matt-darby.com/files/91/medium/SNV34408.JPG?1252608472"&gt;&lt;img src="http://content.matt-darby.com/files/91/thumb/SNV34408.JPG?1252608472" alt="" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;These kits are available online for around $50. The kit will include all grans, malt, yeast and priming sugar that you need to make about five gallons of beer. Depending on the style of beer you&amp;#8217;re making, it might also include candy sugar, fruit essence, or even Irish Moss (which is used to clarify your beer). The yeast will either be dried powder or a liquid &amp;#8212; liquid form is the good stuff, but is perishable! Most importantly, they come with full instructions.&lt;/p&gt;
&lt;h3&gt;Preparation&lt;/h3&gt;
&lt;div class="float_left"&gt;
&lt;a href="http://content.matt-darby.com/files/92/medium/SNV34601.JPG?1252608555"&gt;&lt;img src="http://content.matt-darby.com/files/92/thumb/SNV34601.JPG?1252608555" alt="" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;&lt;em&gt;The single most important thing you must do is to make sure everything that touches the wort is sanitized.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;If bacteria gets into your wort after boiling it will cause your beer to go bad. Toxins cannot live in beer so you won&amp;#8217;t get sick or die, but you&amp;#8217;ll end up with five gallons of drain cleaner if you catch my drift.&lt;/p&gt;
&lt;p&gt;Now don&amp;#8217;t freak out too much, sanitation isn&amp;#8217;t the same thing as sterilization. I normally soak items in hot water with a good amount of bleach for a moment or two and give it a good rinse. You&amp;#8217;ll want to wash and rinse the inside of your carboy, the racking cane, airlock and bung.&lt;/p&gt;
&lt;h3&gt;Making the wort&lt;/h3&gt;
&lt;p&gt;You&amp;#8217;ll want to closely follow the included instructions, but the process follows these general steps:&lt;/p&gt;
&lt;div class="float_left"&gt;
&lt;a href="http://content.matt-darby.com/files/93/medium/SNV34525.JPG?1252608743"&gt;&lt;img src="http://content.matt-darby.com/files/93/thumb/SNV34525.JPG?1252608743" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/94/medium/SNV34531.JPG?1252608743"&gt;&lt;img src="http://content.matt-darby.com/files/94/thumb/SNV34531.JPG?1252608743" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/95/medium/SNV34540.JPG?1252608828"&gt;&lt;img src="http://content.matt-darby.com/files/95/thumb/SNV34540.JPG?1252608828" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/96/medium/SNV34541.JPG?1252608880"&gt;&lt;img src="http://content.matt-darby.com/files/96/thumb/SNV34541.JPG?1252608880" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/97/medium/SNV34543.JPG?1252608944"&gt;&lt;img src="http://content.matt-darby.com/files/97/thumb/SNV34543.JPG?1252608944" alt="" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;div style="float:right; width:480px;"&gt;
&lt;ol&gt;
	&lt;li&gt;Steeping the grains. Put the grains into the included cheesecloth bag, tie it off and throw it in a pot of water (usually between three and five gallons), and put it on to boil. Once the water hits 170 degrees, take out the grain bag and let it drain off into the pot. Toss the grains.&lt;/li&gt;
	&lt;li&gt;Adding the malt &amp;#8211; Your malt will either be in powdered or syrup form. Either way, dump it in.&lt;/li&gt;
	&lt;li&gt;Boiling &amp;#8211; Now here is the difficult part, you&amp;#8217;ll have to boil the water for about an hour. Yep.&lt;/li&gt;
	&lt;li&gt;Adding hops &amp;#8211; About 45 minutes into the boil, you&amp;#8217;ll add your flavoring hops. These look just like rabbit food pellets; just open the pack at dump them in. About 58 minutes into the boil, you&amp;#8217;ll then add the aroma hops.&lt;/li&gt;
	&lt;li&gt;Cooling &amp;#8211; The idea here is to cool down the boiling wort to room temperature as quickly as possible. The longer the wort is exposed to the air, the greater the chance of contamination. I dunk the pot in the kitchen sink filled with salted ice water. It still takes about a half hour to get it to 70 degrees.&lt;/li&gt;
	&lt;li&gt;Check the OG &amp;#8211; Take a sample of your cooled wort into the hydrometer tube and drop the hydrometer into it. The hydrometer will tell show you the Original Gravity (OG) and potential alcohol content. Make sure to record the OG!&lt;/li&gt;
	&lt;li&gt;Racking to the carboy &amp;#8211; Stick the metal end of the racking cane into the carboy and siphon the cooled wort from the pot to the carboy. Be careful to leave the sediment behind!&lt;/li&gt;
	&lt;li&gt;Add the yeast &amp;#8211; Just dump it in and give it a stir.&lt;/li&gt;
	&lt;li&gt;Put the bung into the bunghole and insert the air lock (stop laughing)&lt;/li&gt;
	&lt;li&gt;Stick the carboy in your basement for a week or so&lt;br /&gt;
&lt;/div&gt;&lt;br /&gt;
&lt;div class="clear"&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3&gt;Fermentation&lt;/h3&gt;
&lt;div class="float_left"&gt;
&lt;a href="http://content.matt-darby.com/files/98/medium/SNV34548.JPG?1252609061"&gt;&lt;img src="http://content.matt-darby.com/files/98/thumb/SNV34548.JPG?1252609061" alt="" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;At this point you can watch biology at work. The yeast cells will now go to work eating the sugars in the wort and, well, crap out alcohol. You&amp;#8217;re drinking yeast poop.&lt;/p&gt;
&lt;p&gt;The first stage of the fermentation process is interesting to watch. Within the first twenty four hours the calm wort will start to bubble and swirl as though someone is stirring the pot. You&amp;#8217;ll see little globules swimming all around and the wort will develop a large head of bubbles and the airlock will start releasing a lot of carbon dioxide gas.&lt;/p&gt;
&lt;p&gt;The entire process will take a week or two, just keep your eye on the air lock. After a while you&amp;#8217;ll see that the escaping gas and bubbles will start to decline. When all is calm, you&amp;#8217;ll want to take another gravity reading with the hydrometer. When the gravity is near the Final Gravity (FG) it&amp;#8217;s time to bottle.&lt;/p&gt;
&lt;h3&gt;Bottling&lt;/h3&gt;
&lt;div class="float_left"&gt;
&lt;a href="http://content.matt-darby.com/files/99/medium/SNV34600.JPG?1252609133"&gt;&lt;img src="http://content.matt-darby.com/files/99/thumb/SNV34600.JPG?1252609133" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/100/medium/SNV34604.JPG?1252609189"&gt;&lt;img src="http://content.matt-darby.com/files/100/thumb/SNV34604.JPG?1252609189" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/101/medium/SNV34605.JPG?1252609240"&gt;&lt;img src="http://content.matt-darby.com/files/101/thumb/SNV34605.JPG?1252609240" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/102/medium/SNV34614.JPG?1252609293"&gt;&lt;img src="http://content.matt-darby.com/files/102/thumb/SNV34614.JPG?1252609293" alt="" /&gt;&lt;/a&gt; &lt;br&gt;
&lt;a href="http://content.matt-darby.com/files/103/medium/SNV34619.JPG?1252610348"&gt;&lt;img src="http://content.matt-darby.com/files/103/thumb/SNV34619.JPG?1252610348" alt="" /&gt;&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;Soak your bottles in a bleach/water solution and rinse well in clean warm water. You&amp;#8217;ll need about 48 pop-top bottles. It sounds like a huge pain, but it&amp;#8217;s really not that bad &amp;#8212; it&amp;#8217;ll take about a half hour to do. You&amp;#8217;ll also need to sanitize the bottling bucket, racking cane, stirring spoon and bottling wand.&lt;/p&gt;
&lt;p&gt;When you&amp;#8217;re done with this, boil your bottle caps in some water for a quick moment to sanitize them and then boil the priming sugar in two cups of water. Allow both to cool to room temperature.&lt;/p&gt;
&lt;p&gt;Insert the racking cane into the carboy and siphon the fermented beer into the bottling bucket. Take care to not move the carboy as the trub will be redistribute back into the beer. Make sure to leave the trub in the carboy. Pour the priming sugar into the beer and give it a quick stir.&lt;/p&gt;
&lt;p&gt;Attach the bottling wand to the bottling bucket&amp;#8217;s spigot and then turn the spigot on. You should see nice, clean, clear beer flowing up to the end of the wand.&lt;/p&gt;
&lt;p&gt;Insert the wand into an empty bottle and press down. The beer will begin to flow; just remove the wand when the beer reaches the top of the bottle. Continue until you&amp;#8217;re out of beer! My batches have yielded about 40 bottles of beer.&lt;/p&gt;
&lt;p&gt;Cap the bottles and hide them for two weeks while the priming sugar carbonates your beer. The longer you wait to drink the better, but let the bottles sit for two weeks so they can fully carbonate!&lt;/p&gt;
&lt;h3&gt;Wrap Up&lt;/h3&gt;
&lt;p&gt;This process might seem daunting, but it&amp;#8217;s really not all that difficult.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve made two batches so far and the last one I did without help on a boring weekend day. The boiling part of the process takes about three hours and the bottling portion takes about two. Most of the time you&amp;#8217;re standing around watching pots boil.&lt;/p&gt;
&lt;p&gt;In the end, you&amp;#8217;ll be satisfied to sit down with a bottle of your very own beer. You&amp;#8217;ll be surprised how good it is! It just tastes better; you&amp;#8217;ll see.&lt;/p&gt;
&lt;h3&gt;Legality&lt;/h3&gt;
&lt;p&gt;In Ohio, you can brew up to 100 gallons of home brew per adult living in the household (up to 200 gallons total). You are fully free to share with any person of legal drinking age, however, you cannot sell any beer without a liquor license, period.&lt;/p&gt;</description>
      <pubDate>Thu, 10 Sep 2009 15:27:28 -0400</pubDate>
      <guid>/posts/761-brewing-your-own-beer</guid>
    </item>
    <item>
      <title>How to highlight code on your blog</title>
      <author>Matt Darby</author>
      <link>/posts/760-how-to-highlight-code-on-your-blog</link>
      <description>&lt;p&gt;Until recently, I used &lt;a href="http://gist.github.com"&gt;gists&lt;/a&gt; to format and present code samples on this site. &lt;a href="http://github.com"&gt;Github.com&lt;/a&gt; is awesome and has changed the way many of us work, but it&amp;#8217;s not always the fastest site on the net &amp;mdash; many times it would take several seconds to show a few gists on my site. I needed to find a different way to show these code samples.&lt;/p&gt;
&lt;p&gt;Enter &lt;a href="http://softwaremaniacs.org/soft/highlight/en"&gt;highlight.js&lt;/a&gt;. Usage is simple; just include it in the header of your page template as normal, and then call &lt;code&gt;hljs.initHighlightingOnLoad();&lt;/code&gt; on page load. The library will automatically recognize a handful of languages and colorize appropriately based on which &lt;span class="caps"&gt;CSS&lt;/span&gt; file you prefer (the package includes many sample &lt;span class="caps"&gt;CSS&lt;/span&gt; files to colorize the code block). This site currently uses &lt;code&gt;zenburn.css&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;Now, just wrap your code block in &lt;code&gt;&amp;lt;pre&amp;gt;&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;&amp;lt;/pre&amp;gt;&lt;/code&gt; tags and hit refresh.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve further styled my code block like so (using &lt;a href="http://sass-lang.org"&gt;&lt;span class="caps"&gt;SASS&lt;/span&gt;&lt;/a&gt;):&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
pre code
  :font 9px  Monaco, "Bitstream Vera Sans Mono", monospace
  :color #FFF
  :background #111
  :overflow auto
  :display block
  :padding 15px
  :padding-top 0px
  :margin 2em 0em
  :whitespace pre
code
  :font 9px  Monaco, "Bitstream Vera Sans Mono", monospace
  :background #342
  :color #9F3
  :padding 2px 5px
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 08 Sep 2009 21:50:40 -0400</pubDate>
      <guid>/posts/760-how-to-highlight-code-on-your-blog</guid>
    </item>
    <item>
      <title>Capistrano: Make sure there is something to deploy</title>
      <author>Matt Darby</author>
      <link>/posts/759-capistrano-make-sure-there-is-something-to-deploy</link>
      <description>&lt;p&gt;It seems that it&amp;#8217;s a &lt;a href="https://twitter.com/lifo/status/3766745123"&gt;common mistake&lt;/a&gt; to attempt to deploy changes to production via &lt;a href="http://www.capify.org/index.php/Capistrano"&gt;Capistrano&lt;/a&gt; before you actually push the changes to an origin repository (&lt;a href="http://github.com"&gt;github&lt;/a&gt;). This Capistrano task will warn you if you&amp;#8217;re attempting to do such a thing. Please note that I didn&amp;#8217;t author this task and I&amp;#8217;ve forgotten who originally posted it, so just passing it along.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Edit:&lt;/strong&gt; It seems that &lt;a href="http://twitter.com/sutto"&gt;Darcy Laycock&lt;/a&gt; was the &lt;a href="http://gist.github.com/45318"&gt;original author&lt;/a&gt; of this task. Thanks Darcy!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
before "deploy", "deploy:check_revision"
 
namespace :deploy do
  desc "Make sure there is something to deploy"
  task :check_revision, :roles =&amp;gt; [:web] do
    unless `git rev-parse HEAD` == `git rev-parse origin/master`
      puts ""
      puts "  \033[1;33m**************************************************\033[0m"
      puts "  \033[1;33m* WARNING: HEAD is not the same as origin/master *\033[0m"
      puts "  \033[1;33m**************************************************\033[0m"
      puts ""
 
      exit
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Fri, 04 Sep 2009 23:51:49 -0400</pubDate>
      <guid>/posts/759-capistrano-make-sure-there-is-something-to-deploy</guid>
    </item>
    <item>
      <title>True Hip Hop</title>
      <author>Matt Darby</author>
      <link>/posts/758-true-hip-hop</link>
      <description>&lt;center&gt;
&lt;p&gt;&lt;b&gt;This kid is damned good!&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/Zoa4A89pJ2Y&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/Zoa4A89pJ2Y&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Wed, 02 Sep 2009 08:44:33 -0400</pubDate>
      <guid>/posts/758-true-hip-hop</guid>
    </item>
    <item>
      <title>Rails Core Contribution Listing</title>
      <author>Matt Darby</author>
      <link>/posts/757-rails-core-contribution-listing</link>
      <description>&lt;p&gt;I just realized that I&amp;#8217;m &lt;a href="http://contributors.rubyonrails.org/contributors/matt-darby/commits"&gt;listed&lt;/a&gt; as a Rails Core Contributor. I knew I had code accepted, but wasn&amp;#8217;t aware I was listed anywhere. What&amp;#8217;s that sound? Yeah, that me tooting my own horn. Sounds good.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/77/original/Screen%20shot%202009-08-31%20at%2011.37.24%20PM.png" alt="" /&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 31 Aug 2009 23:41:06 -0400</pubDate>
      <guid>/posts/757-rails-core-contribution-listing</guid>
    </item>
    <item>
      <title>My first homebrew</title>
      <author>Matt Darby</author>
      <link>/posts/756-my-first-homebrew</link>
      <description>&lt;div class="float_left"&gt;
&lt;p&gt;&lt;img src="/files/76/original/brown_ale.jpg" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;I just cracked open my very first bottle of my first batch of home brewed ale. &lt;b&gt;Its &lt;span class="caps"&gt;GOOD&lt;/span&gt;!&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;This batch was brewed by using a pre-compiled Brown Ale kit ($40) and yielded about 43 bottles of beer. I brewed it three weeks ago, it fermented for a week in the basement (an interesting process to watch), and then I added the priming sugar and bottled.&lt;/p&gt;
&lt;p&gt;The ale is very young, having only been bottled two weeks ago, so it&amp;#8217;s flavor hasn&amp;#8217;t yet fully matured. Five weeks in the bottle is when the body and flavor fully develops, and continues to refine as it ages.&lt;/p&gt;
&lt;p&gt;The ale has definite citrus notes and kind of a weak finish, that I hope develops at the next tasting. It doesn&amp;#8217;t seem to have a strong alcohol content &amp;mdash; I&amp;#8217;d say around 4%.&lt;/p&gt;
&lt;p&gt;The next ingredient kit arrived in the mail today, it&amp;#8217;s a Belgian Tripel Ale kit, and I&amp;#8217;m excited to brew my next batch. Belgian Ales are my favorite category of ales, as they&amp;#8217;re usually very complex and have super high alcohol content. Hey, I like the taste, and I like the buzz too! The bummer with this brew is that is takes &lt;span class="caps"&gt;SIX&lt;/span&gt; &lt;span class="caps"&gt;MONTHS&lt;/span&gt; to age!&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve had a bunch of people ask about the brewing process, so I plan on posting the full experience, step by step. I hope to brew this Sunday, so stay tuned.&lt;/p&gt;
&lt;p&gt;Know what tastes better than the first beer? The second. Who says a &amp;#8216;tasting&amp;#8217; only provides one bottle?&lt;/p&gt;</description>
      <pubDate>Thu, 27 Aug 2009 21:33:39 -0400</pubDate>
      <guid>/posts/756-my-first-homebrew</guid>
    </item>
    <item>
      <title>Announcing "Socialite"</title>
      <author>Matt Darby</author>
      <link>/posts/755-announcing-socialite</link>
      <description>&lt;p&gt;I&amp;#8217;m happy to announce the release of my latest open source project, &lt;a href="http://github.com/mdarby/socialite/tree/master"&gt;Socialite&lt;/a&gt;. Socialite is a very simple Rails plugin that allows your users to help spread your content to the biggest social networking sites on the tubes.&lt;/p&gt;
&lt;p&gt;Socialite does this by adding a view helper to your application that will generate a gang of links that greatly ease the submitting of your content to the largest sites.&lt;/p&gt;
&lt;p&gt;Currently, Socialite supports Twitter, Digg, Facebook, Reddit, StumbleUpon, Technorati, and boring old email.&lt;/p&gt;
&lt;p&gt;You can install Socialite by doing:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
./script/plugin install git://github.com/mdarby/socialite.git
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Using it in your app is as easy as:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;%= socialite(:url =&amp;gt; URL, :title =&amp;gt; TITLE) %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;For further info, please check out the &lt;a href="http://github.com/mdarby/socialite/tree/master"&gt;github project&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 23 Aug 2009 15:43:46 -0400</pubDate>
      <guid>/posts/755-announcing-socialite</guid>
    </item>
    <item>
      <title>Easy AJAX UI feedback using JQuery</title>
      <author>Matt Darby</author>
      <link>/posts/754-easy-ajax-ui-feedback-using-jquery</link>
      <description>&lt;p&gt;Since &lt;a href="http://jquery.com"&gt;JQuery&lt;/a&gt; is the new black (&#8230; you are using JQuery, right?) I figured this snippet might help others out there in the ether. Add these methods to your application.js file in Rails and create a div with the ID &lt;code&gt;#spinner&lt;/code&gt; containing an &lt;a href="http://www.loadinfo.net/"&gt;&lt;span class="caps"&gt;AJAX&lt;/span&gt; spinner&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;When a form is submitted via &lt;span class="caps"&gt;AJAX&lt;/span&gt; (&lt;a href="http://api.rubyonrails.org/classes/ActionView/Helpers/PrototypeHelper.html#M001649"&gt;remote_form_for&lt;/a&gt;), the submit button will be disabled, and the spinner will show. When the &lt;span class="caps"&gt;AJAX&lt;/span&gt; call returns &lt;code&gt;#spinner&lt;/code&gt; will hide and the submit button will re-enable. This will also show/hide the spinner for any &lt;span class="caps"&gt;AJAX&lt;/span&gt; request. No muss, no fuss.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re not using JQuery, you should. It makes Javascript a pleasure to write. &lt;a href="http://ennerchi.com/projects/jrails"&gt;aaronchi&amp;#8217;s&lt;/a&gt; &lt;a href="http://github.com/aaronchi/jrails/tree/master"&gt;jrails&lt;/a&gt; plugin makes it stupid easy to add it to your existing Rails project.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
/* On page load&#8230; */
$('document').ready(function(){

  /* Disable all submit buttons when form submitted */
  $(":form").submit(function(){
    $(":submit").attr({"disabled": true, "value": "Working&#8230;"});
  });

  $(window).bind("ajaxSend", function(){
    $("#spinner").show();
  });

  $(window).bind("ajaxStop", function(){
    $("#spinner").hide();
    $(":submit").attr({"disabled": false, "value": "Submit"});
  });

};
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Sat, 22 Aug 2009 09:24:17 -0400</pubDate>
      <guid>/posts/754-easy-ajax-ui-feedback-using-jquery</guid>
    </item>
    <item>
      <title>The Big Lebowski spec</title>
      <author>Matt Darby</author>
      <link>/posts/753-the-big-lebowski-spec</link>
      <description>&lt;p&gt;&lt;center&gt;I got bored writing view specs&lt;/center&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
it "should talk about challenges" do
  do_get
  response.should include_text("challenges_faced")
  # &#8230; competitors bested, obstacles overcome, etc
  # strong_men.should.also(:cry)
end
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Tue, 18 Aug 2009 14:35:28 -0400</pubDate>
      <guid>/posts/753-the-big-lebowski-spec</guid>
    </item>
    <item>
      <title>Refactoring with resource_controller</title>
      <author>Matt Darby</author>
      <link>/posts/752-refactoring-with-resource_controller</link>
      <description>&lt;p&gt;In my day job, I oversee a B2B app (&lt;a href="http://dynamixccw.com"&gt;Dynamix &lt;span class="caps"&gt;CCW&lt;/span&gt;&lt;/a&gt; &amp;#8212; sorry; invite only) that tracks/facilitates all aspects of our business, and helps my engineering firm interface with clients and architectural and construction firms. It&amp;#8217;s fairly complex, with many layers of business logic and account restrictions. &lt;a href="http://github.com/mdarby/restful_acl/tree/master"&gt;RESTful_ACL&lt;/a&gt; and &lt;a href="http://github.com/mdarby/scribd_fu/tree/master"&gt;Scribd_Fu&lt;/a&gt; were extracted from this app in fact.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m a big fan of RSpec and testing in general (though strict &lt;span class="caps"&gt;BDD&lt;/span&gt; is frankly a bit much for my tastes), but I have to admit that I never wrote controller specs. The code was just too boring and boilerplate to write the same specs over and over again for 100+ controllers, so yeah, I just found other things to do and didn&amp;#8217;t write them.&lt;/p&gt;
&lt;p&gt;About a year ago, I was introduced to &lt;a href="http://github.com/giraffesoft/resource_controller/tree/master"&gt;resource_controller&lt;/a&gt; during a weeklong visit with &lt;a href="http://hashrocket.com"&gt;Hashrocket&lt;/a&gt;. resource_controller is a ruby gem written by &lt;a href="http://jamesgolick.com/"&gt;James Golick&lt;/a&gt; and it aims to &lt;span class="caps"&gt;DRY&lt;/span&gt; up your app&amp;#8217;s boilerplate controller code. You know the code; the boring crap that looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
class CrapsController &amp;lt; ApplicationController
  # GET /craps
  # GET /craps.xml
  def index
    @craps = Crap.all
 
    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml =&amp;gt; @craps }
    end
  end
 
  # GET /craps/1
  # GET /craps/1.xml
  def show
    @crap = Crap.find(params[:id])
 
    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml =&amp;gt; @crap }
    end
  end
 
  # GET /craps/new
  # GET /craps/new.xml
  def new
    @crap = Crap.new
 
    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml =&amp;gt; @crap }
    end
  end
 
  # GET /craps/1/edit
  def edit
    @crap = Crap.find(params[:id])
  end
 
  # POST /craps
  # POST /craps.xml
  def create
    @crap = Crap.new(params[:crap])
 
    respond_to do |format|
      if @crap.save
        flash[:notice] = 'Crap was successfully created.'
        format.html { redirect_to(@crap) }
        format.xml  { render :xml =&amp;gt; @crap, :status =&amp;gt; :created, :location =&amp;gt; @crap }
      else
        format.html { render :action =&amp;gt; "new" }
        format.xml  { render :xml =&amp;gt; @crap.errors, :status =&amp;gt; :unprocessable_entity }
      end
    end
  end
 
  # PUT /craps/1
  # PUT /craps/1.xml
  def update
    @crap = Crap.find(params[:id])
 
    respond_to do |format|
      if @crap.update_attributes(params[:crap])
        flash[:notice] = 'Crap was successfully updated.'
        format.html { redirect_to(@crap) }
        format.xml  { head :ok }
      else
        format.html { render :action =&amp;gt; "edit" }
        format.xml  { render :xml =&amp;gt; @crap.errors, :status =&amp;gt; :unprocessable_entity }
      end
    end
  end
 
  # DELETE /craps/1
  # DELETE /craps/1.xml
  def destroy
    @crap = Crap.find(params[:id])
    @crap.destroy
 
    respond_to do |format|
      format.html { redirect_to(craps_url) }
      format.xml  { head :ok }
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;By using resource_controller, you can have the functionality of this code by doing:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
class CrapsControllers &amp;lt; ResourceController::Base
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Awesome, eh? Of course, this is just the tip of the iceberg; resource_controller allows you to do far more than boilerplate RESTful resources.&lt;/p&gt;
&lt;p&gt;During a recent lull in development, and in light of all these missing controller specs, I decided to finally implement resource_controller in my app. The refactoring was really quite painless, as was writing the specs for the remaining controller code. I found that most of my controllers simply redirected to non-standard locations after an object was modified (ie, the parent object, or the :index action instead of the :show action).&lt;/p&gt;
&lt;p&gt;After devoting a few days worth of time to this refactoring, I had removed over 1000 lines of controller code. Check out the stats here:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
Before:
 
+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |  5354 |  4064 |      74 |     466 |   6 |     6 |
| Helpers              |  1534 |  1206 |       0 |     121 |   0 |     7 |
| Models               |  9778 |  5168 |     117 |     934 |   7 |     3 |
| Libraries            |   209 |   116 |       1 |      16 |  16 |     5 |
| Model specs          | 11301 |  8770 |       0 |       5 |   0 |  1752 |
| View specs           | 19340 | 14929 |       0 |     295 |   0 |    48 |
| Controller specs     |  5760 |  4356 |       0 |      73 |   0 |    57 |
| Helper specs         |  2098 |  1488 |       0 |       0 |   0 |     0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                | 55374 | 40097 |     192 |    1910 |   9 |    18 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 10554     Test LOC: 29543     Code to Test Ratio: 1:2.8
 &lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;
After:
 
+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |  4145 |  3062 |      74 |     242 |   3 |    10 |
| Helpers              |  1552 |  1220 |       0 |     124 |   0 |     7 |
| Models               |  9897 |  5266 |     117 |     951 |   8 |     3 |
| Libraries            |   209 |   116 |       1 |      16 |  16 |     5 |
| Model specs          | 11535 |  8915 |       0 |       5 |   0 |  1781 |
| View specs           | 19506 | 15059 |       0 |     299 |   0 |    48 |
| Controller specs     |  5711 |  4403 |       0 |     181 |   0 |    22 |
| Helper specs         |  2134 |  1518 |       0 |       0 |   0 |     0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                | 54689 | 39559 |     192 |    1818 |   9 |    19 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 9664     Test LOC: 29895     Code to Test Ratio: 1:3.1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In fact, this week long refactoring was a giant win in many ways. Aside from trimming 25% of all controller lines of code, I also wrote 450+ controller unit tests and increased the overall code to test ratio by 30%.&lt;/p&gt;
&lt;p&gt;Inspired by this progress, I decided to also move all inline &lt;span class="caps"&gt;RJS&lt;/span&gt; to their own templates. &lt;span class="caps"&gt;RJS&lt;/span&gt; is the red-headed step child of the Rails world, but it does the trick. This secondary refactoring removed a further 364 lines of code from my controllers.&lt;/p&gt;
&lt;p&gt;Counting both refactorings, my controllers have lost exactly 36% of their overall weight. Not bad for a few days work!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
+----------------------+-------+-------+---------+---------+-----+-------+
| Name                 | Lines |   LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers          |  3619 |  2600 |      74 |     244 |   3 |     8 |
| Helpers              |  1535 |  1209 |       0 |     123 |   0 |     7 |
| Models               |  9899 |  5268 |     117 |     951 |   8 |     3 |
| Libraries            |   209 |   116 |       1 |      16 |  16 |     5 |
| Unit tests           |    32 |    24 |       4 |       0 |   0 |     0 |
| Model specs          | 11548 |  8929 |       0 |       5 |   0 |  1783 |
| View specs           | 19649 | 15170 |       0 |     301 |   0 |    48 |
| Controller specs     |  5782 |  4462 |       0 |     181 |   0 |    22 |
| Helper specs         |  2157 |  1536 |       0 |       0 |   0 |     0 |
+----------------------+-------+-------+---------+---------+-----+-------+
| Total                | 54430 | 39314 |     196 |    1821 |   9 |    19 |
+----------------------+-------+-------+---------+---------+-----+-------+
  Code LOC: 9193     Test LOC: 30121     Code to Test Ratio: 1:3.3
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Sun, 16 Aug 2009 21:18:42 -0400</pubDate>
      <guid>/posts/752-refactoring-with-resource_controller</guid>
    </item>
    <item>
      <title>Look Mom!</title>
      <author>Matt Darby</author>
      <link>/posts/751-look-mom</link>
      <description>&lt;p&gt;A tweet of mine extolling the awesomeness that is Sass was seen and used as an endorsement! How exciting ;)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://sass-lang.com"&gt;sass-lang.com&lt;/a&gt;&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;img src="/files/72/original/Picture%204.png" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Thu, 09 Jul 2009 16:14:13 -0400</pubDate>
      <guid>/posts/751-look-mom</guid>
    </item>
    <item>
      <title>Donny &amp; Marie and &#8230; Star Wars?</title>
      <author>Matt Darby</author>
      <link>/posts/750-donny-marie-and-star-wars</link>
      <description>&lt;center&gt;
&lt;p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/PMW4Ad8fIF4&amp;hl=en&amp;fs=1&amp;"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/PMW4Ad8fIF4&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Tue, 23 Jun 2009 12:22:01 -0400</pubDate>
      <guid>/posts/750-donny-marie-and-star-wars</guid>
    </item>
    <item>
      <title>Netflix oddity&#8230;</title>
      <author>Matt Darby</author>
      <link>/posts/749-netflix-oddity</link>
      <description>&lt;center&gt;
&lt;p&gt;&lt;img src="/files/71/original/Picture%2010.png" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Wed, 17 Jun 2009 13:03:53 -0400</pubDate>
      <guid>/posts/749-netflix-oddity</guid>
    </item>
    <item>
      <title>Ticketmaster is trying to tell me something</title>
      <author>Matt Darby</author>
      <link>/posts/748-ticketmaster-is-trying-to-tell-me-something</link>
      <description>&lt;center&gt;&lt;img src="/files/70/original/Picture%205.png" alt="" /&gt;&lt;/center&gt;</description>
      <pubDate>Sun, 14 Jun 2009 10:11:40 -0400</pubDate>
      <guid>/posts/748-ticketmaster-is-trying-to-tell-me-something</guid>
    </item>
    <item>
      <title>Perfect iTunes Equalizer Settings</title>
      <author>Matt Darby</author>
      <link>/posts/747-perfect-itunes-equalizer-settings</link>
      <description>&lt;center&gt;
&lt;p&gt;&lt;img src="/files/69/original/Picture%204.png" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Thu, 28 May 2009 12:38:51 -0400</pubDate>
      <guid>/posts/747-perfect-itunes-equalizer-settings</guid>
    </item>
    <item>
      <title>Damien Walters is superhuman!</title>
      <author>Matt Darby</author>
      <link>/posts/746-damien-walters-is-superhuman</link>
      <description>&lt;center&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/5MeiwLLZjDo&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/5MeiwLLZjDo&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/center&gt;</description>
      <pubDate>Wed, 27 May 2009 16:04:48 -0400</pubDate>
      <guid>/posts/746-damien-walters-is-superhuman</guid>
    </item>
    <item>
      <title>RubyMine: A Review</title>
      <author>Matt Darby</author>
      <link>/posts/745-rubymine-a-review</link>
      <description>&lt;p&gt;JetBrains&amp;#8217; &lt;a href="http://www.jetbrains.com/ruby/index.html"&gt;RubyMine&lt;/a&gt; is the new Ruby on Rails &lt;span class="caps"&gt;IDE&lt;/span&gt; on the block. JetBrains is the same company that develops IntelliJ &lt;span class="caps"&gt;IDEA&lt;/span&gt; Java &lt;span class="caps"&gt;IDE&lt;/span&gt;, which I have used in the past with good success.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;First, a bit of disclosure:&lt;/strong&gt; I don&amp;#8217;t like IDEs. I think they&amp;#8217;re overkill for such a simple language as Ruby, and such a &amp;#8220;conceptually simple&amp;#8221; framework as Rails, but different strokes for different folks; some people really dig them.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve used &lt;a href="http://macromates.com"&gt;TextMate&lt;/a&gt; for the last year and a half of daily Ruby on Rails development. While it is the current editor of choice in the Rails community, there is room for improvement. TextMate 2 is rapidly turning into the poster child of vaporware now that Duke Nukem Forever has finally &lt;a href="http://news.softpedia.com/news/3D-Realms-Claims-It-Invested-20-Million-in-Duke-Nukem-Forever-112524.shtml"&gt;died a slow painful death.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So lets get down to it shall we? These are the first impressions I had while opening and playing around with a large (113 models) Rails project.&lt;/p&gt;
&lt;p&gt;The first time you open a project in RubyMine, it scans your entire Ruby classpath; for what reason, I&amp;#8217;m not fully sure. This process took nearly five minutes on my MacBook, and shaved off a good hunk of battery time to boot. This is definitely not ideal.&lt;/p&gt;
&lt;p&gt;One of the main reasons I decided to try RubyMine was for its code completion feature. The code does complete, but it doesn&amp;#8217;t actually offer methods from your Rails models when dealing with an ActiveRecord object. What&amp;#8217;s the point of code completion if it doesn&amp;#8217;t offer you the methods you&amp;#8217;re going to be using the most?&lt;/p&gt;
&lt;p&gt;Another nagging point I immediately found was that RubyMine held 400M of memory after the project was initially loaded. When I clicked on the garbage can icon to do a little garbage collecting, the memory usage increased by 15M! Memory usage during this short trial fluctuated between 175M and 450M. While writing this post the memory usage ballooned 150M up to 325M without any actual interaction. This isn&amp;#8217;t the end of the world, it does seem to be way too much.&lt;/p&gt;
&lt;p&gt;This is also likely the cause of the nagging unresponsiveness I experienced. Toggling the down arrow in the Rails project view to expand my list of models took four seconds. Four seconds doesn&amp;#8217;t seem like much in the scheme of things, but it breaks the flow of development.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;Rails Project View&lt;/em&gt; (this is the name I&amp;#8217;ve given to the left-hand pane that optionally shows the &amp;#8216;Project&amp;#8217;, &amp;#8216;Scope&amp;#8217;, &amp;#8216;Favorites&amp;#8217;, or &amp;#8216;Rails&amp;#8217; view of your project) gives the developer a nice Java-style overview of your Rails project. I really dug it for the first few moments, until I noticed some odd idiosyncrasies.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;Rails Project View&lt;/em&gt; nests Views under Controllers, which conceptually, isn&amp;#8217;t very far off, but it does visually break the folder structure layout we&amp;#8217;ve all grown used to. Some of my Views were listed as &amp;#8220;Views (Unclassified)&amp;#8221;, and weren&amp;#8217;t nested under Controllers, but off of the tree root its self. I guess the &lt;em&gt;Rails Project View&lt;/em&gt; doesn&amp;#8217;t like ActionMailer views.&lt;/p&gt;
&lt;p&gt;One thing I do like is the integrated version control features, and kudos for including Git out of the box. JetBrains included support for Perforce, but not Mercurial or &lt;span class="caps"&gt;CVS&lt;/span&gt; which I found interesting.&lt;/p&gt;
&lt;p&gt;I decided to try a little refactoring. I attempted to rename an existing method in one of my Models. I was really dismayed to see that the refactoring attempt doesn&amp;#8217;t seem to actually check the scope of the method it&amp;#8217;s trying to rename!&lt;/p&gt;
&lt;p&gt;As you might know, I authored &lt;a href="http://github.com/mdarby/restful_acl/tree/master"&gt;RESTful_ACL&lt;/a&gt;; of which, there is a method &lt;code&gt;is_updatable_by&lt;/code&gt;. I attempted to refactor this method, and RubyMine renamed each separate definition for all other Models and its usage across all of my Views. Not very helpful, and if you really need to use automatic refactoring, dangerous.&lt;/p&gt;
&lt;p&gt;I also ran the code analyzer on one of my larger Models to see where I could improve my code. It did find errors, but 97% of them had to do with the analyzer not recognizing simple has_many associations, ie:&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;img src="/files/68/original/Picture%201.png" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;This sucks. Analyzing good code as bad is worse than bad documentation.&lt;/p&gt;
&lt;p&gt;Another sore point was the lack of syntax coloring for &lt;span class="caps"&gt;HAML&lt;/span&gt;. I can&amp;#8217;t say that I expected this out of the box, but there are options for &lt;span class="caps"&gt;HAML&lt;/span&gt; in the RubyMine preferences, so why not syntax coloring?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br /&gt;
TextMate will continue to reign supreme in the Rails community. I do applaud JetBrains&amp;#8217; efforts with RubyMine. RubyMine is still very young (1.0.5 release at the time of this post), and it will only grow stronger and more robust. It is highly customizable to your liking, something that TextMate largely isn&amp;#8217;t, but perhaps it doesn&amp;#8217;t need to be considering its widespread usage. RubyMine is available for $99.&lt;/p&gt;</description>
      <pubDate>Wed, 27 May 2009 09:42:58 -0400</pubDate>
      <guid>/posts/745-rubymine-a-review</guid>
    </item>
    <item>
      <title>Awesomeness</title>
      <author>Matt Darby</author>
      <link>/posts/744-awesomeness</link>
      <description>&lt;center&gt;
&lt;p&gt;&lt;img src="/files/67/original/6580.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;I just had to share this.&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Mon, 25 May 2009 11:49:10 -0400</pubDate>
      <guid>/posts/744-awesomeness</guid>
    </item>
    <item>
      <title>Catching Up</title>
      <author>Matt Darby</author>
      <link>/posts/743-catching-up</link>
      <description>&lt;h3&gt;Where have I been?&lt;/h3&gt;
&lt;p&gt;Here. I&amp;#8217;ve been really busy (and alternately, lazy)&lt;/p&gt;
&lt;h3&gt;Tired of Wordpress&lt;/h3&gt;
&lt;p&gt;I normally post to this blog when there is something cool to post about, and I&amp;#8217;m inspired to write about it. &lt;a href="http://wordpress.org/"&gt;Wordpress&lt;/a&gt; was just not inspiring any longer. It does a billion things, yet, none I really need. I wanted a simple blog engine. Posts, Comments, Attachments, &lt;a href="http://en.wikipedia.org/wiki/Textile_(markup_language)"&gt;Textile&lt;/a&gt;, &lt;a href="http://akismet.com/"&gt;spam filtering&lt;/a&gt;, etc. I decided to roll my own using Rails.&lt;/p&gt;
&lt;h3&gt;The Media Temple Meltdown&lt;/h3&gt;
&lt;p&gt;I have hosted this domain with &lt;a href="http://mediatemple.net/"&gt;Media Temple&lt;/a&gt; for nearly two years, and their service has always been a good value. I&amp;#8217;ve never really had an issue, but shared hosting was really starting to feel way too cramped. I&amp;#8217;m used to having a full server at my command.&lt;/p&gt;
&lt;p&gt;Serendipitously, the cluster that hosted this domain &lt;a href="http://weblog.mediatemple.net/weblog/category/system-incidents/754-gs-grid-service-cluster02-web-availability/page/7/"&gt;crashed&lt;/a&gt;. The website was down, as well as my email. I understand these kinds of systems pretty well, and I fully understand downtime, and the resulting bald spots that occur afterwards. The thing with this crash was that after &lt;strong&gt;three days&lt;/strong&gt;, my email store was still missing.&lt;/p&gt;
&lt;p&gt;The last leg of their restoration process was restoring on average 22 domains per hour. Now that is dreadfully show when you consider that my cluster alone had over 14,000 domains.&lt;/p&gt;
&lt;h3&gt;Time Machine saves the day&lt;/h3&gt;
&lt;p&gt;It occurred to me suddenly: &lt;a href="http://www.apple.com/macosx/features/timemachine.html"&gt;Time Machine&lt;/a&gt;. Yes! Time Machine would save me. I enter the app and navigate back to Sunday. All of my email is gloriously intact, and restored within moments back into Mail.app. If I ever run into Apple at the bar, he is definitely getting a drink or two on me.&lt;/p&gt;
&lt;h3&gt;The Awesomeness that is Google Apps&lt;/h3&gt;
&lt;p&gt;One of the main reasons I&amp;#8217;ve always stuck with third-party hosting of my websites is that I hate email servers. I&amp;#8217;ll pretty much avoid running my own at all costs. If you&amp;#8217;ve ever run your own, you understand. Enter &lt;a href="http://www.google.com/apps/"&gt;Google Apps&lt;/a&gt;. Google Apps is basically free email hosting for your domain via GMail. No bullshit, it just works. I highly recommend using it. Immediately. Go.&lt;/p&gt;
&lt;p&gt;Since my email situation was figured out, I am now free to host my own websites on my own server. No monthly fees anywhere (even the cheapest EC2 instance will run $70/month).&lt;/p&gt;
&lt;p&gt;This site uses &lt;a href="http://modrails.com"&gt;Phusion&amp;#8217;s Passenger&lt;/a&gt;; I&amp;#8217;ve written about it in the &lt;a href="http://www.matt-darby.com/posts/697-apache-passenger-vs-nginx-mongrel"&gt;past&lt;/a&gt;, and since it has become the golden child of the Rails community. It&amp;#8217;s super easy, fast, and largely effortless. I use it with &lt;a href="http://httpd.apache.org/"&gt;Apache&lt;/a&gt;, but it now support &lt;a href="http://nginx.net/"&gt;Nginx&lt;/a&gt; as well.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m also using &lt;a href="http://www.sphinxsearch.com/"&gt;Sphinx&lt;/a&gt; full-text search (via the wonderful &lt;a href="http://ts.freelancing-gods.com/"&gt;ThinkingSphinx&lt;/a&gt; gem). It&amp;#8217;s easy to configure for your Rails app, but I&amp;#8217;m still having issues after deploying changes to my apps &amp;mdash; something always seems to happen to where I need to login to the server and manually futz with rake commands to get everything going again.&lt;/p&gt;
&lt;h3&gt;Tricks&lt;/h3&gt;
&lt;p&gt;One of the issues I was faced with in building this application was changing the &lt;span class="caps"&gt;URL&lt;/span&gt; format for blog posts. My old blog used a &amp;#8216;/&lt;span class="caps"&gt;YYYY&lt;/span&gt;/MM/DD/Permalink&amp;#8217; format, and I wanted to change to the /posts/ID-Permalink&amp;#8217; format. Aesthetics I guess, but this breaks every external link to this site.&lt;/p&gt;
&lt;p&gt;The trick I used was to capture the request right before it failed and pushed the permalink part of the &lt;span class="caps"&gt;URL&lt;/span&gt; to the search feature. If the original blog post wasn&amp;#8217;t found, the site would search for you, and present the results. Pretty slick if you ask me.&lt;/p&gt;
&lt;p&gt;Another great trick was figuring out how to upload file data via an &lt;span class="caps"&gt;AJAX&lt;/span&gt; call. Normally, this isn&amp;#8217;t allowed as Javascript can&amp;#8217;t touch a filesystem, but the &lt;a href="http://malsup.com/jquery/form/"&gt;jQuery Form Plugin&lt;/a&gt; wields some awesome magic to get around that. When I go to post a blog entry, I can upload any number of attachments via a simple form field element and it is immediately sent to the server for processing. I use &lt;a href="http://thoughtbot.com/"&gt;Thoughtbot&amp;#8217;s&lt;/a&gt; &lt;a href="http://thoughtbot.com/projects/paperclip"&gt;Paperclip&lt;/a&gt; for that. After the file is saved, it inserts a Textile formatted string into the Post editor text area. Two clicks and I have an image &lt;span class="caps"&gt;URL&lt;/span&gt; that I can use in a post. Slick.&lt;/p&gt;
&lt;p&gt;This blog engine uses the wonderful &lt;a href="http://markitup.jaysalvat.com/home/"&gt;Markitup&lt;/a&gt; jQuery text editor for the actual crafting of blog entries. It gives me a live, textile formatted preview of my post as I&amp;#8217;m writing it, sized to my main column&amp;#8217;s width &amp;mdash; no more layout crushing blog entries!&lt;/p&gt;
&lt;p&gt;I finally got around to trying out &lt;a href="http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html"&gt;&lt;span class="caps"&gt;SASS&lt;/span&gt;&lt;/a&gt;. &lt;span class="caps"&gt;SASS&lt;/span&gt; is a sister of the fantastic &lt;a href="http://haml.hamptoncatlin.com/"&gt;&lt;span class="caps"&gt;HAML&lt;/span&gt;&lt;/a&gt; project. Both aim to remove the drudgery of writing &lt;span class="caps"&gt;CSS&lt;/span&gt; and &lt;span class="caps"&gt;HTML&lt;/span&gt; code respectively.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m used &lt;span class="caps"&gt;HAML&lt;/span&gt; for well over a year now and love every minute of it. &lt;span class="caps"&gt;SASS&lt;/span&gt;, on the other hand, I never really &lt;strong&gt;got&lt;/strong&gt;. &lt;span class="caps"&gt;CSS&lt;/span&gt; is simple, so why add another layer? After using it on this project, I will use it on all that follow it. &lt;span class="caps"&gt;SASS&lt;/span&gt; makes sense. It strips away the BS in &lt;span class="caps"&gt;CSS&lt;/span&gt; and actually allows you to write better structured documents, as it natively allows you to namespace your elements more readily.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s an example:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# CSS
.about_me{
  text-align:justify
}
 
.about_me .recommend_me{
  padding:40px 0px
}
 
.about_me .polaroid img{
  float:left;
  margin-top:4px;
  margin-right:7px;
  border:1px solid #DDD;
  padding:2px;
  padding-bottom:15px
}
 
# SASS
.about_me
  :text-align justify
 
  .recommend_me
    :padding 40px 0px
 
  .polaroid
    img
      :float left
      :margin-top 4px
      :margin-right 7px
      :border 1px solid #DDD
      :padding 2px
      :padding-bottom 15px
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Phew!&lt;/h3&gt;
&lt;p&gt;Man, that was long. Well, it&amp;#8217;s been a while, and a lot has changed in the last three days. I might open source this blog engine if there is interest. If you&amp;#8217;re interested, please drop me a line&#8230;&lt;/p&gt;</description>
      <pubDate>Fri, 08 May 2009 15:05:14 -0400</pubDate>
      <guid>/posts/743-catching-up</guid>
    </item>
    <item>
      <title>New Blog!</title>
      <author>Matt Darby</author>
      <link>/posts/740-new-blog</link>
      <description>&lt;p&gt;Hey all, please don&amp;#8217;t mind the dust.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve moved off of Media Temple to my own solution&#8230; More on that later. I will also get the images in the blog posts up to date &lt;span class="caps"&gt;ASAP&lt;/span&gt;. Migrations are fun!&lt;/p&gt;</description>
      <pubDate>Thu, 07 May 2009 18:18:46 -0400</pubDate>
      <guid>/posts/740-new-blog</guid>
    </item>
    <item>
      <title>cache-money rules everything around me</title>
      <author>Matt Darby</author>
      <link>/posts/729-cache-money-rules-everything-around-me</link>
      <description>&lt;p&gt;Nick Kallen&amp;#8217;s &lt;a href="http://github.com/nkallen/cache-money/tree/master"&gt;cache-money&lt;/a&gt; gem provides super easy caching for your Rails apps. Install &lt;a href="http://www.danga.com/memcached"&gt;memcached&lt;/a&gt; and the gem and then drop in the provided config file and you&amp;#8217;re off and running.&lt;/p&gt;
&lt;p&gt;The only snag you&amp;#8217;ll probably run into is that cache-money is loaded in development mode. This sucks as you&amp;#8217;ll run into odd errors as you develop your application.&lt;/p&gt;
&lt;p&gt;Whilst talking to &lt;a href="http://www.obiefernandez.com"&gt;Obie Fernandez&lt;/a&gt;, he dropped a nugget of wisdom that lead to this method:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
if RAILS_ENV != 'development'
  require 'cache_money'
 
  config = YAML.load(IO.read(File.join(RAILS_ROOT, "config", "memcached.yml")))[RAILS_ENV]
  $memcache = MemCache.new(config)
  $memcache.servers = config['servers']
 
  $local = Cash::Local.new($memcache)
  $lock = Cash::Lock.new($memcache)
  $cache = Cash::Transactional.new($local, $lock)
 
  class ActiveRecord::Base
    is_cached :repository =&amp;gt; $cache
  end
else
  # If we're in development mode, we don't want to
  # deal with caching oddities, so let's override
  # cache-money's #index method to do nothing&#8230;
  class ActiveRecord::Base
    def self.index(*args)
    end
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Basically, this wraps the cache-money&amp;#8217;s config stuff in a if/else statment and then override&amp;#8217;s cache-money&amp;#8217;s #index method so that errors won&amp;#8217;t be thrown when Rails encounters them in your indexed models.&lt;/p&gt;</description>
      <pubDate>Fri, 06 Feb 2009 12:10:37 -0500</pubDate>
      <guid>/posts/729-cache-money-rules-everything-around-me</guid>
    </item>
    <item>
      <title>I hate IE7 round #83495</title>
      <author>Matt Darby</author>
      <link>/posts/728-i-hate-ie7-round-83495</link>
      <description>&lt;center&gt;&lt;b&gt;Why?!&lt;/b&gt;&lt;/center&gt;&lt;p&gt;&lt;br/&gt;
&lt;pre&gt;&lt;code&gt;
select {
  font-size:1em;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 03 Feb 2009 23:28:48 -0500</pubDate>
      <guid>/posts/728-i-hate-ie7-round-83495</guid>
    </item>
    <item>
      <title>Pretty git log with graph</title>
      <author>Matt Darby</author>
      <link>/posts/727-pretty-git-log-with-graph</link>
      <description>&lt;p&gt;&lt;img src="/files/35/original/awesome-git-log.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Drop this gist into your ~/.(ba|z)shrc file and you can have this awesome git log at your fingertips, complete with a simple visualization of your repository tree.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
alias gl='git log --graph --pretty=format:"%Cred%h%Creset &#8212; %s %Cgreen(%cr)%Creset" --abbrev-commit --date=relative'
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Mon, 26 Jan 2009 12:40:42 -0500</pubDate>
      <guid>/posts/727-pretty-git-log-with-graph</guid>
    </item>
    <item>
      <title>Time has come today</title>
      <author>Matt Darby</author>
      <link>/posts/726-time-has-come-today</link>
      <description>&lt;center&gt;
&lt;p&gt;&lt;strong&gt;Pride, excitement, hope, happiness, optimism, and joy.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/36/original/barack-obama-is-superman.jpg" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Tue, 20 Jan 2009 04:48:28 -0500</pubDate>
      <guid>/posts/726-time-has-come-today</guid>
    </item>
    <item>
      <title>RSpec is 99% awesome.</title>
      <author>Matt Darby</author>
      <link>/posts/618-rspec-is-99-awesome</link>
      <description>&lt;center&gt;
&lt;p&gt;The remaining 1% I get weird errors, such as:&lt;br /&gt;
&lt;img src="/files/37/original/rspec_wtf.png" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Wed, 07 Jan 2009 02:44:01 -0500</pubDate>
      <guid>/posts/618-rspec-is-99-awesome</guid>
    </item>
    <item>
      <title>Checking in with Mom</title>
      <author>Matt Darby</author>
      <link>/posts/725-checking-in-with-mom</link>
      <description>&lt;p&gt;RESTful_ACL needed the ability to programatically find and load the &amp;#8216;parent&amp;#8217; in a nested resource relationship. This seems straight-forward, but ActiveRecord models are only nested in a routing sense, not in a direct inheriting sense.&lt;/p&gt;
&lt;p&gt;As an example, take the route &lt;code&gt;/projects/1/tasks/2&lt;/code&gt;. Task has no idea that it&amp;#8217;s actually nested under &lt;code&gt;Project&lt;/code&gt;, and &lt;code&gt;Project&lt;/code&gt; has no idea about &lt;code&gt;Task&lt;/code&gt;. Both &lt;code&gt;Project&lt;/code&gt; and &lt;code&gt;Task&lt;/code&gt; will have an association; true, but this doesn&amp;#8217;t necessarily belie a nested relationship.&lt;/p&gt;
&lt;p&gt;With this method, one can find the parent resource by passing in the child class along with the requested &lt;span class="caps"&gt;URI&lt;/span&gt; (&lt;code&gt;request.request_uri&lt;/code&gt;).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
def get_parent_resource(target_klass, path)
  # Convert the requested path into hash form
  hash = ActionController::Routing::Routes.recognize_path(path, :method =&amp;gt; :get)
 
  # Loop through path keys and see if any end in '_id'
  # and our child class belongs_to the associated AR Class
  pair = hash.detect do |k, v|
    k.to_s.ends_with?("_id") &amp;amp;&amp;amp; target_klass.columns_hash.has_key?(k.to_s)
  end
 
  # Load up the AR class based on the matching path pair
  klass = pair[0].to_s[0&#8230;-3].classify.constantize
 
  # Find and return the target parent object
  klass.find(pair[1])
end
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Sun, 04 Jan 2009 00:26:57 -0500</pubDate>
      <guid>/posts/725-checking-in-with-mom</guid>
    </item>
    <item>
      <title>Basil's cuteness melts faces</title>
      <author>Matt Darby</author>
      <link>/posts/724-basil-s-cuteness-melts-faces</link>
      <description>&lt;p&gt;&lt;a href="http://www.flickr.com/photos/11768714@N08/3103381730/" title="SNV33750.JPG by matt.darby, on Flickr"&gt;&lt;img src="http://farm4.static.flickr.com/3221/3103381730_6a925f6b28.jpg" width="500" height="375" alt="SNV33750.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 12 Dec 2008 10:36:23 -0500</pubDate>
      <guid>/posts/724-basil-s-cuteness-melts-faces</guid>
    </item>
    <item>
      <title>True words</title>
      <author>Matt Darby</author>
      <link>/posts/723-true-words</link>
      <description>&lt;p&gt;A: You have three options for classes: Intro to C++, Intro to J++, or Fortran/Cobol&lt;br /&gt;
B: Wow, that is like having to choose between killing your mom or your wife&lt;br /&gt;
A: Yeah, or just killing yourself.&lt;/p&gt;</description>
      <pubDate>Tue, 09 Dec 2008 05:31:25 -0500</pubDate>
      <guid>/posts/723-true-words</guid>
    </item>
    <item>
      <title>Announcing Basil</title>
      <author>Matt Darby</author>
      <link>/posts/722-announcing-basil</link>
      <description>&lt;p&gt;Yesterday my wife and I welcomed a new little mongrel into our home, Basil the Pug. That&amp;#8217;s Basil pronounced the proper English way (Baazil), thank you very much.&lt;/p&gt;
&lt;p&gt;She&amp;#8217;s super sweet and at eight weeks old is already on her way to being housebroken like her father.&lt;/p&gt;
&lt;p&gt;&lt;object width="425" height="344"&gt;&lt;param name="movie" value="http://www.youtube.com/v/HZEQRfkRtA4&amp;hl=en&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/HZEQRfkRtA4&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 05 Dec 2008 15:37:24 -0500</pubDate>
      <guid>/posts/722-announcing-basil</guid>
    </item>
    <item>
      <title>Rails date miscalculation</title>
      <author>Matt Darby</author>
      <link>/posts/721-rails-date-miscalculation</link>
      <description>&lt;p&gt;This happens all the time in my console. It&amp;#8217;s super annoying as it throws off basically everything. Ugh.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/38/original/date.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br /&gt;
Futher bitching. This is rendered &lt;span class="caps"&gt;HTML&lt;/span&gt; for a weekly timesheet. All it needs to do is print out a table row containing links to that particular day:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;a href="/timesheet/day/1772-04-28"&amp;gt;Sun (04/28)&amp;lt;/a&amp;gt;                                              
&amp;lt;a href="/timesheet/day/2008-11-17"&amp;gt;Mon (11/17)&amp;lt;/a&amp;gt;                                              
&amp;lt;a href="/timesheet/day/2245-06-08"&amp;gt;Tue (06/08)&amp;lt;/a&amp;gt;                                              
&amp;lt;a href="/timesheet/day/2481-12-27"&amp;gt;Wed (12/27)&amp;lt;/a&amp;gt;                                              
&amp;lt;a href="/timesheet/day/2718-07-19"&amp;gt;Thu (07/19)&amp;lt;/a&amp;gt;                                              
&amp;lt;a href="/timesheet/day/2955-02-06"&amp;gt;Fri (02/06)&amp;lt;/a&amp;gt;                                              
&amp;lt;a href="/timesheet/day/3191-08-28"&amp;gt;Sat (08/28)&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;br /&gt;
Turns out that the error was being caused by a library (&lt;a href="https://www.fsdata.se/kund/gemdocs/facets-2.4.1/rdoc/classes/Weekdays.html"&gt;facets/times&lt;/a&gt;) that I included elsewhere in my app. Everytime that piece of code was called, the whole shebang crapped out. Removed the library and all is well with the world. Credit goes to &lt;a href="http://www.spacevatican.org/"&gt;Frederick Cheung&lt;/a&gt; for getting me on track via the &lt;a href="http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f8331fc4eea52a8f/84b3825d5c2132fd?lnk=gst&amp;q=1772#84b3825d5c2132fd"&gt;Rails mailing list&lt;/a&gt;!&lt;/p&gt;</description>
      <pubDate>Thu, 13 Nov 2008 23:42:54 -0500</pubDate>
      <guid>/posts/721-rails-date-miscalculation</guid>
    </item>
    <item>
      <title>The Beauty of Ruby #32498</title>
      <author>Matt Darby</author>
      <link>/posts/720-the-beauty-of-ruby-32498</link>
      <description>&lt;p&gt;Ever want to find a random ActiveRecord object? Seems simple, but there isn&amp;#8217;t really an easy way to do it (well, a &lt;b&gt;really&lt;/b&gt; easy way). This little snippet really shows the elegance of Ruby and I thought I&amp;#8217;d share:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# Usage:
# &amp;gt;&amp;gt; User.random
# =&amp;gt; #&amp;lt;User login: &#8230;
 
class ActiveRecord::Base
 
  def self.random
    begin
      find(rand(count))
    rescue ActiveRecord::RecordNotFound
      self.random
    end
  end
  
end
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Sun, 09 Nov 2008 11:29:04 -0500</pubDate>
      <guid>/posts/720-the-beauty-of-ruby-32498</guid>
    </item>
    <item>
      <title>A New Dawn</title>
      <author>Matt Darby</author>
      <link>/posts/719-a-new-dawn</link>
      <description>&lt;p&gt;Thank &lt;i&gt;you&lt;/i&gt;, and God speed.&lt;br /&gt;
&lt;img src="/files/39/original/barack-obama-teens-1.jpg" alt="" /&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 04 Nov 2008 19:23:04 -0500</pubDate>
      <guid>/posts/719-a-new-dawn</guid>
    </item>
    <item>
      <title>HTML to Haml Textmate Snippet</title>
      <author>Matt Darby</author>
      <link>/posts/718-html-to-haml-textmate-snippet</link>
      <description>&lt;p&gt;Here is an Textmate snippet that allows you to easily convert &lt;span class="caps"&gt;HTML&lt;/span&gt; and &lt;span class="caps"&gt;ERB&lt;/span&gt; templates to Haml. It also re-converts certain characters back to their normal form after conversion (for some reason html2haml converts stuff like less-than signs and quotes to their &lt;span class="caps"&gt;HTML&lt;/span&gt; character code, ugh).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
#!/bin/sh
 
html2haml -r "$TM_FILEPATH" | sed 's/&amp;amp;gt;/&amp;gt;/g' | sed 's/&amp;amp;lt;/&amp;lt;/g' | sed 's/- end//g' | sed 's/&amp;amp;quot;/"/g' | sed 's/&amp;amp;amp;/\&amp;amp;/g'
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 22 Oct 2008 16:17:44 -0400</pubDate>
      <guid>/posts/718-html-to-haml-textmate-snippet</guid>
    </item>
    <item>
      <title>RSpec and Block-Based View Helpers</title>
      <author>Matt Darby</author>
      <link>/posts/717-rspec-and-block-based-view-helpers</link>
      <description>&lt;p&gt;Block-based view helpers are a great way to cut down on repetitive &lt;span class="caps"&gt;HTML&lt;/span&gt; chores and &lt;span class="caps"&gt;DRY&lt;/span&gt; up your view code. They are normally rather simple methods that basically stick some content in the middle of &lt;span class="caps"&gt;HTML&lt;/span&gt; code.&lt;/p&gt;
&lt;p&gt;Here is a block-based view helper that I use in one of my applications:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# application_helper.rb
 
# Generic form label styling
def box_label(text)
  text = "#{text}:" unless text.end_with?(":")
  "&amp;lt;span class=\"box_label\"&amp;gt;#{text}&amp;lt;/span&amp;gt;"
end
 
# A generic box to encapsulate some text
def box(title = nil, *args, &amp;amp;block)
  options = args.extract_options!
  style = options[:style] ? " style = '#{options[:style]}'" : ''
 
  b = "&amp;lt;div class=\"box\"#{style}&amp;gt;#{box_label(title) if title}"
  e = '&amp;lt;/div&amp;gt;'
 
  data = capture(&amp;amp;block)
  res = b + data + e
  concat(res, block.binding)
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we can call the &amp;#8220;box&amp;#8221; helper in a view:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# /some_object/show.html.erb
 
&amp;lt;% box('Name:') do %&amp;gt;
  &amp;lt;%=h @some_object.name %&amp;gt;
&amp;lt;% end %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and it will actually render this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
&amp;lt;div class="box"&amp;gt;
  &amp;lt;span class="box_label"&amp;gt;Name:&amp;lt;/span&amp;gt;
  J080119 - Technology Department
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Pretty sweet, right?&lt;/p&gt;
&lt;p&gt;It is until you go to spec out your views with RSpec. After some obligatory Googlin&amp;#8217; I didn&amp;#8217;t find much. It seems as though the block doesn&amp;#8217;t do it&amp;#8217;s thing when RSpec calls it via the &lt;code&gt;render&lt;/code&gt; call in your view specs.&lt;/p&gt;
&lt;p&gt;So where does this leave us? Time for a custom &lt;a href="http://tuples.us/2007/10/23/if-you-arent-writing-matchers-you-arent-using-rspec/"&gt;Matcher&lt;/a&gt;;. Relax, it&amp;#8217;s pretty easy, but it does involve working with a regular expression. &lt;a href="http://www.rubular.com"&gt;Rubular&lt;/a&gt;; is a great place to work with your REfu in real time. I highly recommend using it for your Matcher#matches method.&lt;/p&gt;
&lt;p&gt;First things first: Crack open that spec_helper.rb file and lets create a new Matcher module that will test our &amp;#8220;box&amp;#8221; helper:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# spec_helper.rb
 
module BoxMatcher
  class Box
    def initialize(name)
      @name = name
    end
 
    def matches?(actual)
      raise "You must supply a 'containing' attribute (.containing 'foo')" unless @contents
 
      @actual = actual
 
      # ___Here is where the real magic happens___
      # It is simply a regular expression that tests our
      # expectations (the rendered HTML from the 'box' method)
      # against what the response actually rendered
      # If it matches, we have a passing spec.
 
      @actual.body =~ /&amp;lt;div class="box"&amp;gt;&amp;lt;span class="box_label"&amp;gt;#{@name}:&amp;lt;/span&amp;gt;.*#{@contents}.*n&amp;lt;/div&amp;gt;/im
    end
 
    def containing(contents)
      @contents = contents
      self
    end
 
    def failure_message
      "expected response to have a box describing '#{@name}', but it didn't"
    end
 
    def negative_failure_message
      "expected response to not have a box describing '#{@name}', but it did"
    end
  end
 
  def have_box_named(name)
    Box.new(name)
  end
 
end
 
&#8230;
 
Spec::Runner.configure do |config|
  &#8230;
  # Include our new Matcher module
  config.include BoxMatcher, :type =&amp;gt; :view
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You can now test the rendering of your block-based view helper via something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# some_object.html.erb_spec.rb
 
it "should render 'bleh' in a box named 'meh'" do
  render "/some_object/show.html.erb"
  response.should have_box_named("meh").containing('bleh')
end
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Wed, 22 Oct 2008 07:53:33 -0400</pubDate>
      <guid>/posts/717-rspec-and-block-based-view-helpers</guid>
    </item>
    <item>
      <title>Recorded Political Phonecalls</title>
      <author>Matt Darby</author>
      <link>/posts/716-recorded-political-phonecalls</link>
      <description>&lt;p&gt;It&amp;#8217;s just so neat that the Governor or some random Senator is calling little-ole-me!&lt;/p&gt;
&lt;p&gt;Your pre-recorded political phone call has single-handedly convinced me to change my political stance and views on life. Thank you for making me see the light in those amazing twenty seconds. Who knew that a phone call could do so much.&lt;/p&gt;
&lt;p&gt;Your masterful use of mechanized war dailing and not using real, live, people to spread your word is astounding. It shows that you know how to get things done. Bravo.&lt;/p&gt;
&lt;p&gt;I understand that there is an election going on; and yes, I understand that you&amp;#8217;re just trying to &amp;#8220;let everyone know about your great policies&amp;#8221;. I appreciate that you time your pre-recorded messages of political candor so precisely with my dinner time, or when I get a chance to stretch out on the couch. I&amp;#8217;m glad that I get to get off of my ass and walk aross the house to get the phone three times a night.&lt;/p&gt;
&lt;p&gt;Please. Stop.&lt;/p&gt;</description>
      <pubDate>Mon, 20 Oct 2008 14:28:00 -0400</pubDate>
      <guid>/posts/716-recorded-political-phonecalls</guid>
    </item>
    <item>
      <title>Frustration</title>
      <author>Matt Darby</author>
      <link>/posts/658-frustration</link>
      <description>&lt;p&gt;Taken from: &lt;a href="http://www.kevinwilliampang.com/post/Top-10-Things-That-Annoy-Programmers.aspx"&gt;www.kevinwilliampang.com&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Very few programmers can go from 0 to code at the drop of a hat.  In general, we tend to be more akin to locomotives than ferraris; it may take us awhile to get started, but once we hit our stride we can get an impressive amount of work done.  Unfortunately, it&amp;#8217;s very hard to get into a programming zone when your train of thought is constantly being derailed by clients, managers, and fellow programmers.&lt;/p&gt;
&lt;p&gt;There is simply too much information we need to keep in mind while we&amp;#8217;re working on a task to be able to drop the task, handle another issue, then pick up the task without missing a beat.  Interruptions kill our train of thought and getting it back is often a time-consuming, frustrating, and worst of all, error-prone process.&lt;/p&gt;</description>
      <pubDate>Mon, 13 Oct 2008 15:33:07 -0400</pubDate>
      <guid>/posts/658-frustration</guid>
    </item>
    <item>
      <title>acts_as_video_fu</title>
      <author>Matt Darby</author>
      <link>/posts/715-acts_as_video_fu</link>
      <description>&lt;p&gt;ActsAsVideoFu&lt;br /&gt;
=====&lt;/p&gt;
&lt;p&gt;Rails plugin that easily allows you to show video streams on your site. Currently, YouTube and Vimeo streams are&lt;br /&gt;
supported.&lt;br /&gt;
#video_url is expected to be in these formats:&lt;/p&gt;
&lt;p&gt;YouTube: http://www.youtube.com/watch?v=gEILFf2XSrM&lt;br /&gt;
Vimeo: http://vimeo.com/726135&lt;/p&gt;
&lt;p&gt;Example&lt;br /&gt;
===&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
./script/generate scaffold Video title:string video_url:string
 
#video.rb
class Video &amp;lt; ActiveRecord::Base
  acts_as_video_fu
end
 
Video.create!(:title =&amp;gt; "Some Title", :video_url =&amp;gt; "http://www.youtube.com/watch?v=gEILFf2XSrM")
 
#show.html.erb
&amp;lt;%= display_video(@video) %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Available on &lt;a href="http://github.com/mdarby/acts_as_video_fu/tree/master"&gt;Github&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 05 Oct 2008 00:57:10 -0400</pubDate>
      <guid>/posts/715-acts_as_video_fu</guid>
    </item>
    <item>
      <title>Thanks, Rails?</title>
      <author>Matt Darby</author>
      <link>/posts/713-thanks-rails</link>
      <description>&lt;p&gt;&lt;b&gt;I love it when code just stops working for no reason.&lt;/b&gt;&lt;br /&gt;
&lt;img src="/files/41/original/picture-2.png" alt="" /&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 30 Sep 2008 12:45:11 -0400</pubDate>
      <guid>/posts/713-thanks-rails</guid>
    </item>
    <item>
      <title>iTunes movie via shared library rant</title>
      <author>Matt Darby</author>
      <link>/posts/712-itunes-movie-via-shared-library-rant</link>
      <description>&lt;p&gt;Anyone else having this issue? Here is a support request I sent to Apple Support:&lt;/p&gt;
&lt;p&gt;Before I start, please note that this is the third time this has happened to me with three different movies, on three different occasions.&lt;/p&gt;
&lt;p&gt;I rent/purchase a movie and start to watch. The movie downloads correctly as I watch. When the movie completes downloading, it automatically transfers itself to a shared server on my local network (where my library content is located). When the transfer is complete, the movie refuses to play any longer. The movie file is there, the listing in the library is there (and is correctly linked to the file on the shared server), but is refuses to play. The play button is active for about three seconds, then it goes to an unactive state and nothing happens. No error, no help, no movie.&lt;/p&gt;
&lt;p&gt;Again; this is the third time this has happened. It is absolutely ridiculous to deal with the same issue over and over again when purchasing content. I know that I will be able to redownload the content, but the movie has been ruined already. The content is there, so it must be &lt;span class="caps"&gt;DRM&lt;/span&gt; that is causing errors. Apple needs to fix this.&lt;/p&gt;</description>
      <pubDate>Mon, 29 Sep 2008 04:34:07 -0400</pubDate>
      <guid>/posts/712-itunes-movie-via-shared-library-rant</guid>
    </item>
    <item>
      <title>Hampton Inn understands its customers</title>
      <author>Matt Darby</author>
      <link>/posts/711-hampton-inn-understands-its-customers</link>
      <description>&lt;center&gt;
&lt;p&gt;&lt;b&gt;The ultimate in usability.&lt;/b&gt;&lt;br /&gt;
&lt;img src="/files/42/original/pizza-hut-2.jpg" alt="" /&gt;&lt;/p&gt;
&lt;/center&gt;</description>
      <pubDate>Mon, 08 Sep 2008 06:28:40 -0400</pubDate>
      <guid>/posts/711-hampton-inn-understands-its-customers</guid>
    </item>
    <item>
      <title>Ruby: Number of weekdays between dates</title>
      <author>Matt Darby</author>
      <link>/posts/710-ruby-number-of-weekdays-between-dates</link>
      <description>&lt;p&gt;Here is a simple monkeypatch (duckpunch, donkeykick, squirrelbite, etc) to the Date class that easily allows us to calculate the number of weekdays between two dates. I can&amp;#8217;t believe that this functionality doesn&amp;#8217;t exist in the standard lib, but I&amp;#8217;m normally the last person to mess with Date/Time calculations because they are absolute evil.&lt;/p&gt;
&lt;p&gt;Drop this sucker into a file named &amp;#8220;date.rb&amp;#8221; in your Rails app&amp;#8217;s config/initializers directory and restart.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
# Usage: Date.today.weekdays_until(some_date_in_the_future)
 
class Date
  def weekdays_until(date)
    return 0 if date &amp;lt;= self
    (self..date).select{|day| day.is_weekday?}.size
  end
 
  def is_weekday?
    self.wday != 0 &amp;amp;&amp;amp; self.wday != 6
  end
 
end
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;But wait! There&amp;#8217;s more!&lt;/h3&gt;
&lt;p&gt;I &lt;a href="https://rails.lighthouseapp.com/projects/8994/tickets/2304-add-concept-of-weekdays"&gt;attempted&lt;/a&gt; to have this functionality merged into the Rails Core, but alas, it&amp;#8217;s probably more fitting for a gem. Grab &lt;strong&gt;weekdays&lt;/strong&gt; &lt;a href="http://github.com/mdarby/weekdays/tree/master"&gt;here&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 26 Aug 2008 22:40:10 -0400</pubDate>
      <guid>/posts/710-ruby-number-of-weekdays-between-dates</guid>
    </item>
    <item>
      <title>Ruby vs. PHP, round #19238</title>
      <author>Matt Darby</author>
      <link>/posts/709-ruby-vs-php-round-19238</link>
      <description>&lt;p&gt;I just translated an old &lt;span class="caps"&gt;PHP&lt;/span&gt; function to its Ruby counterpart. I think it really showcases Ruby&amp;#8217;s elegance:&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;PHP&lt;/span&gt; Version:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
function calc_pct_complete($job_id, $d) {
  $pc = 0;
  $sql = "some SQL query";
  $res = mysql_query($sql);
  while ($row = mysql_fetch_array($res)) {
    $x = total_days($row[start_date], $d) / total_days($row[start_date], $row[end_date]);
    if ($x &amp;lt; 0) {
      $x = 0;
    } elseif ($x &amp;gt; 1) {
      $x = 1;
    } elseif ($row[name] != "X" &amp;amp;&amp;amp; $row[name] != "Y") {
      $x = $x * $x;
    }
    $pc += $x * $row[pct_hours];
  }
  mysql_free_result($res);
  return $pc;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Ruby Version:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
def percentage_complete(date = Date.today)
  self.phases.inject(0.0) do |sum, phase|
    percent_complete = phase.percentage_complete(date)
    percent_complete = percent_complete ** 2 unless %w{X Y}.include?(phase.name)
 
    sum += (percent_complete * phase.percentage_of_hours)
  end
end
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Mon, 25 Aug 2008 04:17:59 -0400</pubDate>
      <guid>/posts/709-ruby-vs-php-round-19238</guid>
    </item>
    <item>
      <title>More proof that security hurts</title>
      <author>Matt Darby</author>
      <link>/posts/708-more-proof-that-security-hurts</link>
      <description>&lt;div class="img_left"&gt;&lt;img src="/files/43/original/yeah.jpg" alt="" /&gt;&lt;/div&gt;
&lt;p&gt;While starting to enjoy Dan Ariely&amp;#8217;s book &lt;a href="http://www.amazon.com/Predictably-Irrational-Dan-Ariely/dp/006135323X"&gt;Predictably Irrational&lt;/a&gt;, I come across a security tag firmly affixed to a page. I purchased this book directly from Amazon; so they have much trouble with shoplifters?&lt;/p&gt;</description>
      <pubDate>Sun, 24 Aug 2008 09:23:24 -0400</pubDate>
      <guid>/posts/708-more-proof-that-security-hurts</guid>
    </item>
    <item>
      <title>Obie Fernandez - Do The Hustle</title>
      <author>Matt Darby</author>
      <link>/posts/707-obie-fernandez-do-the-hustle</link>
      <description>&lt;p&gt;Everyone in the Rails community knows and loves Obie Fernandez (or they should). He gave a wonderfully insightful presentation at RubyFringe that everyone should take to heart.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.infoq.com/presentations/fernandez-sales-do-the-hustle"&gt;Obie Fernandez &amp;#8211; Do The Hustle&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 19 Aug 2008 10:59:27 -0400</pubDate>
      <guid>/posts/707-obie-fernandez-do-the-hustle</guid>
    </item>
    <item>
      <title>RESTful_ACL talk slides</title>
      <author>Matt Darby</author>
      <link>/posts/693-restful_acl-talk-slides</link>
      <description>&lt;p&gt;&lt;a href="/files/66/original/restful_acl.pdf"&gt;Here are the slides&lt;/a&gt; from the lightening talk I gave last night at the &lt;a href="http://www.columbusrb.com/"&gt;Columbus Ruby Brigade&lt;/a&gt; meeting as promised.&lt;/p&gt;</description>
      <pubDate>Tue, 19 Aug 2008 03:24:27 -0400</pubDate>
      <guid>/posts/693-restful_acl-talk-slides</guid>
    </item>
    <item>
      <title>Ticketmaster Sucks.</title>
      <author>Matt Darby</author>
      <link>/posts/706-ticketmaster-sucks</link>
      <description>&lt;center&gt;&lt;strong&gt;Complete thievery.&lt;/strong&gt;&lt;br /&gt;
&lt;img src="/files/44/original/bitches.png" alt="" /&gt;&lt;/center&gt;</description>
      <pubDate>Fri, 01 Aug 2008 12:17:18 -0400</pubDate>
      <guid>/posts/706-ticketmaster-sucks</guid>
    </item>
    <item>
      <title>&#8230;</title>
      <author>Matt Darby</author>
      <link>/posts/705-</link>
      <description>&lt;div class="img_left"&gt;&lt;img src="/files/45/original/me.jpg" alt="" /&gt;&lt;/div&gt;
&lt;p&gt;Since you&amp;#8217;re not cool if you don&amp;#8217;t have a vector version of yourself on your techincal blog these days, I&amp;#8217;ve decided to create one of myself&#8230; after a few beers and using only my trackpad. They call Picaso a genius right?&lt;/p&gt;</description>
      <pubDate>Fri, 25 Jul 2008 19:03:03 -0400</pubDate>
      <guid>/posts/705-</guid>
    </item>
    <item>
      <title>Finally, I can rest!</title>
      <author>Matt Darby</author>
      <link>/posts/704-finally-i-can-rest</link>
      <description>&lt;center&gt;&lt;strong&gt;I have vanquished the plight that is Wii Bowling!&lt;/strong&gt;&lt;br /&gt;
&lt;img src="/files/46/original/i-rule-2.jpg" alt="" /&gt;&lt;/center&gt;</description>
      <pubDate>Fri, 25 Jul 2008 08:50:42 -0400</pubDate>
      <guid>/posts/704-finally-i-can-rest</guid>
    </item>
    <item>
      <title>Maybe I Spoke Too Soon</title>
      <author>Matt Darby</author>
      <link>/posts/703-maybe-i-spoke-too-soon</link>
      <description>&lt;p&gt;A couple weeks ago I ran a few benchmarks on Passenger vs. Mongrel. I found that Passenger was much slower than Nginx and Mongrel. Today I &lt;a href="http://blog.phusion.nl/2008/07/24/wikirubyonrailsorg-now-running-on-phusion-passenger/"&gt;read&lt;/a&gt; that the &lt;a href="http://wiki.rubyonrails.org/rails"&gt;Rails Wiki&lt;/a&gt; is now running on Passenger; my curiousity piqued, I checked out the site.&lt;/p&gt;
&lt;p&gt;Much to my surprise, the site was &lt;strong&gt;amazingly responsive&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Alright. Did I do something wrong? Perhaps I missed something? I created a fresh Amazon EC2 instance (m1.large if interested), and recreated my earlier Passenger setup. One thing that I did notice that I may have done differently this time was that I might not have installed my gems with the freshly installed Ruby Enterprise Edition (&lt;span class="caps"&gt;REE&lt;/span&gt;).&lt;/p&gt;
&lt;p&gt;(Which looks something like this:)&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
/opt/ruby-enterprise-1.8.6-20080709/bin/ruby /opt/ruby-enterprise-1.8.6-20080709/bin/gem install aws-s3
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;One other thing might be that I commented out the &amp;#8216;PassengerRuby&amp;#8217; line when I updated Apache&amp;#8217;s config to use &lt;span class="caps"&gt;REE&lt;/span&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
#PassengerRuby /usr/bin/ruby
RailsRuby /opt/ruby-enterprise-1.8.6-20080709/bin/ruby
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Either way, I reran the benchmarks and was really quite surprised:&lt;br /&gt;
&lt;img src="/files/47/original/benchmark-2.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;So what does this all mean? Who wins?&lt;/p&gt;
&lt;p&gt;Good question.&lt;/p&gt;
&lt;p&gt;It seems that both of the benchmarks are slower than those previously run! My conclusion is that results all over the place as network conditions obviously affect response time. For the sake of clarity, I&amp;#8217;ve used a 15Mb/2Mb connection for all benchmarks.&lt;/p&gt;
&lt;p&gt;This time around &lt;span class="caps"&gt;REE&lt;/span&gt; seems &lt;strong&gt;much&lt;/strong&gt; more responsive than it did before all the while using 1.35 less load than its Nginx/Mongrel counterpart. The Nginx instance seems about as responsive as it normally feels, but the difference in load is quite an eye opener. This information coupled with Passenger&amp;#8217;s ease of use make it quite the contender.&lt;/p&gt;
&lt;p&gt;I think I&amp;#8217;ll try Passenger for a while on my production server. It&amp;#8217;s easier to maintain and hell, maybe even faster. I&amp;#8217;ll report back with further findings.&lt;/p&gt;</description>
      <pubDate>Thu, 24 Jul 2008 06:44:14 -0400</pubDate>
      <guid>/posts/703-maybe-i-spoke-too-soon</guid>
    </item>
    <item>
      <title>What IT Pros Hate About Users</title>
      <author>Matt Darby</author>
      <link>/posts/702-what-it-pros-hate-about-users</link>
      <description>&lt;p&gt;Thanks to the &lt;a href='http://www.archive.org/web/web.php'&gt;Wayback Machine&lt;/a&gt;, I was able to find an blog post I posted almost exactly two years ago bitching about users. This article made the front page of Digg (1338 diggs) and nearly melted my home Apache server in the process. I&amp;#8217;m reposting it here for posterity&amp;#8217;s sake.&lt;/p&gt;
&lt;p&gt;Here is the original text:&lt;br /&gt;
&lt;hr&gt;&lt;/p&gt;
&lt;p&gt;July 25th, 2006 @ 5:40:18pm &lt;span class="caps"&gt;EDT&lt;/span&gt; | Category: General | 22,672 Views&lt;br /&gt;
&lt;p&gt;&lt;br /&gt;
My rebuttal to the NetworkWorld article &amp;#8220;What Users Hate About IT Pros&amp;#8221;:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
Users are an interesting bunch. While most are very nice and understand that everything in the world isn&#8217;t perfect, many demand miracles. Why six somewhat universal IT gripes? Why not?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
1. &lt;b&gt;Users Lie&lt;/b&gt; &amp;#8211; Many times I chalk up user misinformation to a lack of technical knowledge, but Users will also tell you straight-out lies. Perhaps they feel guilty about breaking something, but lying about the symptoms of the problem at hand only further prevent the solution.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
2. &lt;b&gt;Management Doesn&#8217;t Understand&lt;/b&gt; &amp;#8211; Bosses understand what the IT Department does, sort of. Yet they control the budgets, personnel, and usually make IT related decisions without input. We are then expected to make it work right off the bat no matter what else might need our attention. Part of the trouble with being an IT Pro is that we are like a movie editor; you only notice us when we fuck up.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
3. &lt;b&gt;Perfection Expectation&lt;/b&gt; &amp;#8211; IT Pros are expected to know how to fix every model of every device ever manufactured. If it has a screen or plugs into a socket, we are expected not only to know how to use it, but also to troubleshoot and fix it. Immediately. Without a manual. Hey, a copy machine is like a computer right?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
4. &lt;b&gt;Every User&#8217;s Problem is Our #1 Priority&lt;/b&gt; &amp;#8211; Many Users will run into the IT Department screaming that their &amp;#8220;Internet&amp;#8221; is broken and it must be fixed immediately. While we understand the pictures of your Mom&#8217;s new dog are insanely important, we might be busy doing something that might rank over your issue, like ensuring that the entire company is receiving email, or fighting off an attack from some Korean kid. IT Pros across the world could work eight days a week and never solve every issue.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
5. &lt;b&gt;Some Things Just Won&#8217;t Work&lt;/b&gt; &amp;#8211; We program computers with logical instructions, but as everyone knows, they do not behave logically. Not every device can work with every other device. Standards are not standard, as there are different implementations of every standard ever made. I would love to sync your iPod to your cell phone via a bluetooth connection; it should work right? When we say that it cannot work, take our word for it. We are the professionals after all.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
6. &lt;b&gt;Personal Pro&lt;/b&gt; &amp;#8211; We don&#8217;t mind answering a question a User might have about their home computer setup, but they must keep in mind that everyone in the company does the same thing. We try to be kind and helpful, but sometimes we are really busy and tired of the grind. If a local IT Pro starts you off on the right path, &lt;span class="caps"&gt;GOOGLE&lt;/span&gt; for the next steps. We do not have the time to hold everyone&#8217;s hand fixing their Mother&#8217;s 1986 Packard Bell setup. We understand the concept of &amp;#8220;Teach a man to fish&#8230;&amp;#8221;, but Users need to understand that exterior systems are their responsibility.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;
To be fair, I&#8217;m sure that these issues can be applied to any field of work. Hey, we&#8217;re all overworked and underpaid, right?&lt;/p&gt;
&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jul 2008 17:42:32 -0400</pubDate>
      <guid>/posts/702-what-it-pros-hate-about-users</guid>
    </item>
    <item>
      <title>Spam comes to GitHub</title>
      <author>Matt Darby</author>
      <link>/posts/701-spam-comes-to-github</link>
      <description>&lt;center&gt;&lt;strong&gt;Oh noes. We&amp;#8217;ve been found.&lt;/strong&gt;&lt;br /&gt;
&lt;img src="/files/48/original/github-spam.png" alt="" /&gt;&lt;/center&gt;</description>
      <pubDate>Tue, 22 Jul 2008 13:48:50 -0400</pubDate>
      <guid>/posts/701-spam-comes-to-github</guid>
    </item>
    <item>
      <title>RESTful_ACL Update</title>
      <author>Matt Darby</author>
      <link>/posts/700-restful_acl-update</link>
      <description>&lt;p&gt;RESTful_ACL has been updated for the first time in nearly three months!&lt;br /&gt;
&lt;h4&gt;Global Admin Access&lt;/h4&gt;&lt;br /&gt;
Due to popular demand (well, alright, I needed it on a project), site administrators get full global access to all RESTful_ACL resources. The trick? Make sure that your &lt;code&gt;User&lt;/code&gt; model defines an &lt;code&gt;is_admin?&lt;/code&gt; method or &lt;code&gt;is_admin&lt;/code&gt; attribute. Before RESTful_ACL does a thing it will now check for this method/attribute to see if the &lt;code&gt;current_user&lt;/code&gt; is an Admin. If so, viola!, you&amp;#8217;re in. It&amp;#8217;s like that scene in Goodfellas where Henry and Karen get into the nightclub via the kitchen. Bobby Vinton and all.&lt;br /&gt;
&lt;h4&gt;New View Helpers&lt;/h4&gt;&lt;br /&gt;
I&amp;#8217;ve added four new view helpers that are less verbose than the old style:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Old Style:&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
if Job.is_creatable_by(@current_user)
  &#8230;
end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Super New And Improved Deluxe Style:&lt;/strong&gt;&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
if creatable
  &#8230;
end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The new style automatically assumes that you&amp;#8217;re talking about the &lt;code&gt;current_user's&lt;/code&gt; permissions on the current resource, so you don&amp;#8217;t have to specify it over and over and over and over. These new helpers also take &lt;code&gt;is_admin?&lt;/code&gt; into account as noted above.&lt;/p&gt;
&lt;p&gt;The old style will still work so no update worries.&lt;/p&gt;
&lt;p&gt;Grab it now on &lt;a href="http://github.com/mdarby/restful_acl/tree/master"&gt;Github!&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jul 2008 06:01:03 -0400</pubDate>
      <guid>/posts/700-restful_acl-update</guid>
    </item>
    <item>
      <title>I kill me!</title>
      <author>Matt Darby</author>
      <link>/posts/699-i-kill-me</link>
      <description>&lt;center&gt;&lt;img src="/files/49/original/commit.png" alt="" /&gt;&lt;/center&gt;</description>
      <pubDate>Tue, 15 Jul 2008 11:24:40 -0400</pubDate>
      <guid>/posts/699-i-kill-me</guid>
    </item>
    <item>
      <title>Terrible Usability</title>
      <author>Matt Darby</author>
      <link>/posts/698-terrible-usability</link>
      <description>&lt;p&gt;I happened to be in a hospital room when I noticed a machine in the corner that was showing a screensaver full of helpful messages. This was one of them:&lt;br /&gt;
&lt;center&gt;&lt;img src="/files/50/original/warning.jpg" alt="" /&gt;&lt;/center&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 14 Jul 2008 05:17:15 -0400</pubDate>
      <guid>/posts/698-terrible-usability</guid>
    </item>
    <item>
      <title>Apache/Passenger vs. Nginx/Mongrel</title>
      <author>Matt Darby</author>
      <link>/posts/697-apache-passenger-vs-nginx-mongrel</link>
      <description>&lt;p&gt;There is a bunch of hubbub around the Rails community about &lt;a href="http://www.modrails.com/index.html"&gt;Passenger (mod_rails)&lt;/a&gt;. It really simplifies Rails application deployment, but how does it stack up against the venerable &lt;a href="http://nginx.net/"&gt;Nginx&lt;/a&gt; and &lt;a href="http://mongrel.rubyforge.org/"&gt;Mongrel&lt;/a&gt; scheme?&lt;/p&gt;
&lt;p&gt;My curiosity piqued, I decided to benchmark my current application. All three benchmarks were conducted on Amazon Web Services&amp;#8217; cloud using an Fedora 8 x64 instance with 8G of &lt;span class="caps"&gt;RAM&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;Each instance was tested using Apache&amp;#8217;s &amp;#8216;ab&amp;#8217; tool with 10 concurrent requests over 1000 connections. Each request used authentication and ssl.&lt;/p&gt;
&lt;p&gt;&lt;img src="/files/51/original/benchmark1.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;As you can see, Nginx with five Mongrel instances is faster than Passenger, and honestly, you can feel some sluggishness using Passenger.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Passenger Pros:&lt;/strong&gt;&lt;br /&gt;
1. Ridiculously easy to install.&lt;br /&gt;
2. You don&amp;#8217;t have to restart Mongrel processes when you deploy changes to your application.&lt;br /&gt;
3. It&amp;#8217;s still early in the game, so it can only get faster.&lt;br /&gt;
4. Every shared host in the world supports Apache.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Passenger Cons:&lt;/strong&gt;&lt;br /&gt;
1. Noticably sluggish request cycles compared to Nginx/Mongrel&lt;br /&gt;
2. Ruby Enterprise Edition doesn&amp;#8217;t really seem to do anything&lt;br /&gt;
3. Seems to be more of a resource hog than their writeup suggests &amp;#8212; I also tested Passenger on an i386 instance with 2G &lt;span class="caps"&gt;RAM&lt;/span&gt; and the damned box nearly melted. Seriously.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Nginx/Mongrel Pros:&lt;/strong&gt;&lt;br /&gt;
1. Faster&lt;br /&gt;
2. Nginx is easier to configure than Apache&lt;br /&gt;
3. Widely heralded as the current best practice deployment scheme for production environments&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Nginx/Mongrel Cons:&lt;/strong&gt;&lt;br /&gt;
1. Comparatively painful to deploy&lt;br /&gt;
2. Deploying changes to your application can be trickier&lt;br /&gt;
&#8230; So my conclusion?&lt;/p&gt;
&lt;p&gt;Nginx/Mongrel wins this round. Deployment is much more complex, but also noticably more responsive. Ease of installation is nice, but you only deploy your application from scratch once!&lt;/p&gt;
&lt;h3&gt;Update &amp;#8211; 2009-05-11&lt;/h3&gt;
&lt;p&gt;This post gets a good amount of traffic, so I&amp;#8217;d like to revise my earlier statements: &amp;#8220;Just Use Passenger.&amp;#8221;&lt;/p&gt;</description>
      <pubDate>Thu, 10 Jul 2008 08:22:28 -0400</pubDate>
      <guid>/posts/697-apache-passenger-vs-nginx-mongrel</guid>
    </item>
    <item>
      <title>George Carlin</title>
      <author>Matt Darby</author>
      <link>/posts/696-george-carlin</link>
      <description>&lt;center&gt;&lt;strong&gt;Farewell George.&lt;/strong&gt;&lt;br /&gt;
&lt;img src="/files/52/original/georgecarlin.jpg" alt="" /&gt;&lt;/center&gt;</description>
      <pubDate>Mon, 23 Jun 2008 02:58:54 -0400</pubDate>
      <guid>/posts/696-george-carlin</guid>
    </item>
    <item>
      <title>Congratuations 10% of America!</title>
      <author>Matt Darby</author>
      <link>/posts/695-congratuations-10-of-america</link>
      <description>&lt;div class="img_right"&gt;&lt;img src="/files/53/original/gay-rights.jpg" alt="" /&gt;&lt;/div&gt;
&lt;p&gt;Today gay couples have won the right to marry in California.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m very happy to see that an estimated 10% of our nation now has the opportunity to legally express their devotion and love to another. It&amp;#8217;s long overdue.&lt;/p&gt;
&lt;p&gt;The holy war surrounding this issue is ridiculous. We live in a free society; meaning that as consenting adults, we&amp;#8217;re free to make our own decisions (well, as much as they allow us to).&lt;/p&gt;
&lt;p&gt;If you are against gay marriage; great. Opinions are wonderful. However, why would someone legislate someone else&amp;#8217;s happiness and fulfillment? The entire point of this existance is to find and connect with others, and marriage is the highest order.&lt;/p&gt;
&lt;p&gt;Remember &amp;#8220;Life, Liberty, and the Pursuit of Happiness&amp;#8221;?&lt;br /&gt;
Remember the last time the nation tried &amp;#8220;Separate But &amp;#8216;Equal&amp;#8217;&amp;#8221;?&lt;/p&gt;
&lt;p&gt;Congratuations to all the newlyweds tonight in California!&lt;/p&gt;</description>
      <pubDate>Mon, 16 Jun 2008 04:35:37 -0400</pubDate>
      <guid>/posts/695-congratuations-10-of-america</guid>
    </item>
    <item>
      <title>Complete Awesomeness</title>
      <author>Matt Darby</author>
      <link>/posts/694-complete-awesomeness</link>
      <description>&lt;center&gt;&lt;img src="/files/54/original/obama.jpg" alt="" /&gt;&lt;/center&gt;
&lt;p&gt;Congratulations on doing what they said couldn&amp;#8217;t be done, and for making history in such an elegant and eloquent fashion.&lt;/p&gt;</description>
      <pubDate>Wed, 04 Jun 2008 05:29:54 -0400</pubDate>
      <guid>/posts/694-complete-awesomeness</guid>
    </item>
    <item>
      <title>Iterating over all Models in Rails</title>
      <author>Matt Darby</author>
      <link>/posts/692-iterating-over-all-models-in-rails</link>
      <description>&lt;p&gt;Neat little snippet of code in those odd times you need to loop over every model in your application programmatically.&lt;/p&gt;
&lt;p&gt;This exact snippet loops over every model, and converts each timestamp (created_at, updated_at) to &lt;span class="caps"&gt;UTC&lt;/span&gt;. It can be quite helpful if you&amp;#8217;re adding Time Zone support to your Rails 2.1 application and you have existing non-&lt;span class="caps"&gt;UTC&lt;/span&gt; timestamps.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
all_models = Dir.glob( File.join( RAILS_ROOT, 'app', 'models', '*.rb') ).map{|path| path[/.+\/(.+).rb/,1] }
ar_models = all_models.select{|m| m.classify.constantize &amp;lt; ActiveRecord::Base}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;*Please note: I haven&amp;#8217;t tested this very thoroughly, but it does seem to do the trick. As we know, Dates and Times can be total PITAs!&lt;/p&gt;</description>
      <pubDate>Fri, 16 May 2008 12:06:04 -0400</pubDate>
      <guid>/posts/692-iterating-over-all-models-in-rails</guid>
    </item>
    <item>
      <title>I Love Ruby</title>
      <author>Matt Darby</author>
      <link>/posts/691-i-love-ruby</link>
      <description>&lt;p&gt;In the application I&amp;#8217;m currently developing a User has_many Jobs, and each Job has a bunch of nested resources. The application calls for a Dashboard, filled with the latest changes to any Job the currently logged-in user is assigned to.&lt;/p&gt;
&lt;p&gt;Sounds difficult huh?&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
def self.get_latest_items_for(current_user)
  assigned_job_ids = current_user.jobs.collect(&amp;amp;:id)
  find(:all, :conditions =&amp;gt; ["job_id in (?)", assigned_job_ids])
end
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;In order to get the currently logged-in user&amp;#8217;s list I just do:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
RecentItem.get_latest_items_for(current_user)
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Simple, elegant, understandable, and concise.&lt;/p&gt;</description>
      <pubDate>Fri, 16 May 2008 08:42:13 -0400</pubDate>
      <guid>/posts/691-i-love-ruby</guid>
    </item>
    <item>
      <title>AWS, EC2 and SSL</title>
      <author>Matt Darby</author>
      <link>/posts/690-aws-ec2-and-ssl</link>
      <description>&lt;p&gt;I spent a greater part of this day attempting to get &lt;a href='http://nginx.net/'&gt;nginx&lt;/a&gt;, &lt;span class="caps"&gt;SSL&lt;/span&gt;, and &lt;a href='http://aws.amazon.com'&gt;EC2&lt;/a&gt; to play nice together. The funny thing was that nginx (which was hosting a &lt;a href='http://en.wikipedia.org/wiki/Mongrel_(web_server)'&gt;mongrel_cluster&lt;/a&gt;) would serve standard &lt;span class="caps"&gt;HTTP&lt;/span&gt; requests just fine, but &lt;span class="caps"&gt;HTTPS&lt;/span&gt; requests just kind of hung there.&lt;/p&gt;
&lt;p&gt;I could see that nginx was in fact listening to port 443 and could connect locally, but the whole shebang fizzled out anywhere outside the local box. No firewall either.&lt;/p&gt;
&lt;p&gt;After pulling my hair out for a bit, I happened across &lt;a href='http://thebitt.com/2007/03/31/setting-up-my-image-on-ec2/'&gt;this&lt;/a&gt; article that alluded to the &lt;code&gt;ec2-authorize&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;Seems as though you have to &lt;b&gt;remotely&lt;/b&gt; manage the &amp;#8220;firewall&amp;#8221; of a running instance!&lt;/p&gt;
&lt;p&gt;Anyhow; cutting to the chase: To enable &lt;span class="caps"&gt;HTTPS&lt;/span&gt; on your EC2 instance just run:&lt;br /&gt;
&lt;pre&gt;&lt;code&gt;
ec2-authorize default -p 443
&lt;/code&gt;&lt;/pre&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 15 May 2008 10:56:29 -0400</pubDate>
      <guid>/posts/690-aws-ec2-and-ssl</guid>
    </item>
    <item>
      <title>Rails, Git, and Plugins</title>
      <author>Matt Darby</author>
      <link>/posts/689-rails-git-and-plugins</link>
      <description>&lt;p&gt;One of Rails&amp;#8217; greatest strengths lies with the plugin system. Git is the new source control kid on the block that all the girls are talking about, but Git breaks existing systems to manage plugins, such as Piston and the great &lt;code&gt;./script/plugin install -x&lt;/code&gt; command.&lt;/p&gt;
&lt;p&gt;Git giveth and Git taketh away.&lt;/p&gt;
&lt;p&gt;Git has the supernatural ability to track submodules in your application. The below command adds RESTful_ACL as a submodule to your application inside the vendor/plugins directory, checks the project out for you, and commits changes in your application (added info in .gitmodules).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
git submodule add git://github.com/mdarby/restful_acl.git vendor/plugins/restful_acl
git commit -a
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When you go to clone to a different machine, just run the following two commands to checkout all of your submodules:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
git submodule init
git submodule update
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You&amp;#8217;re off and running!&lt;/p&gt;</description>
      <pubDate>Mon, 12 May 2008 15:49:37 -0400</pubDate>
      <guid>/posts/689-rails-git-and-plugins</guid>
    </item>
    <item>
      <title>Forays into freelancing</title>
      <author>Matt Darby</author>
      <link>/posts/688-forays-into-freelancing</link>
      <description>&lt;p&gt;I&amp;#8217;ve suddenly realized that while I do really like my fulltime gig, I&amp;#8217;m not getting paid for the insane amount of overtime I normally put in. I&amp;#8217;m not asked to do this work, but I do as I get bored and hey, I really like to code.&lt;/p&gt;
&lt;p&gt;So I logged onto &lt;a href="http://workingwithrails.com"&gt;workingwithrails.com&lt;/a&gt; and sent my resume out to a few prospective clients that allow telecommuting developers. Why the blog post? I don&amp;#8217;t know, I guess I&amp;#8217;m kind of excited about the process. I will be nice to use my craft on different problem domains for once.&lt;/p&gt;
&lt;p&gt;I have been attending meetings with the &lt;a href='columbusrb.com'&gt;Columbus Ruby Brigade&lt;/a&gt; for the last three months and this month&amp;#8217;s meeting was about freelancing. One thing that member &lt;a href='http://www.workingwithrails.com/person/5521-joe-o-brien'&gt;Joe O&amp;#8217;Brien&lt;/a&gt; said stuck in my head. To paraphrase; &amp;#8220;If you waited until you were sure you were the top expert in your field, you would never get started&amp;#8221;.&lt;/p&gt;
&lt;p&gt;I really respect Joe from afar as he&amp;#8217;s a super bright guy with a solid history of experience. Wisdom is learning from others, so I&amp;#8217;ve decided to throw my hat in the ring.&lt;/p&gt;
&lt;p&gt;Wow, I&amp;#8217;ve referenced myself 21 times in this post. My (22) high school English teacher is probably freaking out somewhere.&lt;/p&gt;</description>
      <pubDate>Fri, 28 Mar 2008 16:45:52 -0400</pubDate>
      <guid>/posts/688-forays-into-freelancing</guid>
    </item>
    <item>
      <title>Scribd_fu featured!</title>
      <author>Matt Darby</author>
      <link>/posts/687-scribd_fu-featured</link>
      <description>&lt;p&gt;Oh man, how awesome is this. Nary two hours after releasing Scribd_fu, it is already featured on Scribd&amp;#8217;s &lt;a href="http://www.scribd.com/platform/resources"&gt;Resources page&lt;/a&gt;! I hope this will help to drum up usage of Scribd_fu across the Rails community.&lt;/p&gt;
&lt;p&gt;A big thanks to Scribd for the nod, and the link!&lt;/p&gt;</description>
      <pubDate>Wed, 26 Mar 2008 13:21:53 -0400</pubDate>
      <guid>/posts/687-scribd_fu-featured</guid>
    </item>
    <item>
      <title>Scribd_fu is now live!</title>
      <author>Matt Darby</author>
      <link>/posts/686-scribd_fu-is-now-live</link>
      <description>&lt;p&gt;I&amp;#8217;m pleased to announce my latest plugin: Scribd_fu.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;What it does:&lt;/strong&gt;&lt;br /&gt;
Scribd_fu hides out in the shadows like a document converting ninja, just waiting to process your data into a convenient Flash format (like YouTube) with the help of the black majick of Scribd.com. Imagine imbedding huge documents right inline with your web UI, no downloading, no necessary programs on the client side to view your data. It&#8217;s pretty damned cool, and it works with Attachment_fu!&lt;/p&gt;
&lt;p&gt;Full write-up, repository, etc is &lt;a href='http://github.com/mdarby/scribd_fu'&gt;here&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 26 Mar 2008 10:58:04 -0400</pubDate>
      <guid>/posts/686-scribd_fu-is-now-live</guid>
    </item>
    <item>
      <title>git is so fast</title>
      <author>Matt Darby</author>
      <link>/posts/685-git-is-so-fast</link>
      <description>&lt;p&gt;&lt;span class="caps"&gt;HOW&lt;/span&gt; &lt;span class="caps"&gt;FAST&lt;/span&gt; IS IT?&lt;/p&gt;
&lt;p&gt;git is so fast that it makes me feel like I haven&amp;#8217;t done much work. I used to wait so long for Subversion to checkin that I felt like I had accomplished something!&lt;/p&gt;</description>
      <pubDate>Tue, 25 Mar 2008 08:34:31 -0400</pubDate>
      <guid>/posts/685-git-is-so-fast</guid>
    </item>
    <item>
      <title>Announcing Scribd_fu</title>
      <author>Matt Darby</author>
      <link>/posts/684-announcing-scribd_fu</link>
      <description>&lt;p&gt;I&amp;#8217;m more than happy to announce the birth of a new Ruby on Rails plugin, &lt;a href="http://github.com/mdarby/scribd_fu/tree/master"&gt;Scribd_fu&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://scribd.com/"&gt;Scribd&lt;/a&gt; is basically the YouTube for Documents. It&amp;#8217;s super awesome when you have a huge &lt;span class="caps"&gt;PDF&lt;/span&gt; that would take quite a tick to download; with this you can view your document in Flash format online, inline, and quick. Scribd_fu will allow you to seamlessly &lt;span class="caps"&gt;CRUD&lt;/span&gt; any document to a Scribd Document. The aim is to also feature full integration with the venerable &lt;a href="http://svn.techno-weenie.net/projects/plugins/attachment_fu/"&gt;Attachment_fu&lt;/a&gt; plugin. Scribd is a really great service with a ton of potential. It&amp;#8217;s fast and reliable to boot.&lt;/p&gt;
&lt;p&gt;If you&amp;#8217;re a &lt;a href="http://github.com/"&gt;githubber&lt;/a&gt;, click that &amp;#8216;watch&amp;#8217; tab and we&amp;#8217;ll see where this goes!&lt;/p&gt;</description>
      <pubDate>Mon, 24 Mar 2008 17:06:53 -0400</pubDate>
      <guid>/posts/684-announcing-scribd_fu</guid>
    </item>
    <item>
      <title>Time Machine and AirDisk</title>
      <author>Matt Darby</author>
      <link>/posts/683-time-machine-and-airdisk</link>
      <description>&lt;p&gt;With the latest firmware release for Apple&amp;#8217;s Airport Extreme Base Station router comes the ability to use a connected &lt;span class="caps"&gt;USB&lt;/span&gt; drive as a Time Machine backup disk. I (and many others) have waited for this feature since Leopard&amp;#8217;s release six months ago.&lt;/p&gt;
&lt;p&gt;The big question is if it would work as expected. In my case, my Macbook easily found the drive and Time Machine recognized it. The initial backup (50G) took all night even with a supposed 100MB throughput. Subsequent backups were slow to complete, if they even started at all. Most of the time (80% or so), Time Machine would hang with &amp;#8220;Preparing Backup&amp;#8221;.&lt;/p&gt;
&lt;p&gt;One other thing that slightly annoyed me was that Time Machine creates a sparse bundle image on the AirDisk containing your backups. I assume this is done as many people can potentially use the AirDisk for backups. This causes two mounts on your system instead of one. Not a huge deal, but it&amp;#8217;s just one more thing that can fail. I don&amp;#8217;t like things that can fail in a backup process, especially one that is designed to be so behind the scenes.&lt;/p&gt;
&lt;p&gt;Right now, Time Machine is doing its initial backup again as a &lt;span class="caps"&gt;USB&lt;/span&gt; connected drive to my trusty Macbook. The AirDisk seems to still have some quirks that need to be ironed out.&lt;/p&gt;
&lt;p&gt;Also of note, I suffered a hard drive crash last week and luckily I did have Time Machine backups. I have to say that restoring Leopard from Time Machine was effortless and it was also the very first time I&amp;#8217;ve had a full restore of an operating system actually work in over a decade of Windows, Linux, and Mac usage!&lt;/p&gt;</description>
      <pubDate>Sun, 23 Mar 2008 09:57:21 -0400</pubDate>
      <guid>/posts/683-time-machine-and-airdisk</guid>
    </item>
    <item>
      <title>No Audio in Leopard Fix</title>
      <author>Matt Darby</author>
      <link>/posts/682-no-audio-in-leopard-fix</link>
      <description>&lt;p&gt;Alright, this one is odd, but it works like a charm. I recently installed Safari 3.1 on my new MacBook and after a reboot I had no audio whatsoever (though the startup chime worked). When I messed with the sound via the keyboard buttons only a greyed out icon and a barred circle appeared. I also noticed a red &lt;span class="caps"&gt;LED&lt;/span&gt; inside my headphone jack (what the hell?)&lt;/p&gt;
&lt;p&gt;Googling around I found a super weird fix &lt;a href="http://forums.macrumors.com/showthread.php?t=376394"&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The fix is to get a toothpick and stick it all the way into your headphone jack roll it around the edge of the jack until the light goes off. Yeah. I know. It really works though. I swear.&lt;/p&gt;
&lt;p&gt;My audio was working again immediately without a reboot!&lt;/p&gt;</description>
      <pubDate>Fri, 21 Mar 2008 10:33:14 -0400</pubDate>
      <guid>/posts/682-no-audio-in-leopard-fix</guid>
    </item>
    <item>
      <title>Obama is majestic</title>
      <author>Matt Darby</author>
      <link>/posts/681-obama-is-majestic</link>
      <description>&lt;p&gt;Finally. A politician that doesn&amp;#8217;t feed on ignorance nor treats the people as children. Thank you Obama for finally speaking the truth.&lt;/p&gt;
&lt;center&gt;
&lt;p&gt;&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/zrp-v2tHaDo&amp;amp;hl=en"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/zrp-v2tHaDo&amp;amp;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/center&gt;
&lt;p&gt;I read somewhere once that governments used to sell hope and safety to its people instead of nightmares. I&amp;#8217;d like to see the country rally around hope instead of the monsters in the closet.&lt;/p&gt;</description>
      <pubDate>Thu, 20 Mar 2008 04:00:11 -0400</pubDate>
      <guid>/posts/681-obama-is-majestic</guid>
    </item>
    <item>
      <title>Darby Cult</title>
      <author>Matt Darby</author>
      <link>/posts/680-darby-cult</link>
      <description>&lt;div class="img_left"&gt;&lt;img src="/files/55/original/my-cult.png" alt="" /&gt;&lt;/div&gt;
&lt;p&gt;I think my friends are starting a Darby-centric cult on MySpace. Suddenly they all use a Van Gogh painting as their avatar that is my creepy doppelg&#228;nger.&lt;/p&gt;</description>
      <pubDate>Sun, 16 Mar 2008 15:28:31 -0400</pubDate>
      <guid>/posts/680-darby-cult</guid>
    </item>
    <item>
      <title>RESTful_ACL has moved!</title>
      <author>Matt Darby</author>
      <link>/posts/679-restful_acl-has-moved</link>
      <description>&lt;p&gt;RESTful_ACL has moved from Google Code to &lt;a href="https://github.com/"&gt;GitHub&lt;/a&gt;! Why the move? Well, it&amp;#8217;s basically due to &lt;a href="http://git.or.cz/"&gt;git&lt;/a&gt; being the new black, and more fun than Subversion. I&amp;#8217;m in the process of migrating all of my repositories. For anyone who hasn&amp;#8217;t tried git yet, please do. It&amp;#8217;s super simple yet really powerful. You can even import your existing Subversion repos to git by simply doing&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
git svn clone user@host:/path/to/repo
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Try it! It won&amp;#8217;t screw your existing &lt;span class="caps"&gt;SVN&lt;/span&gt; repo. Honest. So without further adieu, &lt;a href="http://github.com/mdarby/restful_acl/tree/master"&gt;Here&lt;/a&gt; is RESTful_ACL&amp;#8217;s new home and for the impatient, you can clone the repo via:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
git clone git://github.com/mdarby/restful_acl.git
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Sun, 16 Mar 2008 06:14:06 -0400</pubDate>
      <guid>/posts/679-restful_acl-has-moved</guid>
    </item>
    <item>
      <title>Ohio makes me sad</title>
      <author>Matt Darby</author>
      <link>/posts/678-ohio-makes-me-sad</link>
      <description>&lt;p&gt;I had two roundtrip tickets to Myrtle Beach, SC for noon today. We were just going for a few days to blow off some steam, and bought the tickets a week ago on a whim. In blows this gigantic record setting snowstorm and 2&amp;#8217; of snow. The normal snowfall around these parts is around 3&amp;quot; per storm.&lt;/p&gt;
&lt;p&gt;I spent most of the day yesterday shoveling the driveway in anticipation of flying out this morning. This morning comes and I look out the window and see that our road is still not plowed. I head out in a feeble attempt to shovel into the road!&lt;/p&gt;
&lt;p&gt;If this wasn&amp;#8217;t enough our kitchen sink starts leaking all over the floor and we&amp;#8217;re out of kitty litter. We have two cats and the idea of them without clean litter for a few days makes my head swim of ruined carpets.&lt;/p&gt;
&lt;p&gt;We realized that everything was seemed to be conspiring against our trip. Not one to tempt fate (and hey, I doubt we&amp;#8217;d get out of the driveway), so we decided to eat the tickets.&lt;/p&gt;
&lt;p&gt;I wish tickets were refundable when these types of circumstances occur. It&amp;#8217;s no one&amp;#8217;s fault, but I still lose $500.&lt;/p&gt;
&lt;p&gt;30 minutes into a call to Travelocity&#8230; I hope something can be worked out!&lt;/p&gt;
&lt;p&gt;Ah, Ohio.&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;: 50 minutes into the call I&amp;#8217;m told that I cannot cancel the reservation as the flight is on time and I also cannot move the reservation as I&amp;#8217;d already checked-in online (when I thought I might be able to make it, hours ago). So I&amp;#8217;m out $500. What a fucking racket. I wish I could get away with keeping money for non-rendered service. I was so frustrated that I did the retarded guy thing and slammed my fist down on my desk. I broke the center drawer whilst doing so.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m going to bed.&lt;/p&gt;</description>
      <pubDate>Sun, 09 Mar 2008 05:31:26 -0400</pubDate>
      <guid>/posts/678-ohio-makes-me-sad</guid>
    </item>
    <item>
      <title>Why do I live in Ohio?</title>
      <author>Matt Darby</author>
      <link>/posts/677-why-do-i-live-in-ohio</link>
      <description>&lt;center&gt;&lt;img src="/files/56/original/snow.jpg" alt="" /&gt;&lt;/center&gt;
&lt;p&gt;This was taken just a few minutes ago in Columbus, Ohio. It was sunny and clear about ten minutes before. Joy!&lt;/p&gt;</description>
      <pubDate>Fri, 07 Mar 2008 06:40:13 -0500</pubDate>
      <guid>/posts/677-why-do-i-live-in-ohio</guid>
    </item>
    <item>
      <title>Ordinalize Date in Rails</title>
      <author>Matt Darby</author>
      <link>/posts/676-ordinalize-date-in-rails</link>
      <description>&lt;p&gt;Scratched my head for a tick when I noticed that Ruby&amp;#8217;s &lt;code&gt;Date::strftime&lt;/code&gt; doesn&amp;#8217;t include a ordinal formatting option (eg. &amp;#8220;January 1st, 2008&amp;#8221;). To get the &amp;#8220;st/nd/th/rd&amp;#8221; in the formatted output, do this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
date.strftime("%B #{date.day.ordinalize}, %Y")
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Hope this helps someone out there!&lt;/p&gt;</description>
      <pubDate>Thu, 06 Mar 2008 11:14:57 -0500</pubDate>
      <guid>/posts/676-ordinalize-date-in-rails</guid>
    </item>
    <item>
      <title>RESTful_ACL Update</title>
      <author>Matt Darby</author>
      <link>/posts/675-restful_acl-update</link>
      <description>&lt;p&gt;Just a quick note to say that RESTful_ACL has been updated. This latest version supports securing non-&lt;span class="caps"&gt;CRUD&lt;/span&gt; actions. It&amp;#8217;s a slight cop out of sorts; essentially if the user in question can read an object, they will also be able to do the non-&lt;span class="caps"&gt;CRUD&lt;/span&gt; action. It&amp;#8217;s not the best solution to the problem, but it will work for the moment. Maybe there is a slick way to pass in a function name as a hash/block thing that I&amp;#8217;m not sure of. Hrm.&lt;/p&gt;</description>
      <pubDate>Sun, 02 Mar 2008 15:37:56 -0500</pubDate>
      <guid>/posts/675-restful_acl-update</guid>
    </item>
    <item>
      <title>Sad but true</title>
      <author>Matt Darby</author>
      <link>/posts/674-sad-but-true</link>
      <description>&lt;center&gt;&lt;img src="/files/57/original/security.jpg" alt="" /&gt;&lt;/center&gt;</description>
      <pubDate>Fri, 29 Feb 2008 10:51:24 -0500</pubDate>
      <guid>/posts/674-sad-but-true</guid>
    </item>
    <item>
      <title>RESTful_Acl Update</title>
      <author>Matt Darby</author>
      <link>/posts/673-restful_acl-update</link>
      <description>&lt;p&gt;Just a quick update to let you know that RESTful_Acl has been updated. I removed the mapped urls option in favor of manually opting out of the &lt;span class="caps"&gt;ACL&lt;/span&gt; check on actions that are to be public. The full write-up can be found at the &lt;a href="http://code.google.com/p/restful-acl" target="_blank"&gt;usual location&lt;/a&gt;. Just a heads up!&lt;/p&gt;</description>
      <pubDate>Tue, 19 Feb 2008 17:00:12 -0500</pubDate>
      <guid>/posts/673-restful_acl-update</guid>
    </item>
    <item>
      <title>Today was a good day</title>
      <author>Matt Darby</author>
      <link>/posts/672-today-was-a-good-day</link>
      <description>&lt;p&gt;I&amp;#8217;ve been listening to Happy Hardcore all day, so it might have had something to do with perking my brainwaves all on up. Whatever it was, today was fucking awesome.&lt;/p&gt;
&lt;p&gt;Today I successfully created a proof of concept Rails application that uses &lt;a href='http://digitarald.de/project/fancyupload/'&gt;FancyUpload&lt;/a&gt;, &lt;a href='http://mootools.net/'&gt;MooTools&lt;/a&gt;, &lt;a href='http://aws.amazon.com'&gt;Amazon &lt;span class="caps"&gt;AWS&lt;/span&gt;&lt;/a&gt;, &lt;a href='http://svn.techno-weenie.net/projects/plugins/attachment_fu/'&gt;attachment_fu&lt;/a&gt;, and &lt;a href='http://code.google.com/p/mimetype-fu/'&gt;mimetype_fu&lt;/a&gt;. This application allows seamless multi-file uploads to attachment_fu (which generates thumbnails flawlessly) and in turn stores the files to AWS&amp;#8217;s S3 service.&lt;/p&gt;
&lt;p&gt;To any non-programmers, this is probably not interesting, but shit, I had to do this by hand in &lt;span class="caps"&gt;PHP&lt;/span&gt; less than a year ago and I&amp;#8217;m still battling with it. Enter Rails (and some brilliant plugins) and I have the whole damn thing up in a few hours. Not to mention that the whole upload/download is ultra secure and replicated across the globe with basically 99.99999% uptime. That beats my halfassed server petting zoo at the office by about six nines!&lt;/p&gt;</description>
      <pubDate>Tue, 12 Feb 2008 12:16:19 -0500</pubDate>
      <guid>/posts/672-today-was-a-good-day</guid>
    </item>
    <item>
      <title>RESTful_Acl</title>
      <author>Matt Darby</author>
      <link>/posts/671-restful_acl</link>
      <description>&lt;p&gt;I&amp;#8217;d like to announce my very first Ruby on Rails plugin; &lt;strong&gt;RESTful_Acl&lt;/strong&gt;.RESTful_Acl is a simple Access Control Layer for Ruby on Rails, it allows you to restrict access on a fine-grained level to any RESTful &lt;span class="caps"&gt;MVC&lt;/span&gt; stack. While the &lt;span class="caps"&gt;ACL&lt;/span&gt; structure and engine are provided by this plugin, the implementation is fully up to the user. Every application is different and everyone likes to setup their User / Account / Role resources differently; this plugin will allow you to do your thing and keep that thing locked down.The full write up is available &lt;a href="http://code.google.com/p/restful-acl/"&gt;here!&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Fri, 08 Feb 2008 05:14:16 -0500</pubDate>
      <guid>/posts/671-restful_acl</guid>
    </item>
    <item>
      <title>Odd Benchmark</title>
      <author>Matt Darby</author>
      <link>/posts/670-odd-benchmark</link>
      <description>&lt;p&gt;So it seems that my MacBook (2Ghz Core2 Duo, 2G &lt;span class="caps"&gt;RAM&lt;/span&gt;) runs 4707 Rspec tests in 67.5 seconds. My CentOS server (4200+ Core2 Duo, 2GB &lt;span class="caps"&gt;RAM&lt;/span&gt;) runs the same tests in 91.7 seconds. Both are running the latest version of MySQL. How odd is that?&lt;/p&gt;</description>
      <pubDate>Sun, 03 Feb 2008 06:58:43 -0500</pubDate>
      <guid>/posts/670-odd-benchmark</guid>
    </item>
    <item>
      <title>RSpec and the joy of testing</title>
      <author>Matt Darby</author>
      <link>/posts/667-rspec-and-the-joy-of-testing</link>
      <description>&lt;div class="float_left"&gt;
&lt;p&gt;&lt;img src="/files/58/original/rspec.png" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;89&lt;/strong&gt; database tables, &lt;strong&gt;93&lt;/strong&gt; fully RESTed objects, &lt;strong&gt;4740&lt;/strong&gt; successful tests. Life is grand. I&amp;#8217;ve spent years working in web development with &lt;span class="caps"&gt;PHP&lt;/span&gt; (as I&amp;#8217;ve described ad naseum), and I&amp;#8217;d hate to admit it, but I&amp;#8217;ve never written a test. Ever.&lt;/p&gt;
&lt;p&gt;My stuff works, but soon after every launch, small cracks start to appear. The worst part is that these small cracks are always found by my users. This is not only embarrassing, but it leads to me furiously debugging a live system with active users, trying to quickly recreate the conditions that caused the error. I like my hair and I&amp;#8217;ve losing it fast enough, thank you.&lt;/p&gt;
&lt;p&gt;Enter &lt;a href="http://rspec.info/" target="_blank"&gt;RSpec&lt;/a&gt; and &lt;a href="http://behaviour-driven.org/"&gt;Behavior Driven Development (&lt;span class="caps"&gt;BDD&lt;/span&gt;)&lt;/a&gt;. RSpec makes writing tests a &lt;strong&gt;joy&lt;/strong&gt;. Yes, I know, I know, but testing can be a real joy. It&amp;#8217;s like working out; it always seems super difficult to start, and you stall and think of a billion other things to do, but once you actually start you feel really good and alive.&lt;/p&gt;
&lt;p&gt;&lt;span class="caps"&gt;BDD&lt;/span&gt; makes testing second nature, and RSpec makes writing these tests intuative. You know those meetings you have with your clients and you try to distill what they truly need from what they tell you they need? &lt;span class="caps"&gt;BDD&lt;/span&gt; gives you a language that both you and your clients can speak; you simply describe how an object should behave:A Car not only has a color, it also should not be driveable with one tire and it should only be driveable by a licensed driver.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
describe "A Car" do
  before(:each) do
    @car = mock_model(Car)
    @driver = mock_model(Driver)
  end

  it "should have a color" do
    @car.color = nil
    @car.should_not be_valid
  end

  it "should not be driveable with one tire" do
    @car.tires = 1
    @car.is_driveable?.should_not be_true
  end

  it "should be driveable with four tires" do
    @car.tires = 4
    @car.is_driveable?.should be_true
  end

  it "should not be driveable by an unlicensed driver" do
    @driver.stub!(:license_active?).and_return(false)
    @car.stub!(:driver).and_return(@driver)
    @car.is_driveable?.should be_false
  end

  it "should be driveable by a licensed driver" do
    @driver.stub!(:license_active?).and_return(true)
    @car.stub!(:driver).and_return(@driver)
    @car.is_driveable?.should be_true
  end
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;See? Simple. As with most Ruby code, RSpec features English like statements that are immediately comprehensible to anyone &amp;#8212; even clients. You know what the best thing is about RSpec though? It not only tests your code, it &lt;strong&gt;documents&lt;/strong&gt; your code. Just look:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
A Car 
  should have a color
  should not be driveable with one tire	
  should be driveable with four tires	
  should not be driveable by an unlicensed driver	
  should be driveable by a licensed driver
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Imagine testing and documenting your code at the same time! Two things that many programmers skip altogether! That alone makes the Ruby on Rails framework and mindset the most attractive choice today.&lt;/p&gt;</description>
      <pubDate>Tue, 29 Jan 2008 14:45:41 -0500</pubDate>
      <guid>/posts/667-rspec-and-the-joy-of-testing</guid>
    </item>
    <item>
      <title>RSpec TextMate Bundle Tweak</title>
      <author>Matt Darby</author>
      <link>/posts/666-rspec-textmate-bundle-tweak</link>
      <description>&lt;p&gt;One thing that annoys me when using the RSpec bundle for TextMate is the &lt;code&gt;it&lt;/code&gt; snippet. I think that any new spec should at least register as &amp;#8216;Pending&amp;#8217; when it is run, not automatically pass. Having a blank test pass is really kind of dumb. So I&amp;#8217;ve tweaked the &lt;code&gt;it&lt;/code&gt; snippet just a hair to automatically insert a &amp;#8216;Pending&amp;#8217; statement into a newly created &lt;code&gt;it&#8230;do&lt;/code&gt; block. The description will be highlighted first, then the entire &amp;#8216;pending&amp;#8217; statement so it will be easy to enter your data.&lt;/p&gt;
&lt;p&gt;To use this snippet, just do &lt;span class="caps"&gt;CTRL&lt;/span&gt; + Command + Option + B in TextMate, go to the RSpec listing, and click on the &amp;#8216;it&amp;#8217; snippet. Copy and paste the below text and you&amp;#8217;re in business.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
it "${0:should ${1:description}}" ${3:do
  ${2:pending("Needs to be written")}
end}
&lt;/code&gt;&lt;/pre&gt;</description>
      <pubDate>Mon, 21 Jan 2008 11:23:12 -0500</pubDate>
      <guid>/posts/666-rspec-textmate-bundle-tweak</guid>
    </item>
    <item>
      <title>Strange Phenomenon in Columbus</title>
      <author>Matt Darby</author>
      <link>/posts/669-strange-phenomenon-in-columbus</link>
      <description>&lt;p&gt;&lt;img src="/files/59/original/light.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Alright. I&amp;#8217;m not nuts. Seriously.&lt;/p&gt;
&lt;p&gt;I live in Blacklick, Ohio; a small suburb of Columbus. On January 9th, 2008 we had a massive wind storm overnight. Wind gusts of 55MPH and such. Around 1:20am, I heard a noise that raised me right out of my bed. The sound was of electricity escaping, almost like a Jacob&amp;#8217;s Ladder without the snap at the end. The electricity in my house was flickering, trying valiantly to stay on. Outside at this exact moment, was a very bright greenish/blue light; it was so bright that it flooded my bedroom. We have light-blocking shades on our windows and it was still impressive.&lt;/p&gt;
&lt;p&gt;This light almost looked as if someone was shinging a light down at you when you&amp;#8217;re underwater, and it only appeared when the electricity was flickering. It appeared about two or three separate times. My wife and I were kind of freaking out as we thought that lightening was hitting our house. We quickly realized that there was no thunder and that the light was directly in sync with the electricity sound.&lt;/p&gt;
&lt;p&gt;I ran to a window and was looking out at the light, thinking that a transformer must be blowing up (it was seriously that bright and loud). I realized that our neighborhood has no above ground electricity poles. None.&lt;/p&gt;
&lt;p&gt;I grabbed a flashlight and looked out to our electicity box in our backyard and noticed that it wasn&amp;#8217;t blackened, and still in one piece.&lt;/p&gt;
&lt;p&gt;The power was out for a few more hours and I finally fell asleep around 3:00am. When I wake up in the morning, all is calm and the power is back on. Nothing was damaged at all.&lt;/p&gt;
&lt;p&gt;So what was it? I have no fucking idea. I am an educated man, and I was completely sober. My wife saw the light and heard the sounds along with me.&lt;/p&gt;
&lt;p&gt;Fast forward to today. My Father-In-Law calls and says that he was listening to a local radio program and they mentioned this phenomena. I guess that twenty or so people reported it, and an airline pilot saw it as he was approaching Columbus&amp;#8217; airport (&lt;span class="caps"&gt;CMH&lt;/span&gt;). They said that this exact phenomena was spotted by people in Texas around the same time.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m dying to know what this phenomena was. I&amp;#8217;ve never seen anything like it. My only guess is that it was St. Elmo&amp;#8217;s Fire, but I&amp;#8217;m not sure what circumstances are required to create it.&lt;/p&gt;</description>
      <pubDate>Sat, 19 Jan 2008 17:38:55 -0500</pubDate>
      <guid>/posts/669-strange-phenomenon-in-columbus</guid>
    </item>
    <item>
      <title>Columbus mayor loves the funk</title>
      <author>Matt Darby</author>
      <link>/posts/665-columbus-mayor-loves-the-funk</link>
      <description>&lt;div class="float_left"&gt;
&lt;p&gt;&lt;img src="/files/60/original/coleman1.jpg" alt="" /&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Last year, my wife and I went to see Parliment Funkadelic at a local venue. Much to our surprise, the Columbus Mayor, Michael Coleman was in attendance! He actually introduced the band and said what an honor it was to talk with George Clinton backstage. Later on, I noticed the Mayor in the balcony grooving out to the sounds of the Mothership. I was pretty damned impressed that the Mayor of a major metropolis knows how to get down, because man, if you can get down with PFunk, you know what&amp;#8217;s up.&lt;/p&gt;
&lt;p&gt;Fast forward to today whilst eating breakfast downtown I ran into Mayor Coleman. We just happened to be standing in line next to each other. He was smiling and saying hello to others when I asked him if he was going to see PFunk in February when the stop at the &lt;span class="caps"&gt;OSU&lt;/span&gt; campus. His expression changed immediately, he looked over to me and said &amp;#8216;When are they coming to town?&amp;#8217;. He said that he would definately try to make it. He pulled out his Treo like he was going to make a note of it. He told me and my wife that he has a picture of Bill Clinton and George Clinton hanging in his office!&lt;/p&gt;
&lt;p&gt;It&amp;#8217;s funny that people were taking pictures of him and shaking hands and I just ask if he&amp;#8217;s going to PFunk like one of my buddies. A little personal moment with the Mayor ;)&lt;/p&gt;</description>
      <pubDate>Sat, 19 Jan 2008 13:11:23 -0500</pubDate>
      <guid>/posts/665-columbus-mayor-loves-the-funk</guid>
    </item>
    <item>
      <title>MacWorld 2008</title>
      <author>Matt Darby</author>
      <link>/posts/664-macworld-2008</link>
      <description>&lt;p&gt;So the MacBook Air was finally unveiled and wow, what a stunner. I&amp;#8217;m sure you&amp;#8217;ll read the specs and see the pictures a billion and a half times today, so I&amp;#8217;ll spare you. As usual MacWorld showcased some brilliant items, but what about the MacBook?&lt;/p&gt;
&lt;p&gt;I dig the &lt;span class="caps"&gt;MBA&lt;/span&gt;, but I don&amp;#8217;t need an ultraportable; especially one at that price. The MacBook strikes a great balance between affordability and Mac goodness, but where are the updates? No aluminum? No faster processor? No price fluctuation?&lt;/p&gt;
&lt;p&gt;I only complain as I was going to give my beloved MacBook to my wife after I bought an updated one after MacWorld. With the &lt;span class="caps"&gt;MBA&lt;/span&gt; clocking in at $1800 and no bump in love for the MacBook, what am I to do? I don&amp;#8217;t necessarily want to purchase another exact copy of this MacBook because hey, that&amp;#8217;s just not fun.&lt;/p&gt;
&lt;p&gt;I guess this is a good problem to have ;)&lt;/p&gt;</description>
      <pubDate>Tue, 15 Jan 2008 10:02:30 -0500</pubDate>
      <guid>/posts/664-macworld-2008</guid>
    </item>
    <item>
      <title>What Does Ruby On Rails Feel Like?</title>
      <author>Matt Darby</author>
      <link>/posts/663-what-does-ruby-on-rails-feel-like</link>
      <description>&lt;p&gt;Some programmers talk about &amp;#8216;code smell&amp;#8217;, or &amp;#8216;code feel&amp;#8217;; what about a framework? What does RoR &amp;#8216;feel&amp;#8217; like? I&amp;#8217;ve been talking (blabbering) about Ruby on Rails to anyone that will listen or has the ill fortune to be within earshot of me for the last month. Usually this person is my beloved wife. At this point I&amp;#8217;m sure if I mention Rails once more to her I&amp;#8217;ll be sleeping outside. Anyhow, during one of my rants she stopped and asked me &amp;#8220;What&amp;#8217;s the difference?&amp;#8221;. To her, a programming environment is obviously alien, but to a programmer it&amp;#8217;s our world. Our day is spent in that world, and most of our creative output is expressed in that world&amp;#8217;s tongue.&lt;/p&gt;
&lt;p&gt;Before I pulled my head out of my nether regions (gave up and started using frameworks), I coded everything by hand in &lt;span class="caps"&gt;PHP&lt;/span&gt;. Then one magical day I sat down and decided to see what this CakePHP thing was all about. After realizing that I was doing far too much work designing the infrastructure that a framework provides on top everything else, I immediately switched. CakePHP cut my work by 80%. Seriously. It&amp;#8217;s a godsend for &lt;span class="caps"&gt;PHP&lt;/span&gt; people who haven&amp;#8217;t yet realized that Ruby On Rails is the path to eternal salvation.&lt;/p&gt;
&lt;p&gt;I hacked happily away with CakePHP for six months or so; did a project or three. Very soon I realized that hacking is fun and all, but I was really feeling the limitations of &lt;span class="caps"&gt;PHP&lt;/span&gt; as a language itself. &lt;span class="caps"&gt;PHP&lt;/span&gt; gets the job done, but in an extremely non-elegant way. This moment coincided with the release of Rails 2.0. In a fit of coincidental serendipity, I decided to give Rails another look now that I&amp;#8217;d decided that frameworks were a Good Thing.&lt;/p&gt;
&lt;p&gt;A shade over a month later, I&amp;#8217;ve read six Ruby/Rails books cover to cover. I&amp;#8217;ve ported existing &lt;span class="caps"&gt;PHP&lt;/span&gt; development to RoR. I&amp;#8217;ve dropped &lt;span class="caps"&gt;PHP&lt;/span&gt; permanently. It is sincerely that good. It&amp;#8217;s career altering.&lt;/p&gt;
&lt;p&gt;So what does RoR &amp;#8216;feel&amp;#8217; like? It feels like cheating. It feels like starting a marathon and then taking a taxi to the finish line. Remember the 80% workload reduction I achieved by jumping into a framework? With RoR I would honestly say that I&amp;#8217;m coding at 5% of my original workload. Much like the 1950&amp;#8217;s promise that technology would slow down our lives, the actual consequence is that I have more time to do &lt;strong&gt;better&lt;/strong&gt; work. I&amp;#8217;m not just filling 5% of my development time, I&amp;#8217;ve freed up 95% to conquer other aspects of coding, such as Behavior Driven Development, requirements analysis, and web design.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;RoR is like cheating.&lt;/strong&gt; It&amp;#8217;s like connecting dots. When done right it&amp;#8217;s the perfect zen-like hum between both halves of your brain. Yes; it&amp;#8217;s that good.&lt;/p&gt;</description>
      <pubDate>Fri, 11 Jan 2008 18:09:42 -0500</pubDate>
      <guid>/posts/663-what-does-ruby-on-rails-feel-like</guid>
    </item>
    <item>
      <title>2008</title>
      <author>Matt Darby</author>
      <link>/posts/662-2008</link>
      <description>&lt;p&gt;Imagine there&amp;#8217;s no Heaven &lt;br /&gt;
It&amp;#8217;s easy if you try &lt;br /&gt;
No hell below us &lt;br /&gt;
Above us only sky &lt;br /&gt;
Imagine all the people &lt;br /&gt;
Living for today&lt;/p&gt;
&lt;p&gt;Imagine there&amp;#8217;s no countries &lt;br /&gt;
It isn&amp;#8217;t hard to do &lt;br /&gt;
Nothing to kill or die for &lt;br /&gt;
And no religion too &lt;br /&gt;
Imagine all the people &lt;br /&gt;
Living life in peace&lt;/p&gt;
&lt;p&gt;You may say I&amp;#8217;m a dreamer &lt;br /&gt;
But I&amp;#8217;m not the only one &lt;br /&gt;
[Imagine lyrics on http://www.metrolyrics.com]&lt;/p&gt;
&lt;p&gt;I hope someday you&amp;#8217;ll join us &lt;br /&gt;
And the world will be as one&lt;/p&gt;
&lt;p&gt;Imagine no possessions &lt;br /&gt;
I wonder if you can &lt;br /&gt;
No need for greed or hunger&lt;br /&gt;
A brotherhood of man &lt;br /&gt;
Imagine all the people &lt;br /&gt;
Sharing all the world&lt;/p&gt;
&lt;p&gt;You may say I&amp;#8217;m &lt;br /&gt;
a dreamer &lt;br /&gt;
But I&amp;#8217;m not the only one &lt;br /&gt;
I hope someday you&amp;#8217;ll join us&lt;br /&gt;
And the world will live as one&lt;/p&gt;</description>
      <pubDate>Mon, 31 Dec 2007 20:51:59 -0500</pubDate>
      <guid>/posts/662-2008</guid>
    </item>
    <item>
      <title>Ruby MySQL Bindings on Leopard</title>
      <author>Matt Darby</author>
      <link>/posts/661-ruby-mysql-bindings-on-leopard</link>
      <description>&lt;p&gt;After a month of searching, I finally found a method to install Ruby MySQL bindings on Leopard!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
ARCHFLAGS="-arch i386"
ruby extconf.rb --with-mysql-dir=/usr/local/mysql
make
sudo make install
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Taken from: &lt;a href="http://trac.macosforge.org/projects/ruby/wiki/Troubleshooting"&gt;Macosforge.org&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 26 Dec 2007 03:56:52 -0500</pubDate>
      <guid>/posts/661-ruby-mysql-bindings-on-leopard</guid>
    </item>
    <item>
      <title>Old School Mushroomhead</title>
      <author>Matt Darby</author>
      <link>/posts/660-old-school-mushroomhead</link>
      <description>&lt;p&gt;&lt;strong&gt;Mushroomhead &amp;#8211; 2nd Thoughts (Live)&lt;/strong&gt;&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://youtube.com/v/jzb6iabfv8A"&gt;&lt;/param&gt;&lt;embed src="http://youtube.com/v/jzb6iabfv8A" type="application/x-shockwave-flash" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;This was basically my life from 1997 until 2000. Every weekend in this pit. I miss those days sometimes&#8230;&lt;/p&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 20 Dec 2007 09:56:38 -0500</pubDate>
      <guid>/posts/660-old-school-mushroomhead</guid>
    </item>
    <item>
      <title>Burned</title>
      <author>Matt Darby</author>
      <link>/posts/659-burned</link>
      <description>&lt;p&gt;I just returned from Vegas last week. Why do I think I already need another vacation? Oh yeah, developing two projects in Ruby on Rails simulaneously as well as overseeing an IT department. Well, that and the 81 hours last week. Or the fact that there are no bonuses this year. Perhaps it&amp;#8217;s that my assistant called off today? Ah, it&amp;#8217;s because our Sharp &lt;span class="caps"&gt;MFC&lt;/span&gt; is officially dead and the repairman who nearly lives here ran out the door when I wasn&amp;#8217;t looking. I bet it&amp;#8217;s the Sharp&amp;#8217;s lease rep that won&amp;#8217;t return my calls. Perhaps. Oh I know. It&amp;#8217;s definitely the fact that our backup fax machine is out of toner as well. Wait. Wait. No, it&amp;#8217;s definitely the fact that I&amp;#8217;m not &amp;#8216;technically&amp;#8217; IT anymore, but questions and requests still come in at the same rate as when I was, but now they&amp;#8217;re prefaced with &amp;#8220;I know you&amp;#8217;re not IT anymore, but&#8230;&amp;#8221;. Nope. It&amp;#8217;s most likely our main plotter locking up every third print.&lt;/p&gt;
&lt;p&gt;People wonder why I drink.&lt;/p&gt;</description>
      <pubDate>Tue, 18 Dec 2007 10:59:11 -0500</pubDate>
      <guid>/posts/659-burned</guid>
    </item>
    <item>
      <title>CakePHP vs. Rails</title>
      <author>Matt Darby</author>
      <link>/posts/657-cakephp-vs-rails</link>
      <description>&lt;p&gt;Now that grad school is over with, I&amp;#8217;ve already felt the need to find a new challenge to tackle. As you might guess, I get bored very quickly. I&amp;#8217;ve chosen to learn Ruby and Rails. I&amp;#8217;ve attempted to tackle this challenge in the past but I&amp;#8217;ve always ended up frustrated enough to quit. To celebrate the release of Rails 2.0, I figured I would try once again.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;ve been working with Ruby and Rails 2.0 for the last two days, and I am already a convert. I&amp;#8217;ve ported the existing development of my company&amp;#8217;s Intranet application from &lt;span class="caps"&gt;PHP&lt;/span&gt; / CakePHP to Ruby / Rails in less than one day. That one day was the first day I worked with RoR, if that tells you anything.&lt;/p&gt;
&lt;p&gt;There is currently a holy war surrounding &lt;span class="caps"&gt;PHP&lt;/span&gt; / CakePHP and Ruby on Rails. Having used &lt;span class="caps"&gt;PHP&lt;/span&gt; for eight years and CakePHP for one year I was basically in a mental bind. &lt;span class="caps"&gt;PHP&lt;/span&gt; is great and definitely does the job at hand, but at times it shows its hacked-together nature. One of the main differences between &lt;span class="caps"&gt;PHP&lt;/span&gt; and Ruby is that Ruby is truly an object oriented programming language while &lt;span class="caps"&gt;PHP&lt;/span&gt; is a scripting language. What does this mean? Basically, Ruby handles dealing with logical code elements in a much more refined, repeatable, and logical way.&lt;/p&gt;
&lt;p&gt;For example, in CakePHP, an Object (say &amp;#8216;User&amp;#8217;) only lasts as long as it takes for the framework to conjure it from the database. From then on, you&amp;#8217;re dealing with an elaborate array of specific information:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
// Load User from the database
$user = $this-&amp;gt;User-&amp;gt;findById(121);
 
// Set User's last login time
$user['User']['last_login'] = date('Y-m-d g:i:s');
 
// Save User back to the database
$this-&amp;gt;User-&amp;gt;save($user);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In contrast, doing the same operation in RoR on a Ruby Object looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
User.update(121, {:last_login =&amp;gt; Time.now})
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Which language looks more friendly and logical to you? Exactly.&lt;/p&gt;
&lt;p&gt;CakePHP is a godsend to the &lt;span class="caps"&gt;PHP&lt;/span&gt; community, and anyone stuck on/with &lt;span class="caps"&gt;PHP&lt;/span&gt; should be using it for every single project they work on. It&amp;#8217;s a miracle. That being said, it is a poor clone of Rails in many ways.&lt;/p&gt;
&lt;p&gt;Most of CakePHP&amp;#8217;s shortcomings are due to &lt;span class="caps"&gt;PHP&lt;/span&gt; itself. &lt;span class="caps"&gt;PHP&lt;/span&gt; is not object oriented, so the CakePHP developers are coding with their hands tied from the start. Another major detraction from the framework is the severe lack of documentation. CakePHP 1.1 (the recommended stable version) does have a fair amount of documentation and an &lt;span class="caps"&gt;API&lt;/span&gt; available, but the latest and greatest version 1.2 does not have any official &amp;#8216;manual&amp;#8217;.&lt;/p&gt;
&lt;p&gt;To be fair, most of 1.1&amp;#8217;s documentation can be extrapolated to 1.2; however the features that make 1.2 desirable are scarcely documented. Developers close to the project post blogs that are helpful but this is far from a ideal situation. And yes, I do understand that 1.2 is in heavy development. This point is also won by RoR for its &lt;strong&gt;wonderful&lt;/strong&gt; built-in documentation system that makes generating documentation effortless.&lt;/p&gt;
&lt;p&gt;RoR is more mature feeling with a robust set of tools and documentation. Ruby itself is amazingly powerful and has a huge plugin library available. Rails has built-in support for the Prototype and script.aculo.us libraries so designing towards &amp;#8216;Web 2.0&amp;#8217; standards is a cinch. After failing many times to do anything meaningful with Ajax in CakePHP I have already created a &lt;span class="caps"&gt;CRUD&lt;/span&gt; UI for an important Object in my Intranet application. Keep in mind, again, that I started with RoR yesterday and more specifically with Ajax this morning.&lt;/p&gt;
&lt;p&gt;There are many more points in which RoR beats Cake/&lt;span class="caps"&gt;PHP&lt;/span&gt;; a few that spring to my mind:&lt;br /&gt;
1. Unit testing is built-in (no external libraries are needed)&lt;br /&gt;
2. Creating a new application is as easy as running &amp;#8216;rails project_name&amp;#8217;&lt;br /&gt;
3. Built-in web server&lt;br /&gt;
4. Much more robust debugging and query tracing (great for finding bottlenecks!)&lt;br /&gt;
5. Plugin installation is a breeze&lt;/p&gt;
&lt;p&gt;The bottom line? If you&amp;#8217;re stuck with &lt;span class="caps"&gt;PHP&lt;/span&gt; for you projects, use CakePHP. It&amp;#8217;s a miracle for &lt;span class="caps"&gt;PHP&lt;/span&gt;. If you are not stuck with &lt;span class="caps"&gt;PHP&lt;/span&gt;, give Ruby on Rails a whirl. It makes coding fun again and you&amp;#8217;ll be amazed on how quickly you&amp;#8217;ll pick it up. I&amp;#8217;ll be using it for all of my upcoming projects.&lt;/p&gt;</description>
      <pubDate>Fri, 14 Dec 2007 06:18:39 -0500</pubDate>
      <guid>/posts/657-cakephp-vs-rails</guid>
    </item>
    <item>
      <title>Rails 2.0</title>
      <author>Matt Darby</author>
      <link>/posts/656-rails-2-0</link>
      <description>&lt;p&gt;I think I&amp;#8217;m in love. I will remember 2007 as the year that I dumped Windows and &lt;span class="caps"&gt;PHP&lt;/span&gt; and set myself free. I tend to ignore fanboys, but switching to Mac and Ruby on Rails has made my job exponentially easier and my day much brighter. I&amp;#8217;m blissed out.&lt;/p&gt;</description>
      <pubDate>Thu, 13 Dec 2007 12:46:20 -0500</pubDate>
      <guid>/posts/656-rails-2-0</guid>
    </item>
    <item>
      <title>Vegas #2</title>
      <author>Matt Darby</author>
      <link>/posts/655-vegas-2</link>
      <description>&lt;p&gt;Going down to the lobby area of the Golden Nugget for a late night (11pm) snack. First in-house restuarant only does take out if you sit down and wait. Tables were at least ten minutes. Fuck that. We go to one of the main bars and wait to order something. Some drunk cunt spills an entire beer all over my wife. All apologies don&amp;#8217;t pay dry cleaning. So we go back upstairs upset. I&amp;#8217;m so fucking ready to leave this shit-fuck hole of a town in my dust. I want to puke all over this place. I&amp;#8217;m really pissed.&lt;/p&gt;</description>
      <pubDate>Wed, 05 Dec 2007 21:58:18 -0500</pubDate>
      <guid>/posts/655-vegas-2</guid>
    </item>
    <item>
      <title>Las Vegas!</title>
      <author>Matt Darby</author>
      <link>/posts/654-las-vegas</link>
      <description>&lt;p&gt;Well, I&amp;#8217;ve been in Vegas since Monday, and well, it&amp;#8217;s definitely a town I could only take for a couple days. We stayed at the Golden Nugget in the Downtown (Old Vegas) area. We hit the strip last night, but there was so many damned people that it&amp;#8217;s really not too much fun. The fountain show at the Bellagio was pretty damned impressive, as was the Eiffel Tower Experience at Paris. Otherwise? Eh. Too many people. I felt more like a cow at a cattle corral. Too many Mexicans trying to hand me pr0n leaflets. Not that I disapprove, but hey, enough is enough.&lt;/p&gt;
&lt;p&gt;The Freemont Experience is actually pretty neat and felt safe. There were a ton of security and police every time I walked through the main drag. Once you get off the main strip you&amp;#8217;re pretty much on your own; it gets seedy quick, but that could be interesting in its own right.&lt;/p&gt;
&lt;p&gt;The missus hit a nice $400 jackpot the first night on a Monopoly $0.25 machine and I basically drained that back into the Vegas machine. Gotta keep the lights on somehow.&lt;/p&gt;
&lt;p&gt;Fun? Vegas is interesting. It&amp;#8217;s too much for me in some respects; too little in others. The pure sensory overload of people and lights is overwhelming in areas, but the fact that once you see one casino, you&amp;#8217;ve seen them all definitely comes into play. Would I come again? Probably not. It&amp;#8217;s been fun, but once is enough. The next trip is Europe!&lt;/p&gt;</description>
      <pubDate>Wed, 05 Dec 2007 21:34:16 -0500</pubDate>
      <guid>/posts/654-las-vegas</guid>
    </item>
    <item>
      <title>It's Official!</title>
      <author>Matt Darby</author>
      <link>/posts/653-it-s-official</link>
      <description>&lt;p&gt;Grades are in and I&amp;#8217;ve &lt;span class="caps"&gt;PASSED&lt;/span&gt;! I now have a fucking MASTER&amp;#8217;S &lt;span class="caps"&gt;DEGREE&lt;/span&gt;. How insane. Actually only one class&amp;#8217;s grade has been reported, but failure is a statistical impossibility in my other class, so it&amp;#8217;s party time. The missus and I are hitting &lt;span class="caps"&gt;VEGAS&lt;/span&gt; next week and are prepared to hit the town.&lt;/p&gt;
&lt;p&gt;Good times ahead!!! (knock on wood)&lt;/p&gt;</description>
      <pubDate>Wed, 28 Nov 2007 10:53:34 -0500</pubDate>
      <guid>/posts/653-it-s-official</guid>
    </item>
    <item>
      <title>All In The Family</title>
      <author>Matt Darby</author>
      <link>/posts/652-all-in-the-family</link>
      <description>&lt;p&gt;Aside from All In the Family being the funniest show ever on television, it also has to be the most saddening. The episode where Mike and Gloria move to California is the saddest damned thing I&amp;#8217;ve ever seen. Why can&amp;#8217;t television be this good anymore? Le Sigh.&lt;/p&gt;</description>
      <pubDate>Tue, 27 Nov 2007 13:22:38 -0500</pubDate>
      <guid>/posts/652-all-in-the-family</guid>
    </item>
    <item>
      <title>LAST CLASS!</title>
      <author>Matt Darby</author>
      <link>/posts/651-last-class</link>
      <description>&lt;p&gt;&lt;img src="/files/61/original/last-class.png" alt="" /&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 26 Nov 2007 11:26:50 -0500</pubDate>
      <guid>/posts/651-last-class</guid>
    </item>
    <item>
      <title>Almost.</title>
      <author>Matt Darby</author>
      <link>/posts/650-almost</link>
      <description>&lt;p&gt;One class left until the end of grad school. I don&amp;#8217;t think it&amp;#8217;s really hit me yet, and it probably won&amp;#8217;t until graduation. I did realize today that when I walk out of my last class, it will very likely be the last time I&amp;#8217;m ever in the halls of Franklin University. That realization is always bittersweet for me. I have pictures of a random area of all the schools I&amp;#8217;ve attended since junior high. I guess I&amp;#8217;m rather nostalgic in many ways. I cannot wait to be done and to finally accomplish something that I never thought imaginable for most of my life, but it&amp;#8217;s also sad to know that this era of my life is over. I&amp;#8217;ve met many great people; professors and students alike, I hope to see them in industry again someday.&lt;/p&gt;
&lt;p&gt;Five days until it&amp;#8217;s over. 45 until graduation and a new paper hangs above my desk.&lt;/p&gt;</description>
      <pubDate>Wed, 21 Nov 2007 18:00:25 -0500</pubDate>
      <guid>/posts/650-almost</guid>
    </item>
    <item>
      <title>Pure Awesome.</title>
      <author>Matt Darby</author>
      <link>/posts/632-pure-awesome</link>
      <description>&lt;p&gt;&lt;img src="/files/62/original/sweet-futuramas-on.jpg" alt="" /&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 13 Nov 2007 16:12:53 -0500</pubDate>
      <guid>/posts/632-pure-awesome</guid>
    </item>
    <item>
      <title>Internet Explorer can eat my balls</title>
      <author>Matt Darby</author>
      <link>/posts/631-internet-explorer-can-eat-my-balls</link>
      <description>&lt;p&gt;I&amp;#8217;ve spent the entire week coding away on a script that will allow mulitple file uploads via some &lt;span class="caps"&gt;AJAX&lt;/span&gt; and Flash. The script works beautifully in Safari and Firefox. I fire up IE6/7 and the whole fucking thing goes down in flames. How expected. The funny part? The error message that is spits out is &amp;quot;Unspecified Error, Line &amp;quot;. I quit. If the whole world just used an advanced modern browser we&amp;#8217;d all be in a better place.&lt;/p&gt;</description>
      <pubDate>Thu, 08 Nov 2007 11:08:27 -0500</pubDate>
      <guid>/posts/631-internet-explorer-can-eat-my-balls</guid>
    </item>
    <item>
      <title>Research Paper</title>
      <author>Matt Darby</author>
      <link>/posts/649-research-paper</link>
      <description>&lt;p&gt;&lt;img src="/files/63/original/desk.jpg" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;It might not look messy to some, but I normally have nothing but hardware on my desk. Did I mention I have three weeks left?&lt;/p&gt;</description>
      <pubDate>Sat, 03 Nov 2007 15:39:44 -0400</pubDate>
      <guid>/posts/649-research-paper</guid>
    </item>
    <item>
      <title>The Crunch Is On</title>
      <author>Matt Darby</author>
      <link>/posts/648-the-crunch-is-on</link>
      <description>&lt;p&gt;Three weeks until the end of graduate school.&lt;/p&gt;
&lt;p&gt;Three weeks.&lt;/p&gt;
&lt;p&gt;Three weeks to complete my research paper on cross site scripting, the k-nn algorithm and the Markov Model.&lt;/p&gt;
&lt;p&gt;Three weeks to start and finish a distributed Java project with my teammates.&lt;/p&gt;
&lt;p&gt;Three weeks to figure out just what the hell the Professor means in the distributed system assignment writeup.&lt;/p&gt;
&lt;p&gt;Three weeks until all of the hurdles and hoops are behind me.&lt;/p&gt;
&lt;p&gt;Three weeks until that paper is mine.&lt;/p&gt;</description>
      <pubDate>Fri, 02 Nov 2007 11:35:32 -0400</pubDate>
      <guid>/posts/648-the-crunch-is-on</guid>
    </item>
    <item>
      <title>War on Terrorism</title>
      <author>Matt Darby</author>
      <link>/posts/647-war-on-terrorism</link>
      <description>&lt;p&gt;&lt;i&gt;&amp;#8220;The tools of conquest do not necessarily come with bombs and explosions and fallout. There are weapons that are simply thoughts, attitudes, prejudices, to be found only in the minds of men. For the record: prejudices can kill, and suspicion can destroy, and the thoughtless, frightened search for a scapegoat has a fallout all of its own, for the children and the children yet unborn. And the pity of it is that such things cannot be confined&#8230; to The Twilight Zone.&amp;#8221;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;How is it that The Twilight Zone and South Park can fully tell that the&#160;Emperor&#160;wears no clothes, but the (voting) majority cannot?&lt;/p&gt;</description>
      <pubDate>Thu, 01 Nov 2007 15:55:25 -0400</pubDate>
      <guid>/posts/647-war-on-terrorism</guid>
    </item>
    <item>
      <title>Mr. Belvedere</title>
      <author>Matt Darby</author>
      <link>/posts/646-mr-belvedere</link>
      <description>&lt;p&gt;&lt;object width="425" height="350"&gt;&lt;param name="movie" value="http://youtube.com/v/MiGzqQmWFMo"&gt;&lt;/param&gt;&lt;embed src="http://youtube.com/v/MiGzqQmWFMo" type="application/x-shockwave-flash" width="425" height="350"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/p&gt;
&lt;p&gt;This is the greatest thing ever.&lt;/p&gt;</description>
      <pubDate>Mon, 29 Oct 2007 19:06:13 -0400</pubDate>
      <guid>/posts/646-mr-belvedere</guid>
    </item>
    <item>
      <title>Apple digs Microsoft in Leopard Booklet</title>
      <author>Matt Darby</author>
      <link>/posts/645-apple-digs-microsoft-in-leopard-booklet</link>
      <description>&lt;p&gt;Anyone notice that Leopard&amp;#8217;s instruction booklet image of BootCamp shows Windows XP, not Vista? Nice subtle dig Apple!&lt;/p&gt;</description>
      <pubDate>Sat, 27 Oct 2007 07:49:48 -0400</pubDate>
      <guid>/posts/645-apple-digs-microsoft-in-leopard-booklet</guid>
    </item>
    <item>
      <title>Hello from Leopard!</title>
      <author>Matt Darby</author>
      <link>/posts/643-hello-from-leopard</link>
      <description>&lt;p&gt;I &lt;strong&gt;love&lt;/strong&gt; FedEx. I&amp;#8217;m three hours ahead of the game! Leopard is already installed and all is very smooth. First impressions?&lt;/p&gt;
&lt;p&gt;1. I dig the new dock; of course I hide mine anyway&lt;/p&gt;
&lt;p&gt;2. Coverflow on the documents is kind of neat, but not as cool as they make it out to be. If you&amp;#8217;re browsing a billion images it is pretty great&lt;/p&gt;
&lt;p&gt;3. I like Finder&amp;#8217;s new sidebar layout, and really like that all of my servers are just a click away (no more Command + K!)&lt;/p&gt;
&lt;p&gt;4. I really want to use Time Machine, but it &lt;strong&gt;really&lt;/strong&gt; sucks that you cannot backup to a &lt;span class="caps"&gt;SMB&lt;/span&gt; share on the network. A let down in my opinion&lt;/p&gt;
&lt;p&gt;5. The translucent menubar is a really weird &amp;#8216;feature&amp;#8217;, and one that I&amp;#8217;m already attempting to turn off. The transparancy just doesn&amp;#8217;t fit.&lt;/p&gt;
&lt;p&gt;6. The new iCal layout is slightly nicer; the sidebar update is slick&lt;/p&gt;
&lt;p&gt;7. Mail finally grouped my multiple &lt;span class="caps"&gt;IMAP&lt;/span&gt; account folders into separate menus!&lt;/p&gt;
&lt;p&gt;8. I&amp;#8217;m not sure how much usage I&amp;#8217;ll get out of the notes feature in Mail.&lt;/p&gt;
&lt;p&gt;9. The Stacks feature on the Dock is kind of odd. The idea only works well for folders that have a ton of files.&lt;/p&gt;
&lt;p&gt;10. Is it just me, or am I weird for prefering a web-based &lt;span class="caps"&gt;RSS&lt;/span&gt; reader (Google Reader)? I&amp;#8217;ll import my &lt;span class="caps"&gt;OPML&lt;/span&gt; feed into Mail for testing though.&lt;/p&gt;
&lt;p&gt;The packaging is simple, elegant, and gorgeous of course! On a side note, when I answered the door for the delivery, the FedEx guy looked at me and smiled at the package, winked, and said &amp;#8216;Have fun this weekend!&amp;#8217;. We are everywhere.&lt;/p&gt;</description>
      <pubDate>Fri, 26 Oct 2007 10:39:42 -0400</pubDate>
      <guid>/posts/643-hello-from-leopard</guid>
    </item>
    <item>
      <title>My Wife</title>
      <author>Matt Darby</author>
      <link>/posts/642-my-wife</link>
      <description>&lt;p&gt;My wife just informed me that she wants a pig for her birthday. Nothing like a weeks notice.&lt;/p&gt;</description>
      <pubDate>Fri, 19 Oct 2007 19:36:06 -0400</pubDate>
      <guid>/posts/642-my-wife</guid>
    </item>
    <item>
      <title>Sorting a Multidimensional Array The Easy Way.</title>
      <author>Matt Darby</author>
      <link>/posts/625-sorting-a-multidimensional-array-the-easy-way</link>
      <description>&lt;p&gt;Here is a quick and easy function written in &lt;span class="caps"&gt;PHP&lt;/span&gt; that will allow you to sort a multidimensional array.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
function orderBy(&amp;amp;$data, $field, $direction){
  //Provide the anonymous recursive functionality
  $code = "return strnatcmp(\$a['$field'], \$b['$field']);";
 
  //Figure out which way to sort the comparision function parameters
  $whichWay = (strtoupper($direction) == "ASC") ? '$a,$b' : '$b,$a';
 
  //Recursively call the anonymous function
  usort($data, create_function($whichWay, $code));
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This function assumes that your array looks something like the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
$arr = array();
 
$arr[0] = array(
		"First Element"  =&amp;gt; 1,
		"Second Element" =&amp;gt; 2,
		"Third Element"  =&amp;gt; 3
	);
	
$arr[1] = array(
		"First Element"  =&amp;gt; 4,
		"Second Element" =&amp;gt; 5,
		"Third Element"  =&amp;gt; 6
	);
 
$arr[2] = array(
		"First Element"  =&amp;gt; 7,
		"Second Element" =&amp;gt; 8,
		"Third Element"  =&amp;gt; 9
	);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With this we can easily sort by the array key name:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
orderBy($arr, 'Second Element', 'DESC');
 
// Output:
Array
(
    [0] =&amp;gt; Array
        (
            [First Element] =&amp;gt; 7
            [Second Element] =&amp;gt; 8
            [Third Element] =&amp;gt; 9
        )
 
    [1] =&amp;gt; Array
        (
            [First Element] =&amp;gt; 4
            [Second Element] =&amp;gt; 5
            [Third Element] =&amp;gt; 6
        )
 
    [2] =&amp;gt; Array
        (
            [First Element] =&amp;gt; 1
            [Second Element] =&amp;gt; 2
            [Third Element] =&amp;gt; 3
        )
 
)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see, the &lt;code&gt;$arr&lt;/code&gt; array has been sorted by the &amp;#8216;Second Element&amp;#8217; key in descending order. Quick and easy.&lt;/p&gt;</description>
      <pubDate>Tue, 16 Oct 2007 06:20:35 -0400</pubDate>
      <guid>/posts/625-sorting-a-multidimensional-array-the-easy-way</guid>
    </item>
    <item>
      <title>Boredom.</title>
      <author>Matt Darby</author>
      <link>/posts/610-boredom</link>
      <description>&lt;p&gt;Man, I can barely make it through classes anymore; I don&amp;#8217;t know how it did it before I had a laptop. Shit is sincerely boring. I guess that&amp;#8217;s what I get for teaching myself this shit years ago. Jumping through hoops for The Paper. Five weeks left and slowly counting.&lt;/p&gt;</description>
      <pubDate>Mon, 15 Oct 2007 14:47:22 -0400</pubDate>
      <guid>/posts/610-boredom</guid>
    </item>
    <item>
      <title>Fuck Typo.</title>
      <author>Matt Darby</author>
      <link>/posts/612-fuck-typo</link>
      <description>&lt;p&gt;I flirted with Ruby on Rails for a bit. I&amp;#8217;ve learned my lesson. Back to good &amp;#8217;ole &lt;span class="caps"&gt;PHP&lt;/span&gt; :)&lt;/p&gt;</description>
      <pubDate>Mon, 15 Oct 2007 09:44:37 -0400</pubDate>
      <guid>/posts/612-fuck-typo</guid>
    </item>
    <item>
      <title>Finally.</title>
      <author>Matt Darby</author>
      <link>/posts/641-finally</link>
      <description>&lt;p&gt;I broke down and bought an XBox 360 yesterday. Since I&amp;#8217;ve turned into a Mac guy, the gaming thing is really no longer viable on my computer, so I grabbed a console. This is the first console I&amp;#8217;ve owned since the original Playstation. Before that? Super Nintendo. I guess I&amp;#8217;m not much of a gamer, though I do need a distraction from work sometimes.&lt;/p&gt;
&lt;p&gt;I went to Target and bought Guitar Hero II. The &lt;strong&gt;second&lt;/strong&gt; after the cashier rings the transaction, he mentioned to me that Guitar Hero &lt;span class="caps"&gt;III&lt;/span&gt; was coming out in two weeks. So a quck run to Customer Service later and I&amp;#8217;m now waiting for &lt;span class="caps"&gt;GHIII&lt;/span&gt; :)&lt;/p&gt;
&lt;p&gt;My wife was cautious of the console at first. She&amp;#8217;s definitely an 8 bit girl, but a few tries at Tiger Woods Golf &amp;#8216;07 and now I can&amp;#8217;t get the controller out of her hand. She&amp;#8217;s yelling at the TV right now. &amp;#8220;I should get extra points for beating him so soundly&amp;#8221;. Ah, her next shot is in the drink. Perhaps I should buy her her own controller ;)&lt;/p&gt;</description>
      <pubDate>Sun, 14 Oct 2007 13:15:23 -0400</pubDate>
      <guid>/posts/641-finally</guid>
    </item>
    <item>
      <title>Same as it always was</title>
      <author>Matt Darby</author>
      <link>/posts/640-same-as-it-always-was</link>
      <description>&lt;p&gt;Once again, I setup a new blog and post at least once a day until I get bored with the new blog. Then I dont post for an increasing number of days, then weeks&#8230;&lt;div&gt;I&amp;#39;m now nearly half way through my final term of my Master&amp;#39;s program. It&amp;#39;s really boring. One thing I&amp;#39;ve really learned during my tenure at Franklin University is that I&amp;#39;m just not an academic person. Jumping through artificial hoops to create a project that ignores 90% of real world issues is not satisfying to me. I tend to work way ahead of my classmates so I&amp;#39;m just sitting around most of the time. One other thing I&amp;#39;ve learned about myself is that no matter what I&amp;#39;m doing, I&amp;#39;m always thinking about something else. I could be coding indoors, and wish that I was outside running around. I get outside, realize that this too, sucks, then I head back indoors. Even when I&amp;#39;m at concerts, I feel like the CS dork, but when I&amp;#39;m in a classroom, I feel like the metalhead.&lt;/div&gt;&lt;/p&gt;
&lt;div&gt;Anyway, my academic career will most likely be over in seven weeks. At this point I doubt I&amp;#39;ll go for my Doctorate. Of course, I&amp;#39;m pretty disillusioned with the whole academic world at the moment, so who knows ;)&lt;/div&gt;</description>
      <pubDate>Wed, 03 Oct 2007 13:15:04 -0400</pubDate>
      <guid>/posts/640-same-as-it-always-was</guid>
    </item>
    <item>
      <title>Motorhead</title>
      <author>Matt Darby</author>
      <link>/posts/639-motorhead</link>
      <description>&lt;p&gt;I swear to God. I would do so many, SO &lt;span class="caps"&gt;MANY&lt;/span&gt;, illegal, horrible things to meet Lemmy.&lt;/p&gt;</description>
      <pubDate>Wed, 26 Sep 2007 13:14:42 -0400</pubDate>
      <guid>/posts/639-motorhead</guid>
    </item>
    <item>
      <title>Off and running!</title>
      <author>Matt Darby</author>
      <link>/posts/638-off-and-running</link>
      <description>&lt;p&gt;I officially launched &amp;#8216;The Application&amp;#8217; at the office on Thursday. The upper management of my firm and myself met with our first outside clients; many of whom happen to be in the military. When I found this out, I was really concerned that they wouldn&amp;#8217;t find the security of &amp;#8216;The Application&amp;#8217; to be up to their standards. After talking over a few security concerns though, they easily agreed that my system would suit their needs just fine.&lt;/p&gt;
&lt;p&gt;I&amp;#8217;m really confident in my work, and I&amp;#8217;m glad that I was able to convince them of the same. We now have mulitiple projects with them! User accounts were created successfully, the email system worked just fine and information is starting to flow.&lt;/p&gt;
&lt;p&gt;I almost feel like a parent who watches their child climb aboard the school bus for the first time. It&amp;#8217;s really neat to watch something you created and coddled start off on its own. Of course, I&amp;#8217;ll probably be supporting it for the next eighteen years too ;)&lt;/p&gt;</description>
      <pubDate>Sat, 22 Sep 2007 13:14:06 -0400</pubDate>
      <guid>/posts/638-off-and-running</guid>
    </item>
    <item>
      <title>Airport Not-So-Extreme</title>
      <author>Matt Darby</author>
      <link>/posts/637-airport-not-so-extreme</link>
      <description>&lt;p&gt;Ugh. I don&amp;#39;t know why my luck with Wireless N routers is so bad, but man, it is. My latest let down is Apple&amp;#39;s Airport Extreme (Gigabit version). The setup was clean and slick as one would expect from Apple, but after many hours of configuring, reconfiguring, resetting, rebooting, and googling, I was getting pissed. It seems as though the &lt;span class="caps"&gt;AEBS&lt;/span&gt; cannot and will not forward &lt;span class="caps"&gt;UDP&lt;/span&gt; packets (most notably of which, &lt;span class="caps"&gt;DNS&lt;/span&gt; (Port 53 &lt;span class="caps"&gt;UDP&lt;/span&gt;) packets). While this is not a problem for 99.8% of the world, those of us that run our own internal &lt;span class="caps"&gt;DNS&lt;/span&gt; server are fucked.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been a professional IT / Network / Programmer guy for a number of years and no matter what I tried, this thing was not budging. Most home networks use their &lt;span class="caps"&gt;ISP&lt;/span&gt;&amp;#39;s &lt;span class="caps"&gt;DNS&lt;/span&gt; servers, but I have an internal &lt;span class="caps"&gt;DNS&lt;/span&gt; server that I need to use in order to use my home-hosted domains. So if you need to port forward &lt;strong&gt;any&lt;/strong&gt; &lt;span class="caps"&gt;UDP&lt;/span&gt; ports from your router to a local computer, the Airport Extreme is not the router for you.&lt;div&gt;That being said, I finally gave up and am now using the &lt;span class="caps"&gt;AEBS&lt;/span&gt; in bridge mode along with my old WRT54G serving as the front-line router, handling port forwarding. I&amp;#39;ll post more in the days to come to illustrate the outcome.&lt;/div&gt;&lt;/p&gt;</description>
      <pubDate>Tue, 18 Sep 2007 13:13:46 -0400</pubDate>
      <guid>/posts/637-airport-not-so-extreme</guid>
    </item>
    <item>
      <title>Yea for Mislabeled Price Tags!</title>
      <author>Matt Darby</author>
      <link>/posts/636-yea-for-mislabeled-price-tags</link>
      <description>&lt;p&gt;Sensing the need for a new toy, I figured it was time to update my old WRT54G to D-Link&amp;#39;s &lt;span class="caps"&gt;DIR&lt;/span&gt;-655. I head over to Best Buy and grab the router off of the shelf. On my way to checkout, I happen to walk by the Apple shelf and notice the Airport Extreme is only $160! The Airport Extreme is normally $200! I grabbed that shit and headed to the register. The router ringed up as $200 + tax. I mentioned that I swore the tag said $159.99, and the clerk walked back with me to make sure. After he went and talked to his manager, I got an Airport Express at 20% off!&lt;div&gt;By the way, the Airport Express setup was the most painless setup I&amp;#39;ve ever had for a router. Within five minutes, I had it up and running, configured, port forwarding, and print serving. Good, good stuff!&lt;/div&gt;&lt;/p&gt;</description>
      <pubDate>Sun, 16 Sep 2007 13:13:19 -0400</pubDate>
      <guid>/posts/636-yea-for-mislabeled-price-tags</guid>
    </item>
    <item>
      <title>Childlike Behavior.</title>
      <author>Matt Darby</author>
      <link>/posts/635-childlike-behavior</link>
      <description>&lt;p&gt;I had the extreme pleasure of sitting behind the person who delivered the opening keynote at php|works during another talk during the opening day. He has a pretty impressive list of accomplishments and projects, but the dude sat there with his buddy and made fun of the speaker during the entire talk. At one point they started talking out of turn, personally making fun of the speaker. I&amp;#39;m the proverbial class clown, but these guys were being dumb, and shitting on the their own bread and butter.&lt;div&gt;Blah, kind of disappointing.&lt;/div&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 13 Sep 2007 13:12:57 -0400</pubDate>
      <guid>/posts/635-childlike-behavior</guid>
    </item>
    <item>
      <title>Odd.</title>
      <author>Matt Darby</author>
      <link>/posts/634-odd</link>
      <description>&lt;p&gt;So half of the selections of &amp;#39;Adult Entertainment&amp;#39; at the Sheraton Gateway Atlanta are of the young men / older women variety. I wonder who programs these channels? Kind of funny.&lt;/p&gt;</description>
      <pubDate>Wed, 12 Sep 2007 13:12:23 -0400</pubDate>
      <guid>/posts/634-odd</guid>
    </item>
    <item>
      <title>Off to Atlanta!</title>
      <author>Matt Darby</author>
      <link>/posts/633-off-to-atlanta</link>
      <description>&lt;p&gt;I&amp;#39;m about to head to the airport; I&amp;#39;m heading out to the php|works conference in Atlanta for the next couple days. Looking at some flickr photostreams from last year&amp;#39;s conference, it seems like it attracts a good crowd &amp;#8212; full of geeks and the ilk ;) I guess I might actually talk to random people, or I&amp;#39;ll end up having a few Corona&amp;#39;s back in my room as normal.&lt;div&gt;Anyway; off to &lt;span class="caps"&gt;ATL&lt;/span&gt;!&lt;/div&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 12 Sep 2007 13:12:05 -0400</pubDate>
      <guid>/posts/633-off-to-atlanta</guid>
    </item>
    <item>
      <title>What an odd feeling.</title>
      <author>Matt Darby</author>
      <link>/posts/630-what-an-odd-feeling</link>
      <description>&lt;p&gt;I have a beautiful wife, a nice new house, a job that pays very nicely that allows me to work from home with 100% reign over my work and gives me a free Treo 700wx, and I&#8217;m on track to earn my Master&#8217;s degree in three months.&lt;/p&gt;
&lt;p&gt;What&#8217;s the odd feeling?&lt;/p&gt;
&lt;p&gt;The feeling that life is passing me by, with a side dish of wasting my days. I have the achievements, but not the memories. My personality has always been to go nuts and focus on one thing at a time, and to focus on that thing until it is seen through, or learned absolutely. I think I need to now focus on life, instead of accomplishments &amp;#8212; at least for a while.&lt;/p&gt;
&lt;p&gt;Damn, I need a night out!&lt;/p&gt;</description>
      <pubDate>Fri, 07 Sep 2007 13:11:46 -0400</pubDate>
      <guid>/posts/630-what-an-odd-feeling</guid>
    </item>
    <item>
      <title>Capstone Class</title>
      <author>Matt Darby</author>
      <link>/posts/629-capstone-class</link>
      <description>&lt;p&gt;So the &lt;span class="caps"&gt;MSCS&lt;/span&gt; Capstone at Franklin underwent a change in the last term, from a traditional research project curriculum to more of a normal class. We are focusing on discussions on ethics and analyzing a research paper of our choosing. The final outcome is a few assignments and a short paper outlining our thoughts and criticism of the research paper we chose.&lt;/p&gt;
&lt;p&gt;A good number of students were upset that the capstone was changed. I&amp;#8217;ve had mixed feelings personally. On one hand, it&amp;#8217;s a hell of a lot easier than doing a traditional project, and part of the switch was that the capstone class&amp;#8217; length was halved. So, I get to graduate a full four months earlier than I initially expected. On the other hand, a capstone should be project based. It should be tough. You should have to jump though the hoops of finding and appeasing an advisor.&lt;/p&gt;
&lt;p&gt;On the surface, I should be very happy that the class now has a much lighter workload. One nagging thing is in the back of my head is that if I go for my Doctorate, that process will be that more difficult. It almost feels like when I graduated from DeVry with my Bachelor&amp;#8217;s degree. That curriculum was extremely light on mathematics; that was wonderful at the time, but set me up for a much more difficult time at Franklin.&lt;/p&gt;
&lt;p&gt;Ah hell, I&amp;#8217;m not sure I&amp;#8217;ll be going for my Doctorate at this point anyway. I&amp;#8217;m sure in a few years I&amp;#8217;ll be bored and figure why not, but at the moment, I&amp;#8217;ll get along just fine being away from academia.&lt;/p&gt;</description>
      <pubDate>Thu, 06 Sep 2007 13:11:26 -0400</pubDate>
      <guid>/posts/629-capstone-class</guid>
    </item>
    <item>
      <title>iWork 08</title>
      <author>Matt Darby</author>
      <link>/posts/628-iwork-08</link>
      <description>&lt;p&gt;Just bought a copy of iWork &amp;#39;08 which includes Pages, Keynote, and Numbers. It&amp;#39;s basically exactly what you would expect of a Mac office suite. Very clean, understated, and powerful. It doesn&amp;#39;t have all the bells and whistles of Office 2007, but no one uses 90% of that feature set anyway ;)&lt;div&gt;I start my last term of graduate school tomorrow, and my first class is my Capstone. Thanks to the long weekend, I get to have my Monday night class on Friday. At least the week numbers of my classes will be the same. MQ and I are parlaying the late class to a nightcap downtown. Good times.&lt;/div&gt;&lt;div&gt;Here&amp;#39;s to the final term!&lt;/div&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 03 Sep 2007 13:11:08 -0400</pubDate>
      <guid>/posts/628-iwork-08</guid>
    </item>
    <item>
      <title>Ugh.</title>
      <author>Matt Darby</author>
      <link>/posts/627-ugh</link>
      <description>&lt;p&gt;For the upcoming term I need to use a web app called the &amp;#39;Dropbox&amp;#39; at my University. Essentially it is a very easy app that accepts a file for upload, then associates it with an assingment number, and whether or not you&amp;#39;d like to have it graded. It doesn&amp;#39;t even allow downloading of any uploaded files.&lt;/p&gt;
&lt;p&gt;What am I complaining about? I can&amp;#39;t get the fucking thing to work. I used it last term when it was in &amp;#39;beta&amp;#39; just fine. So I contact the help desk and they tell me to use Windows, as Apple products are not supported. I wish I could ignore 15% of my target audience off the bat. It&amp;#39;s bullshit. The web exists on standards. When those standards are not followed, people are left in the dark. Normally, I laugh at their shitty code, but this time it&amp;#39;s I out in the dark and I cannot submit assignments to my fucking &lt;span class="caps"&gt;CAPSTONE&lt;/span&gt; &lt;span class="caps"&gt;CLASS&lt;/span&gt;. Of note, I did try Windows Vista and IE7. With even the lowest security settings, I couldn&amp;#39;t get the damned page to load, but did end up with seven browser windows.&lt;/p&gt;
&lt;p&gt;A simple upload app doesn&amp;#39;t care what browser/OS you&amp;#39;re using at all. It&amp;#39;s all standards based stuff. It&amp;#39;s five lines of code and a database table. Twenty minutes from conception to production. I write stuff like this everyday, I would only assume that my University would check this stuff before putting it into production.&lt;/p&gt;
&lt;p&gt;Frustration.&lt;/p&gt;</description>
      <pubDate>Wed, 29 Aug 2007 13:10:49 -0400</pubDate>
      <guid>/posts/627-ugh</guid>
    </item>
    <item>
      <title>Words of truth</title>
      <author>Matt Darby</author>
      <link>/posts/626-words-of-truth</link>
      <description>&lt;p&gt;&lt;em&gt;&amp;#8220;They lie about marijuana. Tell you pot-smoking makes you unmotivated.&#160;Lie! When you&amp;#8217;re high, you can do everything you normally do, just as&#160;well. You just realize that it&amp;#8217;s not worth the fucking effort. There is&#160;a difference&amp;#8221;&lt;/em&gt; &lt;strong&gt;&amp;mdash; Bill Hicks&lt;/strong&gt;&lt;/p&gt;</description>
      <pubDate>Wed, 29 Aug 2007 13:10:18 -0400</pubDate>
      <guid>/posts/626-words-of-truth</guid>
    </item>
    <item>
      <title>I'm Very Happy.</title>
      <author>Matt Darby</author>
      <link>/posts/624-i-m-very-happy</link>
      <description>&lt;p&gt;I just returned from submitting my graduation application for my Master&amp;#8217;s degree in Computer Science.&lt;/p&gt;
&lt;p&gt;Now if you don&amp;#8217;t know me in the physical world; I was never expected to finish High School. I failed four grades. I was suspended the grand majority of the time, and the other times I wasn&amp;#8217;t really paying attention if you know what I mean. For some reason, near my 18th birthday, I realized the error of my ways. I cleaned up, hit the books, went to trade school, high school, and worked second shift full time all at the same time for two years. Of the four years I failed, I graduated only two years behind, that&amp;#8217;s how much work I did.&lt;/p&gt;
&lt;p&gt;To think I will have my Master&amp;#8217;s degree is just insane. To think that the focus was on Theoretical Math as part of Computer Science is even more insane. The fact that the only time I&amp;#8217;ve &lt;em&gt;ever&lt;/em&gt; gotten straight A&amp;#8217;s was in Graduate School on a graduated scale.&lt;/p&gt;
&lt;p&gt;But do you know what the craziest part of it all is? &lt;em&gt;I&amp;#8217;m going to graduate with honors.&lt;/em&gt;&lt;br /&gt;
The smile in my mind is so big right now that it&amp;#8217;s kind of funny.&lt;/p&gt;</description>
      <pubDate>Mon, 27 Aug 2007 13:09:52 -0400</pubDate>
      <guid>/posts/624-i-m-very-happy</guid>
    </item>
    <item>
      <title>Software Release Cycle</title>
      <author>Matt Darby</author>
      <link>/posts/623-software-release-cycle</link>
      <description>&lt;p&gt;The large, awesome project that I&amp;#8217;m solely developing at my office was shown today to the upper management. They liked it so much that they want to start using it in-house on all projects, as well as market the project to all clients.&lt;/p&gt;</description>
      <pubDate>Fri, 24 Aug 2007 13:09:25 -0400</pubDate>
      <guid>/posts/623-software-release-cycle</guid>
    </item>
    <item>
      <title>svn report request failed 'no such revision'</title>
      <author>Matt Darby</author>
      <link>/posts/622-svn-report-request-failed-no-such-revision</link>
      <description>&lt;p&gt;What a night! For some reason Subversion decided to take a total shit on me. Well, one thing I did awhile back may have come back to bite me in the ass, but I&amp;#8217;m not sure why now. Basically when I ported my existing web application at work over to CakePHP, I was kind of liberal with the case of some filenames. After realizing my error, I &amp;#8216;svn mv&amp;#8217; those files, but that isn&amp;#8217;t the prefered method I reckon. Thank God I didn&amp;#8217;t lose anything life-threatening (just 85 revisions), so I just created a new repository and initial imported my existing code base into that.&lt;/p&gt;</description>
      <pubDate>Tue, 21 Aug 2007 13:09:03 -0400</pubDate>
      <guid>/posts/622-svn-report-request-failed-no-such-revision</guid>
    </item>
    <item>
      <title>God Damnit.</title>
      <author>Matt Darby</author>
      <link>/posts/621-god-damnit</link>
      <description>&lt;p&gt;Seems as though TextMate eats your blog posts if you attempt to re-publish a post. It seems to take the posting id of the previous post; each time publishing taking the id of the previous post to the current one.&lt;/p&gt;</description>
      <pubDate>Mon, 20 Aug 2007 13:08:35 -0400</pubDate>
      <guid>/posts/621-god-damnit</guid>
    </item>
    <item>
      <title>I think I might have something&#8230;</title>
      <author>Matt Darby</author>
      <link>/posts/617-i-think-i-might-have-something</link>
      <description>&lt;p&gt;So it seems as though I can do something like this in Ruby:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
def list  
  @objects = Hash.new  
  Object.find(:all).each { |r|  
    status = "Open"  
    @objects[r.id] = {
        "ID"            =&amp;gt; r.id,
        "Name"          =&amp;gt; r.name,
        "Author"        =&amp;gt; r.user.name,
        "Status"        =&amp;gt; status,
        "Date Created"  =&amp;gt; r.created,
        "Last Activity" =&amp;gt; r.modified
      }  
  }  
end
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;That kind of mimics what I&amp;#8217;m doing in CakePHP with multidimensional arrays.&lt;/p&gt;</description>
      <pubDate>Mon, 20 Aug 2007 13:07:33 -0400</pubDate>
      <guid>/posts/617-i-think-i-might-have-something</guid>
    </item>
    <item>
      <title>Missing Miners.</title>
      <author>Matt Darby</author>
      <link>/posts/620-missing-miners</link>
      <description>&lt;p&gt;They&amp;#8217;re dead. It sucks, but that&amp;#8217;s the risk of the occupation.&lt;/p&gt;
&lt;p&gt;Move forward.&lt;/p&gt;</description>
      <pubDate>Sun, 19 Aug 2007 13:08:17 -0400</pubDate>
      <guid>/posts/620-missing-miners</guid>
    </item>
    <item>
      <title>SuperBad</title>
      <author>Matt Darby</author>
      <link>/posts/619-superbad</link>
      <description>&lt;p&gt;Just got back from seeing SuperBad a while ago. I don&amp;#8217;t normally go to movies as I generally don&amp;#8217;t like people and am quite impatient, but I made an exception for this movie. Why? Perhaps it was due to Michael Cera being a lead character. I&amp;#8217;m a sucker for anyone with Arrested Development on their resume.&lt;/p&gt;</description>
      <pubDate>Sun, 19 Aug 2007 13:07:55 -0400</pubDate>
      <guid>/posts/619-superbad</guid>
    </item>
    <item>
      <title>Intervention</title>
      <author>Matt Darby</author>
      <link>/posts/616-intervention</link>
      <description>&lt;p&gt;Whoever wrote the music for A&amp;amp;E&amp;#8217;s show &lt;a href='http://www.aetv.com/intervention/' target=blank&gt;Intervention&lt;/a&gt; is amazing. Everytime I watch the intro to the show I realize that all of my muscles tense and my breathing speeds up. I&amp;#8217;m not usually susceptable to things like that, but damn!&lt;/p&gt;</description>
      <pubDate>Sun, 19 Aug 2007 13:07:10 -0400</pubDate>
      <guid>/posts/616-intervention</guid>
    </item>
    <item>
      <title>PHP Works '07 Conference</title>
      <author>Matt Darby</author>
      <link>/posts/615-php-works-07-conference</link>
      <description>&lt;p&gt;&lt;b&gt;The Powers That Be&lt;/b&gt; at my office are sending yours truly to the &lt;a href='http://works.phparch.com/c/p/index' target=blank&gt;&lt;span class="caps"&gt;PHP&lt;/span&gt; Works 2007&lt;/a&gt; conference in Atlanta this year! I&amp;#8217;m especially excited to hear the opening keynote on the PHP6. (Ironic that my last few posts have been on Ruby!).&lt;/p&gt;</description>
      <pubDate>Sat, 18 Aug 2007 13:06:45 -0400</pubDate>
      <guid>/posts/615-php-works-07-conference</guid>
    </item>
    <item>
      <title>I'm wondering if I should&#8230;</title>
      <author>Matt Darby</author>
      <link>/posts/614-i-m-wondering-if-i-should</link>
      <description>&lt;p&gt;Alright, just a full day of playing with Rails and I&amp;#8217;m seriously considering porting my entire CakePHP application over. I&amp;#8217;ve read the first hundred pages of the Rails Cookbook and I&amp;#8217;m quickly understanding that CakePHP only scratches the surface of Rails. Of note, I ported the same application over from my homemade framework to CakePHP one day after playing with it.&lt;/p&gt;</description>
      <pubDate>Sat, 18 Aug 2007 13:06:04 -0400</pubDate>
      <guid>/posts/614-i-m-wondering-if-i-should</guid>
    </item>
    <item>
      <title>I've wasted so much time.</title>
      <author>Matt Darby</author>
      <link>/posts/613-i-ve-wasted-so-much-time</link>
      <description>&lt;p&gt;I&amp;#8217;ve recently discovered the gloriousness of CakePHP, and my development time has been cut by 80% on the &lt;span class="caps"&gt;PHP&lt;/span&gt; projects I&amp;#8217;m working on at the office. I know that it&amp;#8217;s just a knock-off of Rails, but I&amp;#8217;m a &lt;span class="caps"&gt;PHP&lt;/span&gt; guy. Anyway, I decide to look at Rails for the first time since I realized that frameworks are a good thing.&lt;/p&gt;</description>
      <pubDate>Sat, 18 Aug 2007 13:05:22 -0400</pubDate>
      <guid>/posts/613-i-ve-wasted-so-much-time</guid>
    </item>
  </channel>
</rss>
