<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"><channel><title>sneaq.</title><description>stomping on a human face for 30 seconds at a time</description><link>http://sneaq.net/</link><item><title>My EDM Podcasts of 2009</title><description>&lt;p&gt;I discovered a lot of great electronic music in 2009 from a variety of sources, including these podcasts:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Club Autonomic&lt;/strong&gt; - 2009 was a year for a lot of experimentation within the Drum &amp;amp; Bass genre.  This podcast from &lt;a href=&quot;http://twitter.com/dbridge&quot;&gt;D-Bridge&lt;/a&gt; and Instra:Mental showcases the latest sounds that some are dubbing &quot;future beats&quot; (&lt;a href=&quot;http://club-autonomic.com/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.club-autonomic.com/podcast/podcast.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Critical Music&lt;/strong&gt; - Critical Music label boss Kasra presents the latest from his and other labels (&lt;a href=&quot;http://criticalmusic.com/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.criticalmusic.com/podcast/CriticalPodcast.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;DJ Marky&lt;/strong&gt; - DJ Marky (Brazil) presents his latest mixes (&lt;a href=&quot;http://djmarky.com.br/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.djmarky.com.br/podcast/podcast.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;John B&lt;/strong&gt; - International Superstar DJ &lt;a href=&quot;http://twitter.com/johnbbeta&quot;&gt;John B&lt;/a&gt; presents his selection of electro-influenced Drum &amp;amp; Bass (&lt;a href=&quot;http://john-b.com/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://feeds.feedburner.com/JohnBPodcasts&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Hospital Records&lt;/strong&gt; - Tony Colman (aka. &lt;a href=&quot;http://twitter.com/londonelek&quot;&gt;London Elektricity&lt;/a&gt;) presents the latest selections from Hospital Records and other up-and-coming producers (&lt;a href=&quot;http://hospitalrecords.com/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://podcast.hospitalrecords.com/HospitalRecordsPodcast.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Phuture Frequency&lt;/strong&gt; - An Intenet radio station that went podcast-only in 2006.  It features various DJs representing a variety of styles of Drum &amp;amp; Bass (&lt;a href=&quot;http://www.pfradio.com/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://feed.pfradio.com/pfr&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Random Movement&lt;/strong&gt; - This DJ / Producer has a regular show on &lt;a href=&quot;http://bassdrive.com/v2/&quot;&gt;Bassdrive&lt;/a&gt; and features his latest studio mixes on this podcast (&lt;a href=&quot;http://www.myspace.com/randommovementmusic&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.randommovement.org/podcasts/R_m-podcast.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reprise Music Agency&lt;/strong&gt; - Reprise represents a lot of well-known DJs / Producers, this podcast showcases mixes from the talent that they represent (&lt;a href=&quot;http://www.reprisemusicgroup.com/agency/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.reprisemusicgroup.com/agency/audio/podcast/reprise_podcast.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Shogun Audio&lt;/strong&gt; - &lt;a href=&quot;http://twitter.com/FrictionShogun&quot;&gt;DJ Friction&lt;/a&gt; showcases the latest from the Shogun Audio camp (&lt;a href=&quot;http://www.shogunaudio.co.uk/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.shogunaudio.co.uk/podcast.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Urban Nights&lt;/strong&gt; - DJ Urbanite presents periodic mixes of some Liquid DnB selections (&lt;a href=&quot;http://djurbanite.podbean.com/feed/&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;XLR8R&lt;/strong&gt; - This podcast features the most eclectic collection of music, from hip-hop, to grime, to indie, they present a lot of different up-and-coming scenes and sounds.  It's a good place to start to find a lot of interesting music. I summarized my favorite episodes from this podcast &lt;a href=&quot;http://sneaq.net/eks-ell-arrr-ayte-arr&quot;&gt;last year&lt;/a&gt; (&lt;a href=&quot;http://www.xlr8r.com/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.xlr8r.com/podcast.rss&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Lifted Music&lt;/strong&gt; - Label bosses &lt;a href=&quot;http://twitter.com/sp0r&quot;&gt;Spor&lt;/a&gt; and &lt;a href=&quot;http://twitter.com/ChrisRenegade&quot;&gt;Chris Renegade&lt;/a&gt; feature darker Drum &amp;amp; Bass from their label.  This hasn't been updated in quite a while, but the older episodes are worth a listen (&lt;a href=&quot;http://www.liftedmusic.co.uk/&quot;&gt;web&lt;/a&gt;, &lt;a href=&quot;http://www.liftedmusic.co.uk/podcast/RSS/Lifted_Music_RSS.xml&quot;&gt;subscribe&lt;/a&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Go check these out (if you're into that sort of thing).&lt;/p&gt;</description><pubDate>Thu, 14 Jan 2010 14:03:37 +0000</pubDate><link>http://sneaq.net/my-edm-podcasts-of-2009</link><guid>http://sneaq.net/my-edm-podcasts-of-2009</guid></item><item><title>Using Helper Methods in Your Model? Yes.</title><description>&lt;p&gt;At one point I found myself wanting to use Rails' &lt;a href=&quot;http://api.rubyonrails.org/classes/ActionView/Helpers/TextHelper.html#M001752&quot;&gt;&lt;code&gt;auto_link&lt;/code&gt;&lt;/a&gt; helper in a &lt;code&gt;to_html&lt;/code&gt; method on one of my models.  If you need this functionality, here's how you would do it:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#B06; font-weight:bold&quot;&gt;Formatter&lt;/span&gt;

  include &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;ActionView&lt;/span&gt;::&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Helpers&lt;/span&gt;::&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;TagHelper&lt;/span&gt;
  include &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;ActionView&lt;/span&gt;::&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Helpers&lt;/span&gt;::&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;TextHelper&lt;/span&gt;

  &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color:#06B; font-weight:bold&quot;&gt;initialize&lt;/span&gt;(content)
    &lt;span style=&quot;color:#33B&quot;&gt;@content&lt;/span&gt; = content
  &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;

  &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color:#06B; font-weight:bold&quot;&gt;to_html&lt;/span&gt;
    auto_link(&lt;span style=&quot;color:#33B&quot;&gt;@content&lt;/span&gt;)
  &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;

&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;I had to include &lt;a href=&quot;http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html&quot;&gt;&lt;code&gt;TagHelper&lt;/code&gt;&lt;/a&gt; to satisfy dependencies for the &lt;a href=&quot;http://api.rubyonrails.org/classes/ERB/Util.html#M000315&quot;&gt;&lt;code&gt;h()&lt;/code&gt;&lt;/a&gt; and &lt;a href=&quot;http://api.rubyonrails.org/classes/ActionView/Helpers/TagHelper.html#M001726&quot;&gt;&lt;code&gt;content_tag()&lt;/code&gt;&lt;/a&gt; methods.  Though I ended up writing a custom formatter class instead in this case, this is still a useful approach.&lt;/p&gt;</description><pubDate>Thu, 31 Dec 2009 20:48:48 +0000</pubDate><link>http://sneaq.net/using-helper-methods-in-your-model-yes</link><guid>http://sneaq.net/using-helper-methods-in-your-model-yes</guid></item><item><title>Passing Parameters to Rake Tasks</title><description>&lt;p&gt;I recently discovered how to correctly pass parameters to Rake tasks from the command-line instead of the old, busted way of passing in environment variables.  The post is up on the &lt;a href=&quot;http://www.viget.com/extend/protip-passing-parameters-to-your-rake-tasks/&quot;&gt;Viget Extend blog&lt;/a&gt;, but here's the short of it.&lt;/p&gt;

&lt;p&gt;If you have a task that you want to parameterize:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;task &lt;span style=&quot;color:#A60&quot;&gt;:echo&lt;/span&gt; &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;do&lt;/span&gt;
  puts &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;&amp;quot;&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;Hello&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;&amp;quot;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;You can specify the parameters that it accepts and receive them as a hash inside of the task:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;task &lt;span style=&quot;color:#A60&quot;&gt;:echo&lt;/span&gt;, &lt;span style=&quot;color:#A60&quot;&gt;:message&lt;/span&gt; &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;do&lt;/span&gt; |t, args|
  message = args[&lt;span style=&quot;color:#A60&quot;&gt;:message&lt;/span&gt;] || &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;Hello&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
  puts message
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;It also honors task dependencies (using a different syntax):&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;task &lt;span style=&quot;color:#A60&quot;&gt;:echo&lt;/span&gt;, &lt;span style=&quot;color:#A60&quot;&gt;:message&lt;/span&gt;, &lt;span style=&quot;color:#A60&quot;&gt;:needs&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color:#A60&quot;&gt;:environment&lt;/span&gt; &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;do&lt;/span&gt; |t, args|
  ...
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Check out &lt;a href=&quot;http://www.viget.com/extend/protip-passing-parameters-to-your-rake-tasks/&quot;&gt;the post for the full details&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Mon, 14 Dec 2009 20:13:50 +0000</pubDate><link>http://sneaq.net/passing-parameters-to-rake-tasks</link><guid>http://sneaq.net/passing-parameters-to-rake-tasks</guid></item><item><title>Coding with Confidence: The Talk</title><description>&lt;p&gt;Last weekend I gave a talk on Test-Driven Development at the &lt;a href=&quot;http://www.cmap-online.org/CodeCamp/&quot;&gt;Fall 2009 CMAP Code Camp&lt;/a&gt;.  Since this was a .NET event (and I'm a Ruby guy), I took a look at some previous talks I had given on the topic to focus on &lt;em&gt;why&lt;/em&gt; someone might want to use a Test-Driven approach when developing software.  It didn't hurt that there had been a lot of &lt;a href=&quot;http://abstractstuff.livejournal.com/60388.html&quot;&gt;debate&lt;/a&gt; &lt;a href=&quot;http://www.joelonsoftware.com/items/2009/09/23.html&quot;&gt;recently&lt;/a&gt; on the &lt;a href=&quot;http://blog.objectmentor.com/articles/2009/09/24/the-duct-tape-programmer&quot;&gt;value&lt;/a&gt; of both &lt;a href=&quot;http://www.joelonsoftware.com/items/2009/01/31.html&quot;&gt;unit testing&lt;/a&gt; and a &lt;a href=&quot;http://www.tbray.org/ongoing/When/200x/2009/09/25/On-Duct-Tape&quot;&gt;test-first&lt;/a&gt; software development approach.  The first part of &lt;a href=&quot;http://github.com/reagent/talks/tree/master/Coding_with_Confidence/&quot;&gt;my presentation&lt;/a&gt; focused on the benefits:&lt;/p&gt;

&lt;div id=&quot;__ss_2446163&quot; style=&quot;width:425px;text-align:left&quot;&gt;&lt;a href=&quot;http://www.slideshare.net/reagent/coding-with-confidence-adding-tdd-to-your-toolset&quot; title=&quot;Coding With Confidence: Adding TDD to Your Toolset&quot; style=&quot;font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;&quot;&gt;Coding With Confidence: Adding TDD to Your Toolset&lt;/a&gt;&lt;object height=&quot;355&quot; width=&quot;425&quot; style=&quot;margin:0px&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=codingwithconfidence-091107133258-phpapp01&amp;stripped_title=coding-with-confidence-adding-tdd-to-your-toolset&quot; /&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot; /&gt;&lt;param name=&quot;allowScriptAccess&quot; value=&quot;always&quot; /&gt;&lt;embed allowfullscreen=&quot;true&quot; src=&quot;http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=codingwithconfidence-091107133258-phpapp01&amp;stripped_title=coding-with-confidence-adding-tdd-to-your-toolset&quot; allowscriptaccess=&quot;always&quot; type=&quot;application/x-shockwave-flash&quot; height=&quot;355&quot; width=&quot;425&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;div style=&quot;font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;&quot;&gt;View more &lt;a href=&quot;http://www.slideshare.net/&quot; style=&quot;text-decoration:underline;&quot;&gt;documents&lt;/a&gt; from &lt;a href=&quot;http://www.slideshare.net/reagent&quot; style=&quot;text-decoration:underline;&quot;&gt;Patrick Reagan&lt;/a&gt;.&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;For the second portion of my talk, I did about 45 minutes of live coding (in Ruby) to demonstrate the process I go through when using tests to drive the code I write.  During that time, we built a small &lt;a href=&quot;http://github.com/reagent/talks/tree/master/Coding_with_Confidence/examples/&quot;&gt;working wrapper to the TwitterCounter API&lt;/a&gt; from the ground up.  There was some good discussion afterwards about removing the remaining duplication and how best to evolve the design to better model the interaction with the API. &lt;/p&gt;

&lt;p&gt;It was good to get in front of a different audience to talk about the value of testing as a design tool.  Thanks to &lt;a href=&quot;http://www.inq.net/&quot;&gt;Chris Steen&lt;/a&gt; for the invitation and the rest of the CMAP group for organizing a great conference.&lt;/p&gt;</description><pubDate>Fri, 13 Nov 2009 12:36:51 +0000</pubDate><link>http://sneaq.net/coding-with-confidence-the-talk</link><guid>http://sneaq.net/coding-with-confidence-the-talk</guid></item><item><title>Dead Simple Delegation in Rails</title><description>&lt;p&gt;I can't believe I didn't see this when it came out.  Instead of this:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#B06; font-weight:bold&quot;&gt;Child&lt;/span&gt; &amp;lt; &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Base&lt;/span&gt;
  belongs_to &lt;span style=&quot;color:#A60&quot;&gt;:parent&lt;/span&gt;

  &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;def&lt;/span&gt; &lt;span style=&quot;color:#06B; font-weight:bold&quot;&gt;parent_name&lt;/span&gt;
    parent.name
  &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Or this:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;forwardable&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#B06; font-weight:bold&quot;&gt;Child&lt;/span&gt; &amp;lt; &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Base&lt;/span&gt;
  extend &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Forwardable&lt;/span&gt;

  belongs_to &lt;span style=&quot;color:#A60&quot;&gt;:parent&lt;/span&gt;
  def_delegator &lt;span style=&quot;color:#A60&quot;&gt;:parent&lt;/span&gt;, &lt;span style=&quot;color:#A60&quot;&gt;:name&lt;/span&gt;, &lt;span style=&quot;color:#A60&quot;&gt;:parent_name&lt;/span&gt;
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;You can now do this (as of Rails 2.2.2)&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color:#B06; font-weight:bold&quot;&gt;Child&lt;/span&gt; &amp;lt; &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;ActiveRecord&lt;/span&gt;::&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Base&lt;/span&gt;
  belongs_to &lt;span style=&quot;color:#A60&quot;&gt;:parent&lt;/span&gt;
  delegate &lt;span style=&quot;color:#A60&quot;&gt;:name&lt;/span&gt;, &lt;span style=&quot;color:#A60&quot;&gt;:to&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color:#A60&quot;&gt;:parent&lt;/span&gt;, &lt;span style=&quot;color:#A60&quot;&gt;:prefix&lt;/span&gt; =&amp;gt; &lt;span style=&quot;color:#038; font-weight:bold&quot;&gt;true&lt;/span&gt;
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Check out some more &lt;a href=&quot;http://railsbrain.com/api/rails-2.2.2/doc/index.html?a=M000009&amp;amp;name=delegate&quot;&gt;detailed examples in the documentation&lt;/a&gt;&lt;/p&gt;</description><pubDate>Sat, 15 Aug 2009 00:46:14 +0000</pubDate><link>http://sneaq.net/dead-simple-delegation-in-rails</link><guid>http://sneaq.net/dead-simple-delegation-in-rails</guid></item><item><title>Autotest and Me</title><description>&lt;p&gt;Today, &lt;a href=&quot;http://objectsinmirrors.com&quot;&gt;Mark&lt;/a&gt; and I were talking about some of the open source projects we've been working on.  During our conversation, he mentioned how &lt;a href=&quot;http://davideisinger.com&quot;&gt;David's&lt;/a&gt; recent post about &lt;a href=&quot;http://www.viget.com/extend/how-why-to-run-autotest-on-your-mac/&quot;&gt;using Autotest on OSX&lt;/a&gt; was the catalyst for him to start using it on his projects.  I decided that I would do the same, so I went about using it on a &lt;a href=&quot;http://github.com/vigetlabs/unfuzzle&quot;&gt;Ruby gem that I'm developing&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;From the original post, using it on Rails is pretty straightforward, but getting it to work on a vanilla Ruby project requires a bit of tweaking.  There's some &lt;a href=&quot;http://ph7spot.com/articles/getting_started_with_autotest&quot;&gt;outdated information&lt;/a&gt; out there, but I was able to find &lt;a href=&quot;http://opensoul.org/tags/autotest&quot;&gt;a solution&lt;/a&gt; that worked for me.  My resulting &lt;code&gt;.autotest&lt;/code&gt; file:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;autotest/growl&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
require &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;autotest/fsevent&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Autotest&lt;/span&gt;.add_hook &lt;span style=&quot;color:#A60&quot;&gt;:initialize&lt;/span&gt; &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;do&lt;/span&gt; |at|
  at.clear_mappings

  at.add_mapping &lt;span style=&quot;background-color:#fff0ff&quot;&gt;&lt;span style=&quot;color:#404&quot;&gt;%r%&lt;/span&gt;&lt;span style=&quot;color:#808&quot;&gt;/^lib/(.*).rb$&lt;/span&gt;&lt;span style=&quot;color:#404&quot;&gt;%&lt;/span&gt;&lt;/span&gt; &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;do&lt;/span&gt; |_, m|
    possible = &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;File&lt;/span&gt;.basename(m[&lt;span style=&quot;color:#00D; font-weight:bold&quot;&gt;1&lt;/span&gt;])
    files_matching &lt;span style=&quot;background-color:#fff0ff&quot;&gt;&lt;span style=&quot;color:#404&quot;&gt;%r%&lt;/span&gt;&lt;span style=&quot;color:#808&quot;&gt;^test/.*(&lt;/span&gt;&lt;span style=&quot;background: #eee&quot;&gt;&lt;span style=&quot;font-weight: bold; color: #888&quot;&gt;#{&lt;/span&gt;possible&lt;span style=&quot;font-weight: bold; color: #888&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#808&quot;&gt;_test|test_&lt;/span&gt;&lt;span style=&quot;background: #eee&quot;&gt;&lt;span style=&quot;font-weight: bold; color: #888&quot;&gt;#{&lt;/span&gt;possible&lt;span style=&quot;font-weight: bold; color: #888&quot;&gt;}&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;color:#808&quot;&gt;).rb$&lt;/span&gt;&lt;span style=&quot;color:#404&quot;&gt;%&lt;/span&gt;&lt;/span&gt;
  &lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;

  at.add_mapping(&lt;span style=&quot;background-color:#fff0ff&quot;&gt;&lt;span style=&quot;color:#404&quot;&gt;%r%&lt;/span&gt;&lt;span style=&quot;color:#808&quot;&gt;^test/.*.rb$&lt;/span&gt;&lt;span style=&quot;color:#404&quot;&gt;%&lt;/span&gt;&lt;/span&gt;) {|filename, _| filename }
&lt;span style=&quot;color:#080; font-weight:bold&quot;&gt;end&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;With that patch in place, I get the results I want.&lt;/p&gt;</description><pubDate>Fri, 03 Jul 2009 00:26:47 +0000</pubDate><link>http://sneaq.net/autotest-and-me</link><guid>http://sneaq.net/autotest-and-me</guid></item><item><title>Access The Etsy API in Ruby</title><description>&lt;p&gt;Long ago, my &lt;a href=&quot;http://littletjane.com&quot;&gt;wife&lt;/a&gt; found a &lt;a href=&quot;http://littletjane.etsy.com&quot;&gt;love for Etsy&lt;/a&gt;.  When I recently discovered their public API, I figured that it was meant to be that I begin working on a clean implementation of the &lt;a href=&quot;http://github.com/reagent/etsy/tree/master&quot;&gt;Etsy API in Ruby&lt;/a&gt;.  So I did.&lt;/p&gt;

&lt;p&gt;I'm releasing the first version to the public tonight that includes support for retrieving users, their shops, and associated listings.&lt;/p&gt;

&lt;h2&gt;Installation&lt;/h2&gt;

&lt;p&gt;A simple gem installation is all you need:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo gem install etsy
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;If you prefer to bleed:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;sudo gem install reagent-etsy --source=http://gems.github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Usage&lt;/h2&gt;

&lt;p&gt;Once installed, &lt;a href=&quot;http://developer.etsy.com/&quot;&gt;set up your API key&lt;/a&gt; and you're ready to go:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;require &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;rubygems&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;
require &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;etsy&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;

&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Etsy&lt;/span&gt;.api_key = &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;snipsnap&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;At the time of this post, all API calls are read-only so that's all you need to do.  Let's get started by finding a user's shop:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Etsy&lt;/span&gt;.user(&lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;littletjane&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;) &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; #&amp;lt;Etsy::User:0x1057624 ... &amp;gt;&lt;/span&gt;
user.seller?                    &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; true&lt;/span&gt;
user.shop.name                  &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; &amp;quot;littletjane&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;A shop can have multiple listings:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user.shop.listings  &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; [#&amp;lt;Etsy::Listing:0x1001788 ... &amp;gt;, ... ]&lt;/span&gt;

listing = user.shop.listings.first

listing.title       &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; &amp;quot;hanging with the bad boys matchbox&amp;quot;&lt;/span&gt;
listing.description &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; &amp;quot;standard size matchbox, approx. 1.5 x 2 ... &amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Each listing, in turn, can have one or more images:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;image = listing.images.first

image.small_square &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; &amp;quot;http://ny-image2.etsy.com/il_25x25.67765346.jpg&amp;quot;&lt;/span&gt;
image.large        &lt;span style=&quot;color:#888&quot;&gt;# =&amp;gt; &amp;quot;http://ny-image2.etsy.com/il_430xN.67765346.jpg&amp;quot;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;For more information and usage examples, check out the &lt;a href=&quot;http://etsy.rubyforge.org&quot;&gt;documentation on Rubyforge&lt;/a&gt;.  If you have feature requests or comments, open an &lt;a href=&quot;http://github.com/reagent/etsy/issues&quot;&gt;issue on Github&lt;/a&gt; or &lt;a href=&quot;mailto:reaganpr@gmail.com&quot;&gt;send me an email&lt;/a&gt;.&lt;/p&gt;</description><pubDate>Tue, 05 May 2009 03:32:19 +0000</pubDate><link>http://sneaq.net/access-the-etsy-api-in-ruby</link><guid>http://sneaq.net/access-the-etsy-api-in-ruby</guid></item><item><title>SVN Cleansweep</title><description>&lt;p&gt;Due to a very specific setup we have here at the office, I sometimes have to fix people's SVN working copies directly on the server. Sometimes I can run &lt;code&gt;svn cleanup&lt;/code&gt; from the top-level directory, sometimes I can't.&lt;/p&gt;

&lt;p&gt;With &lt;a href=&quot;http://conceptsahead.com/off-axis&quot;&gt;Kevin's&lt;/a&gt; help, I came up with this script to start at the deepest directories and clean all the way to the current directory:&lt;/p&gt;

&lt;script src=&quot;http://gist.github.com/103779.js&quot;&gt;&lt;/script&gt;</description><pubDate>Wed, 29 Apr 2009 16:50:50 +0000</pubDate><link>http://sneaq.net/svn-cleansweep</link><guid>http://sneaq.net/svn-cleansweep</guid></item><item><title>Grab Flickr Tags and Comments With Fleakr</title><description>&lt;p&gt;I just pushed out &lt;a href=&quot;http://github.com/reagent/fleakr/tree/0.4.3&quot;&gt;version 0.4.3&lt;/a&gt; of the &lt;a href=&quot;http://github.com/reagent/fleakr/tree/master&quot;&gt;Fleakr gem&lt;/a&gt; that provides support for retrieving tags and comments for users, photos, and photosets.  These are non-authenticated methods, so all you need is your API key:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;&lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Fleakr&lt;/span&gt;.api_key = &lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;your_api_key&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Once that's set, you can retrieve tags for users and photos:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Fleakr&lt;/span&gt;.user(&lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;teamviget&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
user.tags.first.value
user.sets.first.photos.first.tags.first.value&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Given a single tag, you can also retrieve a list of related tags:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user.tags.first.related.first&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Tags associated with a photo have more information associated to them - see &lt;a href=&quot;http://fleakr.rubyforge.org/0.4.3/&quot;&gt;the documentation&lt;/a&gt; for what's available.  Comments have no such limitation and are available for both sets and individual photos:&lt;/p&gt;

&lt;div class=&quot;CodeRay&quot;&gt;
  &lt;div class=&quot;code&quot;&gt;&lt;pre&gt;user = &lt;span style=&quot;color:#036; font-weight:bold&quot;&gt;Fleakr&lt;/span&gt;.user(&lt;span style=&quot;background-color:#fff0f0&quot;&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;span style=&quot;color:#D20&quot;&gt;the decapitator&lt;/span&gt;&lt;span style=&quot;color:#710&quot;&gt;'&lt;/span&gt;&lt;/span&gt;)
user.sets.first.comments
user.photos.first.comments&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;


&lt;p&gt;Give it a try for yourself - check out &lt;a href=&quot;http://fleakr.rubyforge.org/0.4.3/&quot;&gt;the docs&lt;/a&gt; or &lt;a href=&quot;mailto:reaganpr@gmail.com&quot;&gt;send me an email&lt;/a&gt; if you get stuck.  Enjoy&lt;/p&gt;</description><pubDate>Sun, 12 Apr 2009 20:08:53 +0000</pubDate><link>http://sneaq.net/grab-flickr-tags-and-comments-with-fleakr</link><guid>http://sneaq.net/grab-flickr-tags-and-comments-with-fleakr</guid></item><item><title>Am I Ruby 1.9?</title><description>&lt;p&gt;&lt;a href=&quot;http://conceptsahead.com/off-axis&quot;&gt;Kevin&lt;/a&gt; and I were chatting about how to tell if your locally installed gems were compatible with Ruby 1.9.  He was looking for a tool that would scan the list and figure out which ones worked.  I pointed him to &lt;a href=&quot;http://isitruby19.com/&quot;&gt;Is It Ruby 1.9?&lt;/a&gt;, he found &lt;a href=&quot;http://forum.brightbox.co.uk/forums/isitruby19-com/topics/api-is-added&quot;&gt;the API&lt;/a&gt; and &lt;a href=&quot;http://github.com/n3bulous/amiruby19/tree/master&quot;&gt;whipped up a gem&lt;/a&gt; that would tell you which of your gems would likely work (or not work) with the latest version of Ruby.  Check it out:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ sudo gem install n3bulous-amiruby19 --source=http://gems.github.com
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Then let it loose on your system:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;$ amiruby19
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Oh, and it was built with &lt;a href=&quot;http://github.com/reagent/simple-gem/tree/master&quot;&gt;simple-gem&lt;/a&gt; (shameless plug).&lt;/p&gt;</description><pubDate>Fri, 03 Apr 2009 01:35:55 +0000</pubDate><link>http://sneaq.net/am-i-ruby-19</link><guid>http://sneaq.net/am-i-ruby-19</guid></item></channel></rss>
