<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>redemption in a blog</title>
	
	<link>http://blog.codefront.net</link>
	<description>Rails, Firefox, Anime, Mac</description>
	<lastBuildDate>Sun, 05 Jul 2009 07:01:03 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/riab" type="application/rss+xml" /><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2Friab" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Friab" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2Friab" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/riab" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2Friab" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2Friab" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2Friab" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><item>
		<title>Blog redesigned</title>
		<link>http://feedproxy.google.com/~r/riab/~3/fX7eTY5wOc4/</link>
		<comments>http://blog.codefront.net/2009/07/05/blog-redesigned/#comments</comments>
		<pubDate>Sun, 05 Jul 2009 06:50:00 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1212</guid>
		<description><![CDATA[After 5 long years of using the same old blog theme, which I&#8217;d handcrafted from scratch way back in 2004, I&#8217;ve finally got down to refreshing it to a more contemporary look. I&#8217;ve also updated the woefully outdated About page.
Here&#8217;s a before and after shot:

I think it&#8217;s much better, definitely more modern and minimalist.
The new [...]]]></description>
			<content:encoded><![CDATA[<p>After 5 long years of using the same old blog theme, which I&#8217;d handcrafted from scratch way back in 2004, I&#8217;ve finally got down to refreshing it to a more contemporary look. I&#8217;ve also updated the woefully outdated <a href="/about/">About page</a>.</p>
<p>Here&#8217;s a before and after shot:</p>
<p><img src="http://blog.codefront.net/wp-content/uploads/2009/07/blog-theme-before-and-after.png" alt="Blog theme - before and after" title="Blog theme - before and after" width="515" height="659" class="alignnone size-full wp-image-1214" /></p>
<p>I think it&#8217;s much better, definitely more modern and minimalist.</p>
<p>The new blog theme is basically a heavily modified version of the<br />
wonderful and free <a href="http://designdisease.com/blog/compositio-wordpress-theme/">Compositio WordPress theme</a> &#8211;<br />
you can check out a <a href="http://designdisease.com/preview/compositio">demo of Compositio here</a> to see how different it is.</p>
<p>The only thing I kept from my old theme, which I affectionately called &#8220;Clover&#8221;, was the same clover logo. I did that with the shape tool in Photoshop &#8211; it&#8217;s a simple logo and no skill was required to create it, obviously!</p>
<p>If you&#8217;re reading this in a feed reader or one of those aggreggator-type sites, you can help me out by checking out the blog itself and giving me some good old constructive criticism.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/hmPSmHdPLgtz29GaGm0vsK-e8LE/0/da"><img src="http://feedads.g.doubleclick.net/~a/hmPSmHdPLgtz29GaGm0vsK-e8LE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/hmPSmHdPLgtz29GaGm0vsK-e8LE/1/da"><img src="http://feedads.g.doubleclick.net/~a/hmPSmHdPLgtz29GaGm0vsK-e8LE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/fX7eTY5wOc4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2009/07/05/blog-redesigned/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2009/07/05/blog-redesigned/</feedburner:origLink></item>
		<item>
		<title>Upgraded to iPhone OS 3.0 and running out of battery fast?</title>
		<link>http://feedproxy.google.com/~r/riab/~3/Y2pENY7zFGA/</link>
		<comments>http://blog.codefront.net/2009/06/22/upgraded-to-iphone-os-3-0-and-running-out-of-battery-fast/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 14:31:47 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1177</guid>
		<description><![CDATA[After upgrading my girlfriend&#8217;s iPhone 3G to OS 3.0 recently, I noticed that the iPhone&#8217;s battery was getting depleted really quickly. I&#8217;d left it overnight with Wifi, 3G, Bluetooth, Push Notifications all off, and the battery went from 80% to a jaw-dropping OMGWTFBBQ 10%.
I attributed it to the recent jailbreak (I&#8217;ve already removed the jailbreak [...]]]></description>
			<content:encoded><![CDATA[<p>After upgrading my girlfriend&#8217;s iPhone 3G to OS 3.0 recently, I noticed that the iPhone&#8217;s battery was getting depleted really quickly. I&#8217;d left it overnight with Wifi, 3G, Bluetooth, Push Notifications all off, and the battery went from 80% to a jaw-dropping <em>OMGWTFBBQ</em> 10%.</p>
<p>I attributed it to the recent jailbreak (I&#8217;ve already removed the jailbreak trying to figure out this problem) at first. I only realized something was really wrong when the iPhone&#8217;s battery <strong>started draining while it was charging via USB</strong>!</p>
<p>Looking around on <a href="http://www.urbandictionary.com/define.php?term=interwebs">teh interwebs</a>, I managed to solve it (easily!) by following the suggestions from <a href=" http://discussions.apple.com/message.jspa?messageID=9664702">this thread at the Apple support forums</a>. Here&#8217;s what worked for me:</p>
<ol>
<li>Go to <strong>Settings</strong> on your iPhone.</li>
<li>Turn <strong>Notifications</strong> off. I&#8217;m not sure if this is necessary but did so just in case.</li>
<li>Go to <strong>Mail, Contacts, Calendars</strong> and <strong>delete all your accounts</strong> (I deleted even Calendar accounts just in case). You may want to write down or backup your account settings first.</li>
<li>Go to <strong>Fetch New Data</strong> (also in the same Mail, Contacts, Calendars settings) and make sure <strong>Push</strong> is <strong>Off</strong>.</li>
<li>It&#8217;s probably not necessary but you may want to restart your iPhone (power it on and off) here.</li>
<li>Add back all your accounts. You can turn <strong>Push</strong> back on <strong>Fetch New Data</strong> now.</li>
<li>You can also turn <strong>Notifications</strong> back on if you wish.</li>
</ol>
<p>It seems like the iPhone 3.0 OS update has a bug where email accounts with active push notifications were set to keep fetching new email even if push is turned off explicitly. Hopefully this post will help solve your battery problems, if not, you&#8217;ve gotta keep looking &#8211; the <a href="http://discussions.apple.com/forum.jspa?forumID=1139">Apple iPhone Support forums</a> is a good place to start.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/4t1JhO00cWW-qxyPS2dRrz4hY8s/0/da"><img src="http://feedads.g.doubleclick.net/~a/4t1JhO00cWW-qxyPS2dRrz4hY8s/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4t1JhO00cWW-qxyPS2dRrz4hY8s/1/da"><img src="http://feedads.g.doubleclick.net/~a/4t1JhO00cWW-qxyPS2dRrz4hY8s/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/Y2pENY7zFGA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2009/06/22/upgraded-to-iphone-os-3-0-and-running-out-of-battery-fast/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2009/06/22/upgraded-to-iphone-os-3-0-and-running-out-of-battery-fast/</feedburner:origLink></item>
		<item>
		<title>A curl-ier Curb – better cookie support in Curb</title>
		<link>http://feedproxy.google.com/~r/riab/~3/r6OSGyc6gZU/</link>
		<comments>http://blog.codefront.net/2009/06/18/better-cookie-support-in-curb/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 01:42:10 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1144</guid>
		<description><![CDATA[As of Curb 0.3.7, Curb comes with slightly better cookie support that makes it more &#8220;curl-like&#8221;.
It probably sounds like shameless self-promotion that I&#8217;m blogging about these changes since I&#8217;d contributed them. Well, yeah that&#8217;s true, but I&#8217;m also doing so because I doubt these changes will ever be made known since Curb doesn&#8217;t publicize any [...]]]></description>
			<content:encoded><![CDATA[<p>As of <a href="http://github.com/taf2/curb/tree/master">Curb</a> 0.3.7, Curb comes with slightly better cookie support that makes it more &#8220;<a href="http://curl.haxx.se/">curl</a>-like&#8221;.</p>
<p>It probably sounds like shameless self-promotion that I&#8217;m blogging about these changes since I&#8217;d contributed them. Well, yeah that&#8217;s true, but I&#8217;m also doing so because I doubt these changes will ever be made known since Curb doesn&#8217;t publicize any updates or changelogs. </p>
<p>Curb is my current number 1 HTTP client for Ruby so the more love it gets, the better.</p>
<h3>Passing cookies as a string in Curb requests</h3>
<p>Curl veterans will probably know how to do this with the curl binary:</p>
<pre><code>curl -b "auth=abcdef; ASP.NET_SessionId=lotsatext;" example.com</code></pre>
<p>This sends a request to example.com with 2 cookies named &#8220;auth&#8221; and &#8220;ASP.NET_SessionId&#8221; (I hate those big-ass ASP.NET cookies btw). There wasn&#8217;t a way to set this in Curb, so I looked up the <a href="http://curl.haxx.se/libcurl/c/">libcurl C API docs</a> and replicated the same option in Curb (<a href="http://github.com/taf2/curb/commit/3c3e53c64a2417f78aa19f593a5f66e3ddffc969">commit on Github</a>). An example:</p>
<pre><code class="ruby">curl = Curl::Easy.new('http://example.com/')
curl.cookies = 'auth=abcdef; ASP.NET_SessionId=big-wall-of-text;'
curl.perform</code></pre>
<p>Of course, the cookies will more often be retrieved/constructed rather than a literal like in the example above. In my case, I was proxying cookies while trying to wrap an API around a site that doesn&#8217;t have one.</p>
<h3>Passing cookies as a file via the &#8220;cookiefile&#8221; option</h3>
<p>The second change is the new <code>cookiefile</code> option. This replicates curl commands like these:</p>
<pre><code>curl -b cookies-to-send.txt www.example.com</code></pre>
<p>with something like this in ruby:</p>
<pre><code class="ruby">curl = Curl::Easy.new('http://example.com/')
curl.cookiefile = '/path/to/cookies-to-send.txt'
curl.perform</code></pre>
<p>The cookies file looks like this (you can get a sample with the <code>--cookie-jar</code> option to curl, e.g. <code>curl --cookie-jar cookies.txt www.wego.com</code>):</p>
<pre><code>www.wego.com	FALSE	/	FALSE	0	lang
www.wego.com	FALSE	/	FALSE	0	user_country_code	SG</code></pre>
<p>Check out the <a href="http://github.com/taf2/curb/commit/a4910c25198441796f8e6d1958e144998833c7ec">commit on Github</a> if you&#8217;re interested.</p>
<h3>Why would I use these?</h3>
<p>Now you might be wondering how these 2 changes are useful &#8211; well, they <em>are</em> totally irrelevant to you if you&#8217;re not expecting any cookie support in Curb. However, if you&#8217;re accessing or scraping a site that uses <strong>cookie-based authentication</strong>, these changes allow you to keep your Curb client authenticated across sessions, even when doing HTTP POSTs (Curb doesn&#8217;t send cookies properly in POST requests even if <code>curl.enable_cookies</code> is set).</p>
<p>I&#8217;ve found these changes to Curb particularly useful since I vastly prefer Curb to most HTTP clients for its speed and lightweight implementation, and heavier scraper-type HTTP clients like <a href="http://mechanize.rubyforge.org/mechanize/">Mechanize</a> are a last resort.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/EoE-EuEbhZuPpEoGPALxlRWTnn8/0/da"><img src="http://feedads.g.doubleclick.net/~a/EoE-EuEbhZuPpEoGPALxlRWTnn8/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/EoE-EuEbhZuPpEoGPALxlRWTnn8/1/da"><img src="http://feedads.g.doubleclick.net/~a/EoE-EuEbhZuPpEoGPALxlRWTnn8/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/r6OSGyc6gZU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2009/06/18/better-cookie-support-in-curb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2009/06/18/better-cookie-support-in-curb/</feedburner:origLink></item>
		<item>
		<title>Don’t kill your app when using ActiveRecord in Rails Metal, release your database connections</title>
		<link>http://feedproxy.google.com/~r/riab/~3/rrS2AG92Ksk/</link>
		<comments>http://blog.codefront.net/2009/06/15/activerecord-rails-metal-too-many-connections/#comments</comments>
		<pubDate>Mon, 15 Jun 2009 06:49:51 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1143</guid>
		<description><![CDATA[Rails Metal has been available on Rails since version 2.3 &#8211; it&#8217;s old news. But if you haven&#8217;t used it or heard about it, you can find out more about Rails Metal on the RoR weblog and on Jesse Newland&#8217;s blog.
So anyway, I am one of those laggards and only wrote a Rails Metal piece [...]]]></description>
			<content:encoded><![CDATA[<p>Rails Metal has been available on Rails since version 2.3 &#8211; it&#8217;s old news. But if you haven&#8217;t used it or heard about it, you can find out more about Rails Metal on the <a href="http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal">RoR weblog</a> and on <a href="http://soylentfoo.jnewland.com/articles/2008/12/16/rails-metal-a-micro-framework-with-the-power-of-rails-m">Jesse Newland&#8217;s blog</a>.</p>
<p>So anyway, I am one of those laggards and only wrote a Rails Metal piece not too long ago for a Rails app on <a href="http://www.wego.com/">Wego.com</a> in an effort to optimize some high volume requests. It looked something like this:</p>
<pre><code class="ruby">class Adamantine
  def self.call(env)
    if env['PATH_INFO'] =~ ROUTE_REGEX
      location = Location.find(1) # Use ActiveRecord.

      [200, { 'Content-Type' => 'text/html' }, [location.to_json]]
    else
      # Leave it to Rails to deal with the request.
      [404, { 'Content-Type' => 'text/html' }, ['Not Found']]
    end
  end
end</code></pre>
<p>Notice the use of an ActiveRecord model. It ran for quite awhile, almost 30 minutes, in <em>production</em> until I started getting notification emails about &#8220;<strong>Too many open database connections</strong>&#8221; to the MySQL server! The change was promptly rolled back and there was no cheezburger for me.</p>
<p><a href="http://icanhascheezburger.com/2008/04/25/funny-pictures-dam-it-dam-it-dam-it/"><img src="http://icanhascheezburger.wordpress.com/files/2008/04/funny-pictures-beaver-dam-it.jpg" alt="dam it!" /></a></p>
<p>As it turns out, Rails doesn&#8217;t take care of certain things in Rails Metal pieces, including the releasing of connections back to the database connection pool. A bit of googling turned up this <a href="https://rails.lighthouseapp.com/projects/8994/tickets/1882-rails-metal-with-activerecord-too-slow">bug in Rails&#8217; bug tracker</a> (see Josh Peek&#8217;s comment about <code>ActiveRecord::Base.clear_active_connections!</code>).</p>
<p>I rewrote the Rails Metal piece to always ensure it clears any active database connections with <code>ActiveRecord::Base.clear_active_connections!</code>:</p>
<pre><code class="ruby">class Adamantine
  def self.call(env)
    if env['PATH_INFO'] =~ ROUTE_REGEX
      location = Location.find(1)

      [200, { 'Content-Type' => 'text/html' }, [location.to_json]]
    else
      # Leave it to Rails to deal with the request.
      [404, { 'Content-Type' => 'text/html' }, ['Not Found']]
    end
  ensure
    # Release the connections back to the pool.
    ActiveRecord::Base.clear_active_connections!
  end
end</code></pre>
<p>Moral of the story: Don&#8217;t forget to release your database connections if you&#8217;re using ActiveRecord in your Rails Metal. Or even better, don&#8217;t use ActiveRecord in Rails Metal &#8211; you&#8217;re aiming for raw speed anyway right?</p>

<p><a href="http://feedads.g.doubleclick.net/~a/KEW18dFZpWExwNKox5JclCB6A5I/0/da"><img src="http://feedads.g.doubleclick.net/~a/KEW18dFZpWExwNKox5JclCB6A5I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/KEW18dFZpWExwNKox5JclCB6A5I/1/da"><img src="http://feedads.g.doubleclick.net/~a/KEW18dFZpWExwNKox5JclCB6A5I/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/rrS2AG92Ksk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2009/06/15/activerecord-rails-metal-too-many-connections/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2009/06/15/activerecord-rails-metal-too-many-connections/</feedburner:origLink></item>
		<item>
		<title>I’m still alive, and on FriendFeed and Twitter</title>
		<link>http://feedproxy.google.com/~r/riab/~3/k2ls-XxTpAA/</link>
		<comments>http://blog.codefront.net/2009/03/24/im-still-alive-and-on-friendfeed-and-twitter/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 14:48:58 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Blogging]]></category>
		<category><![CDATA[Personal]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1136</guid>
		<description><![CDATA[Wow, it seems like I haven&#8217;t posted anything this year. Don&#8217;t worry, you aren&#8217;t rid of me yet. I&#8217;m still alive and posting updates to FriendFeed and (less often) to Twitter.
If you belong to what I imagine must be now the microscopic population of loyal readers of my blog, please do hook up with me [...]]]></description>
			<content:encoded><![CDATA[<p>Wow, it seems like I haven&#8217;t posted anything this year. Don&#8217;t worry, you aren&#8217;t rid of me yet. I&#8217;m still alive and posting updates to <a href="http://friendfeed.com/chuyeow">FriendFeed</a> and (less often) to <a href="http://twitter.com/chuyeow">Twitter</a>.</p>
<p>If you belong to what I imagine must be now the microscopic population of loyal readers of my blog, please do hook up with me on <a href="http://friendfeed.com/chuyeow">FriendFeed</a> or <a href="http://twitter.com/chuyeow">Twitter</a>. I&#8217;ll follow you back if you&#8217;re a reader!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/RdBien6_t3Ly-kiQV9-68Ap6CvM/0/da"><img src="http://feedads.g.doubleclick.net/~a/RdBien6_t3Ly-kiQV9-68Ap6CvM/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/RdBien6_t3Ly-kiQV9-68Ap6CvM/1/da"><img src="http://feedads.g.doubleclick.net/~a/RdBien6_t3Ly-kiQV9-68Ap6CvM/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/k2ls-XxTpAA" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2009/03/24/im-still-alive-and-on-friendfeed-and-twitter/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2009/03/24/im-still-alive-and-on-friendfeed-and-twitter/</feedburner:origLink></item>
		<item>
		<title>Dragging tab to a new window coming to Firefox</title>
		<link>http://feedproxy.google.com/~r/riab/~3/uCkdyQIxBL8/</link>
		<comments>http://blog.codefront.net/2008/11/16/dragging-tab-to-a-new-window-coming-to-firefox/#comments</comments>
		<pubDate>Sun, 16 Nov 2008 14:15:05 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1132</guid>
		<description><![CDATA[Completely by accident, I discovered that you can now drag a tab out from its current window to a new window in a recent Firefox nightly. A short video 24-second better explains what I&#8217;m talking about:

This tab tearing capability is a pretty neat feature &#8211; I know you can already do this in Safari, Opera [...]]]></description>
			<content:encoded><![CDATA[<p>Completely by accident, I discovered that you can now drag a tab out from its current window to a new window in a recent Firefox nightly. A short video 24-second better explains what I&#8217;m talking about:</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/yecyFamSh6c&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/yecyFamSh6c&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>This tab tearing capability is a pretty neat feature &#8211; I know you can already do this in Safari, Opera and Galeon. It&#8217;s really well done in Safari, which I think is what Firefox is emulating. Nice to see Firefox follow suit!</p>
<p>If you can&#8217;t wait for Firefox 3.1, try it out in a recent <a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/latest-trunk/">Firefox nighty build</a> (remember to <a href="http://support.mozilla.com/en-US/kb/Managing+profiles">use a new profile</a> unless you are willing to risk corrupting your daily profile).</p>

<p><a href="http://feedads.g.doubleclick.net/~a/EJahIkdAmKHcVR950h_S8_iiyKQ/0/da"><img src="http://feedads.g.doubleclick.net/~a/EJahIkdAmKHcVR950h_S8_iiyKQ/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/EJahIkdAmKHcVR950h_S8_iiyKQ/1/da"><img src="http://feedads.g.doubleclick.net/~a/EJahIkdAmKHcVR950h_S8_iiyKQ/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/uCkdyQIxBL8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/11/16/dragging-tab-to-a-new-window-coming-to-firefox/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/11/16/dragging-tab-to-a-new-window-coming-to-firefox/</feedburner:origLink></item>
		<item>
		<title>Optimize Firefox’s memory usage by tweaking session preferences</title>
		<link>http://feedproxy.google.com/~r/riab/~3/TXurQJR9M3U/</link>
		<comments>http://blog.codefront.net/2008/09/10/optimize-firefoxs-memory-usage-by-tweaking-session-preferences/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 12:57:24 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1130</guid>
		<description><![CDATA[I&#8217;m a heavy tabbed browsing user &#8211; I have around 30 tabs open in my day-to-day Firefox profile all the time. Since the day Firefox 3 was released, I&#8217;ve noticed Firefox progressively getting slower with this particular Firefox profile (I use a different profile for web development). When it got to the point where changing [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a heavy tabbed browsing user &#8211; I have around 30 tabs open in my day-to-day Firefox profile all the time. Since the day Firefox 3 was released, I&#8217;ve noticed Firefox progressively getting slower with this particular Firefox profile (I use a different profile for web development). When it got to the point where changing tabs took a noticeable pause of 1-2 seconds, I tweaked some of Firefox&#8217;s session store and history preferences and now things are blazing fast again.</p>
<p>Here&#8217;s what you can do:</p>
<ol>
<li>Go to <a href="about:config">about:config</a> in Firefox.</li>
<li>Type in &#8220;session&#8221; in the &#8220;Filter&#8221; box.</li>
<li>Edit <strong>browser.sessionhistory.max_entries</strong> &#8211; this is the number of pages stored in the history of your browsing session. Basically these are pages that can be reached using your Back and Forward buttons. The default is 50 &#8211; I reduced it to 20.</li>
<li>Edit <strong>browser.sessionhistory.max_total_viewers</strong> &#8211; this is the number of pages that are stored in RAM so that they aren&#8217;t re-processed by Firefox&#8217;s rendering engine. This is what allows you to go Back to a page in Firefox and have it load almost instantaneously. The number of pages stored actually depends on the amount of RAM on your machine (<a href="http://kb.mozillazine.org/Browser.sessionhistory.max_total_viewers">see this</a>). I reduced this to 4 (I have 2GB RAM).</li>
<li>Edit <strong><a href="http://kb.mozillazine.org/Browser.sessionstore.max_tabs_undo">browser.sessionstore.max_tabs_undo</a></strong> &#8211; the number of tabs you can restore after closing them (you can do this with Ctrl/Cmd-Shift-T). The default of 10 is more than I really need, so I reduced it to 3 tabs.</li>
<li>Edit <strong><a href="http://kb.mozillazine.org/Browser.sessionstore.interval">browser.sessionstore.interval</a></strong> &#8211; Firefox saves your session after every 10 seconds by default. I changed this to a more conservative 30000 milliseconds.</li>
</ol>
<p>You can <a href="http://kb.mozillazine.org/About:config_entries">read more about these preferences and more at the MozillaZine Knowledge Base</a>. If you&#8217;ve any tips on how to improve Firefox&#8217;s performance, be sure to share!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/4yA5gH2--hXuZ5xE_j6P4rP_E70/0/da"><img src="http://feedads.g.doubleclick.net/~a/4yA5gH2--hXuZ5xE_j6P4rP_E70/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/4yA5gH2--hXuZ5xE_j6P4rP_E70/1/da"><img src="http://feedads.g.doubleclick.net/~a/4yA5gH2--hXuZ5xE_j6P4rP_E70/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/TXurQJR9M3U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/09/10/optimize-firefoxs-memory-usage-by-tweaking-session-preferences/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/09/10/optimize-firefoxs-memory-usage-by-tweaking-session-preferences/</feedburner:origLink></item>
		<item>
		<title>Sass with Rails – avoiding disappearing stylesheets in production</title>
		<link>http://feedproxy.google.com/~r/riab/~3/O0NCPADBsl0/</link>
		<comments>http://blog.codefront.net/2008/08/07/sass-with-rails-avoiding-disappearing-stylesheets-in-production/#comments</comments>
		<pubDate>Thu, 07 Aug 2008 13:57:33 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1128</guid>
		<description><![CDATA[A few days ago I noticed that some of the pages on the Hotels app on wego.com were completely unstyled. They turned out looking rather Jakob Nielsen-istic:


But we were attached to our ugly shade of green to leave those pages in their naked glory. Preliminary CSI work told me that some cached stylesheets generated by [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I noticed that some of the pages on the <a href="http://wego.com/hotels/">Hotels app on wego.com</a> were completely unstyled. They turned out looking rather <a href="http://www.useit.com/">Jakob Nielsen-istic</a>:</p>
<div class="img"><img src="http://blog.codefront.net/wp-content/uploads/2008/08/wegocom-hotels-no-css.png" alt="Wego.com Hotels - no CSS" /></div>
<p><br style="clear: both;" /></p>
<p>But we were attached to our ugly shade of green to leave those pages in their naked glory. Preliminary CSI work told me that <em>some</em> cached stylesheets generated by Rails were empty files. Why is this is happening?</p>
<h3>stylesheet_link_tag and the :cache option</h3>
<p>Was I overriding the stylesheets generated by Rails in different pages? Because we have a lot of cobranded sites and country sites on wego.com, I use the <code>:cache</code> option when using <code>stylesheet_link_tag</code> very often.</p>
<p>For example, the main wego.com site&#8217;s layout template has a <code>stylesheet_link_tag</code> like this (in reality there are a whole lot more stylesheets):</p>
<pre><code class="ruby">&lt;%= stylesheet_link_tag 'yui/reset-fonts', 'search',  :cache =&gt; 'cache/search/listings' %&gt;</code></pre>
<p>When I need to make a new page for a cobranded site, I&#8217;ll create a new layout template with this:</p>
<pre><code class="ruby">&lt;%= stylesheet_link_tag 'yui/reset-fonts', 'search', "sites/#{current_site}/cobrand", :cache => "cache/#{current_site}/search/listings" %&gt;</code></pre>
<p>Oftentimes I&#8217;d copy and paste (boo and hiss all you want!) the <code>stylesheet_link_tag</code> from one layout template to another and forget to update the cache path (the <code>:cache => '/path/to/stylesheet'</code> part). Two different stylesheet sets being cached to the same path is naturally a very stupid thing to do. So this wasn&#8217;t it, but it&#8217;s good to point this out because I have made this mistake at least 2 times!</p>
<h3>Don&#8217;t check in generated CSS files by accident</h3>
<p>Next, since I was using <a href="http://haml.hamptoncatlin.com/docs/rdoc/classes/Sass.html">Sass</a>, I was by now pretty sure that was it. First things first: did I check in a generated CSS file into source control (we use Git)? It&#8217;s another amateur mistake, but unsurprisingly, I&#8217;ve done this a couple of times. I think I&#8217;d wasted about an hour hunting down the reason for a style change that just wouldn&#8217;t show up. Yeah, I could have just added <code>*.css</code> to <code>.gitignore</code>, but I&#8217;m still using a mix of pure CSS and Sass templates.</p>
<h3>The problem</h3>
<p>In the end, I found this <a href="http://blog.citrusbyte.com/2008/3/20/sass-production-woes-rails/">blog post</a> by Ari Lerner on the <a href="http://blog.citrusbyte.com/">CitrusByte blog</a> about similar woes with Sass in production that set me on the path to a solution. It seems that when Rails encounters <code>stylesheet_link_tag</code> calls, it starts to pull together all the stylesheets and sometimes Sass is unable to generate the CSS files fast enough. Rails then throws an exception about not being able to find the CSS files and outputs an <strong>empty</strong> CSS file to the cache path.</p>
<h3>The solution</h3>
<p>The solution? Generate all the CSS files from Sass templates prior to restarting Rails when deploying. I added a rake task for updating all the Sass stylesheets:</p>
<pre><code class="ruby">namespace :sass do
  desc 'Updates stylesheets if necessary from their Sass templates.'
  task :update =&gt; :environment do
    Sass::Plugin.update_stylesheets
  end
end</code></pre>
<p>Then, I created a mirror of this as a Capistrano task:</p>
<pre><code class="ruby">namespace :sass do
  desc 'Updates the stylesheets generated by Sass'
  task :update, :roles =&gt; :app do
    invoke_command "cd #{latest_release}; RAILS_ENV=#{rails_env} rake sass:update"
  end

  # Generate all the stylesheets manually (from their Sass templates) before each restart.
  before 'deploy:restart', 'sass:update'
end</code></pre>
<p>Now, whenever I do a <code>cap deploy</code>, the stylesheets are generated before the Rails processes are restarted, ensuring that Rails&#8217; <code>stylesheet_link_tag</code> helper is always able to find the pure CSS files when trying to merge them together and caching them to a single file.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/ck3XLI5Vl8KJ7LhsrbwXYS5WVdk/0/da"><img src="http://feedads.g.doubleclick.net/~a/ck3XLI5Vl8KJ7LhsrbwXYS5WVdk/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/ck3XLI5Vl8KJ7LhsrbwXYS5WVdk/1/da"><img src="http://feedads.g.doubleclick.net/~a/ck3XLI5Vl8KJ7LhsrbwXYS5WVdk/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/O0NCPADBsl0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/08/07/sass-with-rails-avoiding-disappearing-stylesheets-in-production/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/08/07/sass-with-rails-avoiding-disappearing-stylesheets-in-production/</feedburner:origLink></item>
		<item>
		<title>Reveal currently open files in Mac OS X</title>
		<link>http://feedproxy.google.com/~r/riab/~3/LzoLiOYzWP4/</link>
		<comments>http://blog.codefront.net/2008/06/28/reveal-currently-open-files-in-mac-os-x/#comments</comments>
		<pubDate>Sat, 28 Jun 2008 06:10:05 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1124</guid>
		<description><![CDATA[Something I noticed completely by accident today when I clicked on the titlebar of QuickTime Player today with the Cmd key held down. The &#8220;titlebar&#8221; is this thing here &#8211; I&#8217;m not sure that&#8217;s the right name for it:


Anyway, if you hold down the Cmd key (aka the Apple key), a menu pops up that [...]]]></description>
			<content:encoded><![CDATA[<p>Something I noticed completely by accident today when I clicked on the titlebar of QuickTime Player today with the Cmd key held down. The &#8220;titlebar&#8221; is this thing here &#8211; I&#8217;m not sure that&#8217;s the right name for it:</p>
<div class="img"><a href="http://blog.codefront.net/wp-content/uploads/2008/06/qt-titlebar.png"><img src="http://blog.codefront.net/wp-content/uploads/2008/06/qt-titlebar.png" alt="" title="QuickTime titlebar" /></a></div>
<p><br style="clear: both;" /></p>
<p>Anyway, if you hold down the Cmd key (aka the Apple key), a menu pops up that shows the folder hierarchy of where the currently opened QuickTime movie is in your filesystem:</p>
<div class="img"><a href="http://blog.codefront.net/wp-content/uploads/2008/06/qt-title-bar-expanded.png"><img src="http://blog.codefront.net/wp-content/uploads/2008/06/qt-title-bar-expanded.png" alt="" title="QuickTime Player with \&quot;Reveal file\&quot; menu" /></a></div>
<p><br style="clear: both;" /></p>
<p>This works in all Mac apps that display the filename of the currently open/focused file in the titlebar.</p>
<p>It&#8217;s useful for me since my <acronym title="Nerd ADD">NADD</acronym> means I try to close as many unused windows as possible to adhere to my Cmd-Tab diet &#8211; now I can close Finder windows after opening files and be sure that I can get back to them quickly. What about <a href="http://www.blacktree.com/">QuickSilver</a>? Yup, I do use (and love) QuickSilver but I don&#8217;t let it catalog every single file!</p>
<p>Another nice thing about this is that I can easily reveal files in Finder in my favorite text editor (TextMate) without needing to use the project drawer:</p>
<div class="img"><a href="http://blog.codefront.net/wp-content/uploads/2008/06/textmate-expanded.png"><img src="http://blog.codefront.net/wp-content/uploads/2008/06/textmate-expanded.png" alt="" title="TextMate with \&quot;Reveal file\&quot; menu" width="300" height="214" /></a></div>
<p><br style="clear: both;" /></p>

<p><a href="http://feedads.g.doubleclick.net/~a/x5Y2q7s_abcteWxIb0zHsmdCLmE/0/da"><img src="http://feedads.g.doubleclick.net/~a/x5Y2q7s_abcteWxIb0zHsmdCLmE/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/x5Y2q7s_abcteWxIb0zHsmdCLmE/1/da"><img src="http://feedads.g.doubleclick.net/~a/x5Y2q7s_abcteWxIb0zHsmdCLmE/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/LzoLiOYzWP4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/06/28/reveal-currently-open-files-in-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/06/28/reveal-currently-open-files-in-mac-os-x/</feedburner:origLink></item>
		<item>
		<title>Living on the Edge (of Rails) has a new home at the Official Ruby on Rails weblog</title>
		<link>http://feedproxy.google.com/~r/riab/~3/FBFNh-Qh9U4/</link>
		<comments>http://blog.codefront.net/2008/06/22/living-on-the-edge-of-rails-has-a-new-home-at-the-official-ruby-on-rails-weblog/#comments</comments>
		<pubDate>Sun, 22 Jun 2008 09:55:39 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1123</guid>
		<description><![CDATA[You may have heard of it, but just in case, Living on the Edge is now going to be published on the official Ruby on Rails weblog. Big thanks to Gregg Pollack for getting me the new &#8220;gig&#8221;, and more importantly, for reviving and freshening up the content on the official Rails blog.
Catch the new [...]]]></description>
			<content:encoded><![CDATA[<p>You may have <a href="http://weblog.rubyonrails.org/2008/6/10/two-new-weekly-columns">heard of it</a>, but just in case, <a href="http://blog.codefront.net/category/edge-rails/">Living on the Edge</a> is now going to be published on the <a href="http://weblog.rubyonrails.org/">official Ruby on Rails weblog</a>. Big thanks to <a href="http://railsenvy.com/">Gregg Pollack</a> for getting me the new &#8220;gig&#8221;, and more importantly, for reviving and freshening up the content on the official Rails blog.</p>
<p>Catch the new first edition &#8211; this one&#8217;s about the <a href="http://weblog.rubyonrails.org/2008/6/20/living-on-the-edge-or-what-s-new-in-edge-rails-1-api-changes-and-performancetests">API changes since Rails 2.1</a>.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/a5c5tQjlu1_CEG5ty4UWGlub5i4/0/da"><img src="http://feedads.g.doubleclick.net/~a/a5c5tQjlu1_CEG5ty4UWGlub5i4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/a5c5tQjlu1_CEG5ty4UWGlub5i4/1/da"><img src="http://feedads.g.doubleclick.net/~a/a5c5tQjlu1_CEG5ty4UWGlub5i4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/FBFNh-Qh9U4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/06/22/living-on-the-edge-of-rails-has-a-new-home-at-the-official-ruby-on-rails-weblog/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/06/22/living-on-the-edge-of-rails-has-a-new-home-at-the-official-ruby-on-rails-weblog/</feedburner:origLink></item>
		<item>
		<title>RailsConf 2008 Day 1 – pics and a summary</title>
		<link>http://feedproxy.google.com/~r/riab/~3/xCJkhPu4ShI/</link>
		<comments>http://blog.codefront.net/2008/05/30/railsconf-2008-day-1-pics-and-a-summary/#comments</comments>
		<pubDate>Fri, 30 May 2008 05:32:11 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1111</guid>
		<description><![CDATA[Day 1 of RailsConf 2008 was basically tutorial day (schedule) and started with my colleague here with me, Arun, missing out on Yoga on Rails and me sleeping until the first tutorial session. Anyway, I snapped some photos while trying to remain the unobtrusive tourist.
Here&#8217;s a shot of Portland Convention Center where it&#8217;s all happening:


There&#8217;re [...]]]></description>
			<content:encoded><![CDATA[<p>Day 1 of <a href="http://en.oreilly.com/rails2008/public/content/home">RailsConf 2008</a> was basically tutorial day (<a href="http://en.oreilly.com/rails2008/public/schedule/grid?date=2008-05-29">schedule</a>) and started with my colleague here with me, <a href="http://arunthampi.wordpress.com/">Arun</a>, missing out on <a href="http://en.oreilly.com/rails2008/public/schedule/detail/4417">Yoga on Rails</a> and me sleeping until the first tutorial session. Anyway, I snapped some photos while trying to remain the unobtrusive tourist.</p>
<p>Here&#8217;s a shot of Portland Convention Center where it&#8217;s all happening:</p>
<div class="img"><img src="http://blog.codefront.net/wp-content/uploads/2008/05/portland-convention-center-twin-peaks.jpg" alt="Portland Convention Center - twin peaks outside" /></div>
<p><br style="clear: both;" /></p>
<p>There&#8217;re queues for collection of badges after registering your attendance:</p>
<div class="img"><img src="http://blog.codefront.net/wp-content/uploads/2008/05/railsconf-day-1-registration-3.jpg" alt="RailsConf Day 1 - registration queue" /></div>
<p><br style="clear: both;" /></p>
<p>Patience in the queue rewarded me with a RailsConf badge/name tag:</p>
<div class="img"><img src="http://blog.codefront.net/wp-content/uploads/2008/05/railsconf-badge.jpg" alt="RailsConf badge" /></div>
<p><br style="clear: both;" /></p>
<p>I was at the <a href="http://en.oreilly.com/rails2008/public/schedule/detail/1862">Meta-programming Ruby for Fun &amp; Profit</a> tutorial in the morning. I think when I selected the tutorial it was before I&#8217;d seen Neal Ford and Patrick Farley&#8217;s (the speakers) presentation videos from elsewhere &#8211; I know <a href="http://mtnwestrubyconf2008.confreaks.com/11farley.html">Patrick presented at MWRC</a> and enjoyed that video.</p>
<div class="img"><img src="http://blog.codefront.net/wp-content/uploads/2008/05/railsconf-day-1-metaprogramming-tutorial-1.jpg" alt="RailsConf day 1 - metaprogramming tutorial" /></div>
<p><br style="clear: both;" /></p>
<p>So anyway, after the break I went over to the <a href="http://en.oreilly.com/rails2008/public/schedule/detail/1962">Refactoring Your Rails Application</a> tutorial. Was pretty good, but I didn&#8217;t learn much I didn&#8217;t already know.</p>
<p>Lunch came in the form of a pretty box:</p>
<div class="img"><img src="http://blog.codefront.net/wp-content/uploads/2008/05/railsconf-day-1-lunch.jpg" alt="RailsConf day 1 - lunch" /></div>
<p><br style="clear: both;" /></p>
<p>After lunch was the 2nd tutorial session and I went to both <a href="http://en.oreilly.com/rails2008/public/schedule/detail/2072">CI for the Rails Guy (or Gal)</a> (by Chad Woolley) and <a href="http://en.oreilly.com/rails2008/public/schedule/detail/1993">Developer Testing Tricks</a> (by Brian Takita). There were some scathing comments about how the tutorials were rather underwhelming so far in <a href="irc://irc.freenode.net/railsconf">#railsconf</a> on IRC. While I agree that the tutorials were rather underwhelming, I think I should have expected it. Oh well, I&#8217;ll know to skip them next time.</p>
<p>Later that night, at the Birds of a Feather session, after stealing a <a href="http://www.pivotalabs.com/">Pivotal Labs t-shirt</a> (they&#8217;re launching a bug tracker, project management type app called <a href="http://www.pivotaltracker.com/">Pivotal Tracker</a> at RailsConf), Yehuda Katz (Merb and jQuery ninja) gave a presentation on Merb (geared towards Rails folks). It was a pretty interesting talk though there wasn&#8217;t much above what Ezra had <a href="http://goruco2008.confreaks.com/06_zygmuntowicz.html">presented previously at GoRuCo 2008</a> and <a href="http://mwrc2008.confreaks.com/02zygmuntowicz.html">at MWRC 2008</a> (I think Yehuda did one too but I can&#8217;t remember where now). Yehuda pointed out a <a href="http://groups.google.com/group/merb/browse_thread/thread/2536bff7d9195b83">(heated) discussion that happened recently</a> on keeping Merb syntax as Rails-friendly as possible. I have no objection against a different syntax really, especially since Merb looks pretty well-documented in the source itself &#8211; would be nice if someone could point out an up-to-date Merb tutorial though.</p>
<p>Anyway, that&#8217;s it from me &#8211; as always, if anyone who reads my blog <a href="http://www.facebook.com/profile.php?id=500115784">recognizes me</a> at RailsConf, do say hi (<a href="irc://irc.freenode.net/railsconf">#railsconf</a> works too).</p>

<p><a href="http://feedads.g.doubleclick.net/~a/HENpKg07XY1Ct9XDWugFOGrQISs/0/da"><img src="http://feedads.g.doubleclick.net/~a/HENpKg07XY1Ct9XDWugFOGrQISs/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/HENpKg07XY1Ct9XDWugFOGrQISs/1/da"><img src="http://feedads.g.doubleclick.net/~a/HENpKg07XY1Ct9XDWugFOGrQISs/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/xCJkhPu4ShI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/05/30/railsconf-2008-day-1-pics-and-a-summary/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/05/30/railsconf-2008-day-1-pics-and-a-summary/</feedburner:origLink></item>
		<item>
		<title>Living on the edge (of Rails) #22 – pre-Railsconf 2008 edition</title>
		<link>http://feedproxy.google.com/~r/riab/~3/8DaZmLCZvAM/</link>
		<comments>http://blog.codefront.net/2008/05/25/living-on-the-edge-of-rails-22-pre-railsconf-2008-edition/#comments</comments>
		<pubDate>Sun, 25 May 2008 11:06:36 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Edge Rails]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1110</guid>
		<description><![CDATA[No mind-blowing changes in Rails this week prior to RailsConf &#8211; as Gregg mentioned last week in the Rails Envy podcast, it&#8217;s pre-2.1 days (Rails 2.1 will probably be released at RailsConf) so it&#8217;s pretty easy to see why. Oh and all Rails tests now pass in Ruby 1.9 after a long-standing #module_eval bug got [...]]]></description>
			<content:encoded><![CDATA[<p>No mind-blowing changes in Rails this week prior to RailsConf &#8211; as Gregg mentioned last week in the <a href="http://railsenvy.com/2008/5/21/rails-envy-podcast-episode-032">Rails Envy podcast</a>, it&#8217;s pre-2.1 days (Rails 2.1 will <em>probably</em> be released at RailsConf) so it&#8217;s pretty easy to see why. Oh and all Rails tests now pass in Ruby 1.9 after a long-standing <code>#module_eval</code> bug got fixed in Ruby 1.9&#8217;s trunk (see <a href="http://groups.google.com/group/ruby-core-google/browse_thread/thread/6d08e11363bf49b4">thread</a> for more details).</p>
<p>I&#8217;ll be at (my first) Railsconf 2008 in Portland, Oregon this Thursday onwards &#8211; if anyone sees me and recognizes me from my <a href="http://www.facebook.com/people/Chu_Yeow/500115784">Facebook picture</a> please come and say hi (no head butting though).</p>
<p>This week’s report covers changes from 19th May 2008 to 25th May 2008 (the day the corresponding <a href="http://railsenvy.com/podcast/">Rails Envy podcast</a> was recorded).</p>
<h3>first and last methods now work with associations and named_scope</h3>
<p>Remember how the <a href="http://blog.codefront.net/2008/04/05/living-on-the-edge-of-rails-14-the-extreme-edition-extremely-late/">merging of the has_finder gem into Rails</a> allowed you to do things like <code>Post.first</code> and <code>Post.last</code>?</p>
<p>Now you can go one step further and use the same methods on your ActiveRecord associations. For example:</p>
<pre><code class="ruby">post = Post.find(1)
first_comment = post.comments.first</code></pre>
<p>If you have a <a href="http://ryandaigle.com/articles/2008/3/24/what-s-new-in-edge-rails-has-finder-functionality">named_scope</a> named <code>recent</code> defined, you can even do this:</p>
<pre><code class="ruby">post.comments.recent.last</code></pre>
<p>This neat little enhancement is courtesy of <a href="http://railscasts.com/">Ryan Bates</a> (yes, that <em>Ryan Bates</em> of <a href="http://railscasts.com/">Railscasts</a> fame).</p>
<p>Related changeset: <a href="http://github.com/rails/rails/commit/73c59638549686fccc749ffd3ac53cb533c5fd61">http://github.com/rails/rails/commit/73c59638549686fccc749ffd3ac53cb533c5fd61</a></p>
<h3>Cache stores now have an exist? method and controllers get fragment_exist?</h3>
<p>The cache stores in Rails (Memcache, file stores, etc.) now have an <code>exist?</code> method that checks whether a cached value exists given a cache key. This allows Rails controllers to expose a <code>fragment_exist?<br />
</code> method that allows you to check for existence of a cache fragment:</p>
<pre><code class="ruby">fragment_exist?('example.com/foo/bar')</code></pre>
<p>This little enhancement is courtesy of <a href="http://josevalim.blogspot.com/">José Valim</a>.</p>
<p>Related changeset: <a href="http://github.com/rails/rails/commit/99860b72aebe0348f41e82d4710343498d89a84b#diff-2">http://github.com/rails/rails/commit/99860b72aebe0348f41e82d4710343498d89a84b#diff-2</a></p>
<h3>Create association records with block argument</h3>
<p>You can now create records for associations like so:</p>
<pre><code class="ruby">post.coments.create!(:title => 'Techcrunch') do |c|
  c.body = "Rails can't scale"
end</code></pre>
<p>This is in keeping with the <a href="http://blog.codefront.net/2008/05/04/living-on-the-edge-of-rails-19-change_table-for-migrations-and-more/">ActiveRecord::Base.create change previously mentioned</a>.</p>
<p>Credit for this patch goes (once again) to <a href="http://railscasts.com/">Ryan Bates</a>.</p>
<p>Related changeset: <a href="http://github.com/rails/rails/commit/6cba97d2a449faf21aec9fe9d4434067e414226f">http://github.com/rails/rails/commit/6cba97d2a449faf21aec9fe9d4434067e414226f</a></p>
<p>As always, let me know of any suggestions or how I can improve the Living on the Edge (of Rails) series.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/w8rNU9a4hYaT943YgrQWW935pDw/0/da"><img src="http://feedads.g.doubleclick.net/~a/w8rNU9a4hYaT943YgrQWW935pDw/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/w8rNU9a4hYaT943YgrQWW935pDw/1/da"><img src="http://feedads.g.doubleclick.net/~a/w8rNU9a4hYaT943YgrQWW935pDw/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/8DaZmLCZvAM" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/05/25/living-on-the-edge-of-rails-22-pre-railsconf-2008-edition/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/05/25/living-on-the-edge-of-rails-22-pre-railsconf-2008-edition/</feedburner:origLink></item>
		<item>
		<title>Living on the Edge (of Rails) in Spanish</title>
		<link>http://feedproxy.google.com/~r/riab/~3/73vGnYKYNRI/</link>
		<comments>http://blog.codefront.net/2008/05/18/living-on-the-edge-of-rails-in-spanish/#comments</comments>
		<pubDate>Sun, 18 May 2008 12:16:18 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Asides]]></category>
		<category><![CDATA[Edge Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1109</guid>
		<description><![CDATA[Juan Lupión wrote in to inform me that he&#8217;s also translating my Living on the Edge (of Rails) series of blog posts to Español. Thanks Juan!
]]></description>
			<content:encoded><![CDATA[<p><a href="http://sobrerailes.com/">Juan Lupión</a> wrote in to inform me that he&#8217;s also translating my Living on the Edge (of Rails) series of blog posts to Español. Thanks Juan!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/QA-HmfbktRALnVDLPi7_bODbC1I/0/da"><img src="http://feedads.g.doubleclick.net/~a/QA-HmfbktRALnVDLPi7_bODbC1I/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/QA-HmfbktRALnVDLPi7_bODbC1I/1/da"><img src="http://feedads.g.doubleclick.net/~a/QA-HmfbktRALnVDLPi7_bODbC1I/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/73vGnYKYNRI" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/05/18/living-on-the-edge-of-rails-in-spanish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/05/18/living-on-the-edge-of-rails-in-spanish/</feedburner:origLink></item>
		<item>
		<title>Living on the edge (of Rails) #21</title>
		<link>http://feedproxy.google.com/~r/riab/~3/y05yBsXvKjQ/</link>
		<comments>http://blog.codefront.net/2008/05/18/living-on-the-edge-of-rails-21/#comments</comments>
		<pubDate>Sun, 18 May 2008 11:54:42 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Edge Rails]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1108</guid>
		<description><![CDATA[It&#8217;s another slow week (just 2 changes of note imho) after the release of the 1st Release Candidate (RC1) of Rails 2.1. Follow that link for installation instructions &#8211; though if you&#8217;re reading this blog post you probably don&#8217;t care! (because you&#8217;re, you know, &#8220;living on the edge&#8221;). Cheesiness aside, be sure to report any [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s another slow week (just 2 changes of note <acronym title="in my humble opinion">imho</acronym>) after the <a href="http://www.rubyinside.com/rails-21-released-891.html">release of the 1st Release Candidate (RC1) of Rails 2.1</a>. Follow that link for installation instructions &#8211; though if you&#8217;re reading this blog post you probably don&#8217;t care! (because you&#8217;re, you know, &#8220;living on the edge&#8221;). Cheesiness aside, be sure to report any bugs you may encounter when upgrading to 2.1 RC1 or edge at the <a href="http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/overview">Rails bug tracker</a> &#8211; it is an RC so any bug reports would be very welcome and useful!</p>
<p>This week’s report covers changes from 12th May 2008 to 18th May 2008 (the day the corresponding <a href="http://railsenvy.com/podcast/">Rails Envy podcast</a> was recorded).</p>
<h3>caches_action can has conditionals</h3>
<p><code>caches_action</code> now takes an <code>:if</code> option (just like <a href="http://blog.codefront.net/2008/04/20/living-on-the-edge-of-rails-17/">caches_page does</a>). For example:</p>
<pre><code class="ruby">caches_action :index, :if =&gt; Proc.new { |c| !c.request.format.json? }</code></pre>
<p>This little enhancement is courtesy of José Valim.</p>
<p>Related changeset: <a href="http://github.com/rails/rails/commit/7708650f73ddb4db300ea2059c60c1d907a4384e">http://github.com/rails/rails/commit/7708650f73ddb4db300ea2059c60c1d907a4384e</a></p>
<h3>Bugfix: :select option is now scanned in ActiveRecord finders to ensure needed tables are included in generated SQL</h3>
<pre><code class="ruby">Post.find(:all, :include =&gt; :author, :select =&gt; 'posts.*, authors.id as "author_id"', :limit =&gt; 2)</code></pre>
<p>Would generate an SQL statement like this:</p>
<pre><code class="sql">SELECT posts.*, authors.id as "author_id" FROM "posts" LIMIT 2</code></pre>
<p>Notice how the <code>authors</code> table is not joined. This oversight is now fixed.</p>
<p>Thanks go to John Devine for this bugfix.</p>
<p>Related changeset: <a href="http://github.com/rails/rails/commit/b28b54cab090bed8f099ef375b419a8f92390dd4">http://github.com/rails/rails/commit/b28b54cab090bed8f099ef375b419a8f92390dd4</a></p>
<p>As always, let me know of any suggestions or how I can improve the Living on the Edge (of Rails) series. Also, if anyone has any recommendations of (non-ruby-related) things to do in Portland, do let me know!</p>

<p><a href="http://feedads.g.doubleclick.net/~a/G2kjIEmkZl2xB_nzzKd0BssRUJ4/0/da"><img src="http://feedads.g.doubleclick.net/~a/G2kjIEmkZl2xB_nzzKd0BssRUJ4/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/G2kjIEmkZl2xB_nzzKd0BssRUJ4/1/da"><img src="http://feedads.g.doubleclick.net/~a/G2kjIEmkZl2xB_nzzKd0BssRUJ4/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/y05yBsXvKjQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/05/18/living-on-the-edge-of-rails-21/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/05/18/living-on-the-edge-of-rails-21/</feedburner:origLink></item>
		<item>
		<title>Deploying with Capistrano via a gateway – some notes</title>
		<link>http://feedproxy.google.com/~r/riab/~3/gvU0ujuw-9w/</link>
		<comments>http://blog.codefront.net/2008/05/15/deploying-with-capistrano-via-a-gateway/#comments</comments>
		<pubDate>Thu, 15 May 2008 09:03:48 +0000</pubDate>
		<dc:creator>Chu Yeow</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://blog.codefront.net/?p=1107</guid>
		<description><![CDATA[Some notes on setting up a gateway server for deploying via Capistrano that I couldn&#8217;t find at the source.

You can specify the user you want to use to login to your gateway server like so: set :gateway, 'deploy@deploy.example.com'. This logs in to your gateway server as the &#8220;deploy&#8221; user.
You can specify an alternate SSH port [...]]]></description>
			<content:encoded><![CDATA[<p>Some notes on setting up a <a href="http://weblog.jamisbuck.org/2006/9/26/inside-capistrano-the-gateway-implementation">gateway server for deploying via Capistrano</a> that I couldn&#8217;t find at <a href="http://capify.org/getting-started/basics">the source</a>.</p>
<ul>
<li>You can specify the user you want to use to login to your gateway server like so: <code>set :gateway, 'deploy@deploy.example.com'</code>. This logs in to your gateway server as the &#8220;deploy&#8221; user.</li>
<li>You can specify an alternate SSH port for both your gateway <em>and</em> your deployment servers. E.g. setting <code>ssh_options[:port] = 11111</code> will make Capistrano SSH to your gateway server with on port 11111. For your actual application (and web and database) servers, you can specify the SSH port like so:
<pre><code class="ruby">set :gateway, 'deploy@deploy.example.com'
role :app, '192.168.1.113:22222'
role :web, '192.168.1.113:22222'
role :db,  '192.168.1.113:22222', :primary => true</code></pre>
</li>
<li>If you&#8217;re using public key authentication, you should put the public keys of your users (those who be deploying your app) on the gateway server <em>and</em> on the actual servers. I thought Capistrano would use the key of the &#8220;deploy&#8221; user but nope.</li>
</ul>

<p><a href="http://feedads.g.doubleclick.net/~a/-r-gWY5K3HzwD5XfdE4Tsagea0o/0/da"><img src="http://feedads.g.doubleclick.net/~a/-r-gWY5K3HzwD5XfdE4Tsagea0o/0/di" border="0" ismap="true"></img></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/-r-gWY5K3HzwD5XfdE4Tsagea0o/1/da"><img src="http://feedads.g.doubleclick.net/~a/-r-gWY5K3HzwD5XfdE4Tsagea0o/1/di" border="0" ismap="true"></img></a></p><img src="http://feeds.feedburner.com/~r/riab/~4/gvU0ujuw-9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://blog.codefront.net/2008/05/15/deploying-with-capistrano-via-a-gateway/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://blog.codefront.net/2008/05/15/deploying-with-capistrano-via-a-gateway/</feedburner:origLink></item>
	</channel>
</rss>
