<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Willcodeforfoo's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sat, 26 Jul 2008 20:19:59 GMT</pubDate>
    <description>DZone Snippets: Willcodeforfoo's Code Snippets</description>
    <item>
      <title>Rails Date Formats</title>
      <link>http://snippets.dzone.com/posts/show/5231</link>
      <description>// cribbed from http://wiki.rubyonrails.org/rails/pages/HowToDefineYourOwnDateFormat&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;my_formats = {&lt;br /&gt;  :my_format_1 =&gt; '%l %p, %b %d, %Y',&lt;br /&gt;  :my_format_2  =&gt; '%l:%M %p, %B %d, %Y'&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(my_formats)&lt;br /&gt;ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(my_formats)&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 14 Mar 2008 14:32:10 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5231</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>MySQL Database Size</title>
      <link>http://snippets.dzone.com/posts/show/4117</link>
      <description>&lt;code&gt;mysql -uroot -D sfcnet_development -e "show table status\G"| egrep "(Index|Data)_length" | awk 'BEGIN { rsum = 0 } { rsum += $2 } END { print rsum }'&lt;/code&gt;</description>
      <pubDate>Fri, 08 Jun 2007 14:51:07 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4117</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>Optimize Aperture database</title>
      <link>http://snippets.dzone.com/posts/show/3630</link>
      <description>&lt;code&gt;&lt;br /&gt;sqlite3 Pictures/Aperture\ Library.aplibrary/Aperture.aplib/Library.apdb vacuum&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 05 Mar 2007 14:43:20 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3630</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>String#to_range</title>
      <link>http://snippets.dzone.com/posts/show/3611</link>
      <description>// convert a string like "1-10" to a range 1..10&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;class String; def to_range; Range.new(*self.split("-").map{|i|i.to_i}); end; end&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Thu, 01 Mar 2007 22:51:36 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3611</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>get all local variables</title>
      <link>http://snippets.dzone.com/posts/show/3380</link>
      <description>&lt;code&gt;&gt;&gt; local_variables&lt;br /&gt;# =&gt; ["_"]  &lt;br /&gt;&lt;br /&gt;&gt;&gt; a = "Kevin"&lt;br /&gt;# =&gt; "Kevin"  &lt;br /&gt;&lt;br /&gt;&gt;&gt; local_variables&lt;br /&gt;# =&gt; ["_", "a"]  &lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Mon, 29 Jan 2007 00:27:57 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3380</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>Mount SSH using MacFUSE</title>
      <link>http://snippets.dzone.com/posts/show/3342</link>
      <description>This will also list the voume in the Finder, thanks to the volname option (I think)&lt;br /&gt;&lt;br /&gt;&lt;code&gt;mkdir -p ~/mnts/formandfx&lt;br /&gt;sshfs kmarsh@formandfx.com: ~/mnts/formandfx -oping_diskarb,volname=formandfx&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Sun, 21 Jan 2007 23:14:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3342</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>Building curb under Mac OS X</title>
      <link>http://snippets.dzone.com/posts/show/3250</link>
      <description>Had a bit of a problem getting curb to work in OS X, but if you have the curl port installed, its easy:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;sudo port install curl&lt;br /&gt;cd src&lt;br /&gt;curl -O http://rubyforge.iasi.roedu.net/files/curb/curb-0.1.0.tar.gz&lt;br /&gt;tar -zxvf curb-0.1.0.tar.gz&lt;br /&gt;cd curb-0.1.0.tar.gz&lt;br /&gt;ruby extconf.rb --with-curl-lib=/opt/local/lib/ --with-curl-include=/opt/local/include/&lt;br /&gt;ruby tests/alltests.rb&lt;br /&gt;sudo make install&lt;/pre&gt;&lt;br /&gt;</description>
      <pubDate>Sat, 06 Jan 2007 00:44:55 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3250</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>Freeze Rails to Edge RC2 via SVN Externals</title>
      <link>http://snippets.dzone.com/posts/show/3249</link>
      <description>So you've already frozen to RC1, but need to upgrade to RC2?&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;cd ~/Sites/railsapp&lt;br /&gt;svn propedit svn:externals vendor&lt;br /&gt;# An editor will pop up, change RC1 to RC2 and save&lt;br /&gt;svn up&lt;br /&gt;svn ci -m "* Upgrade to RC2"&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;3 SVN Externals&lt;br /&gt;&lt;br /&gt;Bonus tip: I'm a habitual 'svn stat'er, and this helped speed up the process:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;svn --ignore-externals stat&lt;/pre&gt;</description>
      <pubDate>Fri, 05 Jan 2007 22:08:41 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3249</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>Get Frontmost Window</title>
      <link>http://snippets.dzone.com/posts/show/3238</link>
      <description>&lt;code&gt;tell application "System Events"&lt;br /&gt;	set frontmostApplication to name of the first process whose frontmost is true&lt;br /&gt;end tell&lt;/code&gt;</description>
      <pubDate>Thu, 04 Jan 2007 21:20:44 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3238</guid>
      <author>willcodeforfoo ()</author>
    </item>
    <item>
      <title>Freeze Rails to Edge RC1 via SVN Externals</title>
      <link>http://snippets.dzone.com/posts/show/3231</link>
      <description>&lt;code&gt;cd vendor&lt;br /&gt;svn propset svn:externals "rails http://dev.rubyonrails.org/svn/rails/tags/rel_1-2-0_RC1/" .&lt;br /&gt;svn ci&lt;br /&gt;svn up&lt;/code&gt;</description>
      <pubDate>Wed, 03 Jan 2007 04:18:06 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/3231</guid>
      <author>willcodeforfoo ()</author>
    </item>
  </channel>
</rss>
