<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Robby on Rails: Tag sarcasm</title>
    <link>http://www.robbyonrails.com/articles/tag/sarcasm</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>thoughts.sort_by{|t| t[:topic]}.collect </description>
    <item>
      <title>DRY(a): Year After Year</title>
      <description>&lt;p&gt;I&amp;#8217;m guilty of it. Many of you are likely guilty of it&amp;#8230; and I know that several customers of our &lt;a href="http://www.robbyonrails.com/articles/2007/06/17/audit-your-rails-development-team"&gt;Rails Code Audit and Review service&lt;/a&gt; are guilty of it.&lt;/p&gt;


	&lt;p&gt;How many times have you realized (after a few months has passed) that your Copyright date/year on your web site was no longer current?&lt;/p&gt;


	&lt;p&gt;How many of you had the same problem last year? The year before?&lt;/p&gt;


	&lt;p&gt;Let me share some advice with you all&amp;#8230; &lt;span class="caps"&gt;DRY&lt;/span&gt; (a)!&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Don&amp;#8217;t Repeat Yourself (again)!&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;This is really a simple problem to fix but when we&amp;#8217;re busy tackling bigger problems&amp;#8230; little things like this slip by. Don&amp;#8217;t worry, you&amp;#8217;re not the only one who was reminded by a colleague three months into the year that you forgot to update this.&lt;/p&gt;


	&lt;p&gt;On client projects, we have a handful of helpers that we drop into the application. We&amp;#8217;re starting to extract more of these into plugins and will be releasing those as time permits. It just happened that I found myself looking at yet-another Rails code base this afternoon that was showing 2007 in the footer. An easily forgivable offense.. but if you&amp;#8217;re going to go in there and change it (again), &lt;em&gt;take a moment to do the right thing&lt;/em&gt;. ;-)&lt;/p&gt;


	&lt;p&gt;Our solution at &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; on client projects is to create a basic view helper that renders the current year. This allows us to do the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;div id="footer"&amp;gt;
    &amp;amp;copy; Copyright &amp;lt;%= current_year -%&amp;gt;. All Rights Reserved.
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The helper code looks like:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # add to application_helper.rb
  module ApplicationHelper
    def current_year
      Time.now.strftime('%Y')
    end
  end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Voila. Not rocket science.. is it?&lt;/p&gt;


	&lt;p&gt;Guess what? I&amp;#8217;m getting really tired of adding this to every Rails project that I touch. So, I bottled this little gem into a new Rails plugin that we&amp;#8217;ll just add to future projects.&lt;/p&gt;


	&lt;h2&gt;Introducing Year after Year&lt;/h2&gt;


	&lt;p&gt;This is really the smallest plugin that I could put together (and it includes specs!)&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;What does it provide you?&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;YearAfterYear will provide you a helper that will render the current year (dynamically)! That&amp;#8217;s right&amp;#8230; just add the plugin to your Rails application and you too can enjoy New Years 2009 without having to have a deployment ready with a one line change from 2008 to 2009!&lt;/p&gt;


	&lt;p&gt;To use.. add the following to any view from within Ruby on Rails.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= current_year -%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Installation&lt;/h3&gt;


	&lt;p&gt;As I&amp;#8217;m using git, you&amp;#8217;ll need to grab this and put it into &lt;code&gt;vendor/plugins&lt;/code&gt;. That&amp;#8217;s it!&lt;/p&gt;


	&lt;p&gt;You can grab it on &lt;a href="http://github.com"&gt;GitHub&lt;/a&gt;!&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://github.com/robbyrussell/year_after_year/"&gt;http://github.com/robbyrussell/year_after_year/&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Bugs / Feature Requests &lt;a href="http://planetargon.lighthouseapp.com/projects/5187-open-source-projects/tickets"&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Happy New Years (8+ months early)!&lt;/p&gt;


	&lt;p&gt;Just a friendly reminder to not forget the small stuff&amp;#8230; because your visitors will notice! ;-)&lt;/p&gt;


	&lt;h3&gt;Updates&amp;#8230;&lt;/h3&gt;


	&lt;p&gt;I got a few requests for this to also provide a range of years for people who like to do: &lt;strong&gt;2005-2007&lt;/strong&gt;. So this is now provided as well.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;year_range(start_year)&lt;/code&gt;&lt;/p&gt;


