<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><description>Hey, I’m Dima Sabanin and I love programming and I’ve been doing this since I was 10 years old. For the last 3 years I work with Rails.

I study Zen, I have a family with a small kid. This is my brain dump.

sdmitry@gmail.com



</description><title>railsmonk</title><generator>Tumblr (3.0; @railsmonk)</generator><link>http://railsmonk.com/</link><item><title>ConfigurationFile plugin for Rails</title><description>&lt;p&gt;My plugin to handle YAML configuration files in Rails apps.&lt;/p&gt;

&lt;p&gt;For most cases just YAML::load will work, but in my case I needed string interpolation, so I decided to make a little plugin out of that.&lt;/p&gt;

&lt;p&gt;Here’s simple usage pattern:&lt;/p&gt;

&lt;p&gt;&lt;script src="http://gist.github.com/4439.js"&gt;&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;Feel free to fork and do whatever you want with this.&lt;/p&gt;

&lt;p&gt;Update:&lt;br/&gt;
Forgot the link to plugin itself: &lt;a href="http://github.com/railsmonk/configuration-file-plugin"&gt;http://github.com/railsmonk/configuration-file-plugin&lt;/a&gt;&lt;/p&gt;</description><link>http://railsmonk.com/post/45089950</link><guid>http://railsmonk.com/post/45089950</guid><pubDate>Fri, 08 Aug 2008 00:27:00 +0800</pubDate></item><item><title>"Programming today is a race between software engineers striving to build bigger and better..."</title><description>“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;Quote of the Day&lt;/em&gt;</description><link>http://railsmonk.com/post/44654118</link><guid>http://railsmonk.com/post/44654118</guid><pubDate>Mon, 04 Aug 2008 20:03:30 +0800</pubDate></item><item><title>life freezes without github</title><description>life freezes without github</description><link>http://railsmonk.com/post/39035403</link><guid>http://railsmonk.com/post/39035403</guid><pubDate>Thu, 19 Jun 2008 23:13:07 +0800</pubDate></item><item><title>Awesome Git cheatsheet</title><description>&lt;a href="http://cheat.errtheblog.com/s/git"&gt;Awesome Git cheatsheet&lt;/a&gt;</description><link>http://railsmonk.com/post/38849296</link><guid>http://railsmonk.com/post/38849296</guid><pubDate>Wed, 18 Jun 2008 14:31:07 +0800</pubDate></item><item><title>$ open -a MyFavouriteApp # opens mac application from Terminal</title><description>$ open -a MyFavouriteApp # opens mac application from Terminal</description><link>http://railsmonk.com/post/37815707</link><guid>http://railsmonk.com/post/37815707</guid><pubDate>Tue, 10 Jun 2008 12:23:35 +0800</pubDate></item><item><title>“We cannot direct the wind, but we can adjust the sails.”</title><description>“We cannot direct the wind, but we can adjust the sails.”</description><link>http://railsmonk.com/post/37161981</link><guid>http://railsmonk.com/post/37161981</guid><pubDate>Thu, 05 Jun 2008 00:11:24 +0800</pubDate></item><item><title>My attempt at ActiveRecord models code guidelines: http://tinyurl.com/6yqwel</title><description>My attempt at ActiveRecord models code guidelines: &lt;a href="http://tinyurl.com/6yqwel"&gt;http://tinyurl.com/6yqwel&lt;/a&gt;</description><link>http://railsmonk.com/post/37064684</link><guid>http://railsmonk.com/post/37064684</guid><pubDate>Wed, 04 Jun 2008 06:02:39 +0800</pubDate></item><item><title>Code style guidelines for ActiveRecord models. I’ve been...</title><description>&lt;img src="http://media.tumblr.com/nUy5jmVcw9shggq4r9ZdKITN_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Code style guidelines for ActiveRecord models. I’ve been using this for last couple years, it’s proven to improve code readability.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://pastie.caboo.se/208137"&gt;Complete pastie with code here&lt;/a&gt;.&lt;/p&gt;</description><link>http://railsmonk.com/post/37055576</link><guid>http://railsmonk.com/post/37055576</guid><pubDate>Wed, 04 Jun 2008 04:19:26 +0800</pubDate></item><item><title>Setting cookies in RSpec</title><description>&lt;pre&gt;&lt;code class="ruby"&gt;def cookie(name, value)
  @request.cookies[name.to_s] = CGI::Cookie.new(name.to_s, value.to_s)
end
&lt;/code&gt;&lt;/pre&gt;