Example:
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= year_range(2005) %&amp;gt; # =&amp;gt; 2005-2008
&lt;/code&gt;&lt;/pre&gt;
</description>
      <pubDate>Mon, 24 Mar 2008 22:05:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4228a063-facc-4a13-bdb0-342c0fab415e</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/24/dry-a-year-after-year</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>sarcasm</category>
      <category>plugin</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>years</category>
      <category>copyrights</category>
      <category>joke</category>
      <category>plugins</category>
    </item>
    <item>
      <title>Chad Fowler's Dirty Little Secret?</title>
      <description>&lt;p&gt;I saw this photo of the Microsoft team from 1978 on &lt;a href="http://flickr.com/photos/anselmhook/1498377919/"&gt;Anselm&amp;#8217;s flickr&lt;/a&gt; and thought, &amp;#8220;Hmm, that looks like Chad Fowler!&amp;#8221;&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/chad_fowler_in_78-20071006-130251.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Could this be &lt;a href="http://chadfowler.com/"&gt;Chad Fowler&amp;#8217;s&lt;/a&gt; dirty little secret?..&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/imgp5302.png__png_image__413x416_pixels_-20071006-125640.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Happy Saturday!&lt;/p&gt;
</description>
      <pubDate>Sat, 06 Oct 2007 15:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c6f3710c-4bbc-415c-8bb4-17107749a5e0</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/10/06/chads-dirty-little-secret</link>
      <category>Off-Topic</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>sarcasm</category>
      <category>humor</category>
      <category>chad</category>
      <category>chadfowler</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>microsoft</category>
    </item>
    <item>
      <title>89 gmail invites available!</title>
      <description>&lt;p&gt;While everyone else is trading their &lt;a href="http://www.pownce.com/"&gt;pownce&lt;/a&gt; and &lt;a href="http://plasq.com/skitch"&gt;skitch&lt;/a&gt; invites, I wanted to let everyone know that I still have &lt;strong&gt;89 gmail invites available&lt;/strong&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/get_your_gmail_invite-20070727-141004.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Post a comment on my blog and I&amp;#8217;ll hook you up!&lt;/p&gt;


	&lt;p&gt;Happy Friday! ;-)&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;update: only 12 left!&lt;/strong&gt;&lt;/p&gt;
</description>
      <pubDate>Fri, 27 Jul 2007 16:10:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:87f050b2-33a3-41a7-981e-7248a501c41c</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/07/27/89-gmail-invites-available</link>
      <category>Off-Topic</category>
      <category>gmail</category>
      <category>skitch</category>
      <category>pownce</category>
      <category>invite</category>
      <category>madness</category>
      <category>sarcasm</category>
    </item>
    <item>
      <title>I Repeat... Do Not Use PostgreSQL!</title>
      <description>&lt;p&gt;Why is everybody interested in using &lt;a href="http://postgresql.org"&gt;PostgreSQL&lt;/a&gt;? We all know that it&amp;#8217;s a pain to install, a pain to maintain, and Rails only works with MySQL. So, why do we bother?&lt;/p&gt;


	&lt;p&gt;This article titled, &lt;a href="http://searchopensource.techtarget.com/originalContent/0,289142,sid39_gci1172668,00.html"&gt;Five reasons why you should never use PostgreSQL. Ever.&lt;/a&gt; clears up these questions.&lt;/p&gt;


	&lt;p&gt;My favorite is&amp;#8230; &lt;em&gt;&amp;#8220;Reason #5: You (don&amp;#8217;t) get what you (don&amp;#8217;t) pay for&amp;#8221;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;Imagine if we said the same thing about &lt;a href="http://www.rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt;?&lt;/p&gt;


	&lt;p&gt;&lt;small&gt;
Similar Post(s): &lt;a href="http://robbyonrails.com/articles/2005/09/27/the-bitter-sweet-taste-of-agnostic-database-schemas"&gt;The bitter-sweet taste of agnostic database schemas&lt;/a&gt;,  &lt;a href="http://robbyonrails.com/articles/2005/11/30/localization-with-rails-and-postgresql-part-1"&gt;Localization with Rails and PostgreSQL, part 1&lt;/a&gt;
&lt;/small&gt;&lt;/p&gt;
</description>
      <pubDate>Tue, 14 Mar 2006 09:16:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:a4e02c8e-a4a9-4b22-8189-10da420e0cfc</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2006/03/14/i-repeat-do-not-use-postgresql</link>
      <category>postgresql</category>
      <category>programming</category>
      <category>rails</category>
      <category>sarcasm</category>
    </item>
  </channel>
</rss>