Found on google.</description><link>http://railsmonk.com/post/37016174</link><guid>http://railsmonk.com/post/37016174</guid><pubDate>Tue, 03 Jun 2008 22:01:55 +0800</pubDate><category>rails rspec tip</category></item><item><title>A plugin to make a Leopard-style sidebar for Textmate instead of...</title><description>&lt;img src="http://media.tumblr.com/nUy5jmVcw9rxrnweHNvpaNta_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;A plugin to make a Leopard-style sidebar for Textmate instead of a stupid drawer. Looks awesome!</description><link>http://railsmonk.com/post/37000892</link><guid>http://railsmonk.com/post/37000892</guid><pubDate>Tue, 03 Jun 2008 19:08:17 +0800</pubDate></item><item><title>MagLev could be our chance to do some Smalltalk without learning Squeak. YAY!</title><description>MagLev could be our chance to do some Smalltalk without learning Squeak. YAY!</description><link>http://railsmonk.com/post/36987131</link><guid>http://railsmonk.com/post/36987131</guid><pubDate>Tue, 03 Jun 2008 16:09:58 +0800</pubDate></item><item><title>Tip: re-apply latest migration</title><description>&lt;code class="ruby"&gt;rake db:migrate:redo&lt;/code&gt;</description><link>http://railsmonk.com/post/35459005</link><guid>http://railsmonk.com/post/35459005</guid><pubDate>Wed, 21 May 2008 01:56:00 +0800</pubDate></item><item><title>my twitter</title><description>&lt;a href="http://twitter.com/railsmonk"&gt;my twitter&lt;/a&gt;</description><link>http://railsmonk.com/post/35349283</link><guid>http://railsmonk.com/post/35349283</guid><pubDate>Tue, 20 May 2008 03:39:36 +0800</pubDate></item><item><title>Productivity: Nice background noise generator</title><description>&lt;a href="http://www.blackholemedia.com/noise/"&gt;Productivity: Nice background noise generator&lt;/a&gt;: Creates really pleasant pink noise. For Mac.</description><link>http://railsmonk.com/post/35341955</link><guid>http://railsmonk.com/post/35341955</guid><pubDate>Tue, 20 May 2008 02:15:14 +0800</pubDate></item><item><title>Google AdSense made no sense for me. Turned it off</title><description>Google AdSense made no sense for me. Turned it off</description><link>http://railsmonk.com/post/35341712</link><guid>http://railsmonk.com/post/35341712</guid><pubDate>Tue, 20 May 2008 02:12:35 +0800</pubDate></item><item><title>Rails tip if you use association proxy methods</title><description>I like doing following in my code:

&lt;code class="ruby"&gt;&lt;pre&gt;class Blah &lt; ActiveRecord::Base
  has_many :somethings
end

class Something &lt; ActiveRecord::Base
  def self.for(person)
    find(:first, :conditions =&gt; {:owner_name =&gt; person})
  end
end 

# And then later
@the_blah.somethings.for("dima") # =&gt; #&lt;Something ....&gt; 
&lt;/pre&gt;&lt;/code&gt;

But I also can accidentally do this and break the expectation for the code, since I don’t have full conditions specified in the Something.for method:

&lt;p&gt;
&lt;code class="ruby"&gt;Something.for("dima")&lt;/code&gt;
&lt;/p&gt;

Right, no conditions from Blah will be applied and first Something with name “dima” will be returned. However, here’s a workaround I figured out, just write a Something.for method like this:

&lt;code class="ruby"&gt;&lt;pre&gt;class Something &lt; ActiveRecord::Base
  def self.for(person)
    raise unless scoped?(:find)
    find(:first, :conditions =&gt; {:owner_name =&gt; person})
  end
end&lt;/pre&gt;&lt;/code&gt;</description><link>http://railsmonk.com/post/35336825</link><guid>http://railsmonk.com/post/35336825</guid><pubDate>Tue, 20 May 2008 02:08:22 +0800</pubDate><category>rails</category><category>tips</category></item><item><title>Coworking: Social club or work space?</title><description>&lt;a href="http://feeds.feedburner.com/~r/Tidbit/~3/280956815/"&gt;Coworking: Social club or work space?&lt;/a&gt;: I started working at &lt;a href="http://indyhall.org"&gt;Indy Hall&lt;/a&gt; almost two weeks ago. Indy Hall is a coworking space in Old City, Philadelphia where people who would normally work at home can now work in an office with…</description><link>http://railsmonk.com/post/33349656</link><guid>http://railsmonk.com/post/33349656</guid><pubDate>Thu, 01 May 2008 03:06:41 +0800</pubDate></item><item><title>Viddler API RubyGem</title><description>&lt;a href="http://feeds.feedburner.com/~r/Tidbit/~3/273081127/"&gt;Viddler API RubyGem&lt;/a&gt;: This week we released a RubyGem for &lt;a href="http://wiki.developers.viddler.com/index.php/Main_Page"&gt;Viddler’s Video API&lt;/a&gt;. We created it for our &lt;a href="http://help.beanstalkapp.com"&gt;Beanstalk help system&lt;/a&gt; so we could upload video in each post, then pull back the player code to embed screen casts….</description><link>http://railsmonk.com/post/32176634</link><guid>http://railsmonk.com/post/32176634</guid><pubDate>Sat, 19 Apr 2008 03:16:07 +0800</pubDate></item><item><title>Beanstalk is moving to Engine Yard</title><description>&lt;a href="http://feeds.feedburner.com/~r/Tidbit/~3/261346077/"&gt;Beanstalk is moving to Engine Yard&lt;/a&gt;: If you haven’t noticed, &lt;a href="http://beanstalkapp.com"&gt;Beanstalk &lt;/a&gt;has been growing. With the growth we’ve also had some pains. In the last couple months our servers have been far from what we (or anyone else) would consider…</description><link>http://railsmonk.com/post/30372220</link><guid>http://railsmonk.com/post/30372220</guid><pubDate>Tue, 01 Apr 2008 00:44:46 +0800</pubDate></item><item><title>ING: Nice UI Transition</title><description>&lt;a href="http://feeds.feedburner.com/~r/Tidbit/~3/251606730/"&gt;ING: Nice UI Transition&lt;/a&gt;: I logged into my ING account and noticed a different welcome screen. They made an update to the navigation and instead of just making the change, I was notified upon login. This says a lot to me,…</description><link>http://railsmonk.com/post/28875780</link><guid>http://railsmonk.com/post/28875780</guid><pubDate>Sat, 15 Mar 2008 03:32:55 +0700</pubDate></item></channel></rss>
