<?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:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><description>Kamal Fariz Mahyuddin on Ruby, Rails, Apple and being a Dad</description><title>bitfluent</title><generator>Tumblr (3.0; @bitfluent)</generator><link>http://blog.bitfluent.com/</link><geo:lat>3.121319</geo:lat><geo:long>101.412048</geo:long><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/bitfluent" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item><title>Tethering over Celcom 3G on the iPhone 3.0</title><description>&lt;p&gt;Open this link in MobileSafari - &lt;a href="http://files.getdropbox.com/u/238893/my_celcom.mobileconfig"&gt;my_celcom.mobileconfig&lt;/a&gt; and install the profile. Alternatively, you can download this file and mail it to yourself and open it up in the iPhone Mail.app.&lt;/p&gt;

&lt;p&gt;Credits go to &lt;a href="http://help.benm.at/help.php"&gt;&lt;a href="http://help.benm.at/help.php"&gt;http://help.benm.at/help.php&lt;/a&gt;&lt;/a&gt;. I downloaded the settings for SG telcos from that site to see which parts were customizable and pretty much found you just need to change the APN to use &lt;strong&gt;celcom3g&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Also, for you people on DiGi: &lt;a href="http://www.mediafire.com/download.php?mnlhztjoywr"&gt;DiGi.mobileconfig&lt;/a&gt; courtesy of &lt;a href="http://forum.lowyat.net/user/Snuffykl"&gt;Snuffykl&lt;/a&gt; from &lt;a href="http://forum.lowyat.net/"&gt;LYN&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I’m on the RM68/month unlimited data plan. Is it the cheapest unlimited 3G plan around?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; I can confirm that tethering and MMS does not work on the iPhone 2G (1st-gen) &lt;em&gt;right now&lt;/em&gt;. It will probably require jailbreaking which should be out on Friday, 19th June.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;EDIT:&lt;/strong&gt; “Does not work” means the MMS and tether options are nowhere to be found in Settings.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=d11CM3xcrSQ:HunVW2I3AWE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=d11CM3xcrSQ:HunVW2I3AWE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/d11CM3xcrSQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/d11CM3xcrSQ/125749139</link><guid isPermaLink="false">http://blog.bitfluent.com/post/125749139</guid><pubDate>Thu, 18 Jun 2009 17:42:00 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/125749139</feedburner:origLink></item><item><title>Are You Coming To #barcampkl?</title><description>&lt;p&gt;&lt;a href="http://search.twitter.com/search?q=%23barcampkl"&gt;#barcampkl&lt;/a&gt; is happening this weekend, 4-5th April 2009, at &lt;a href="http://barcamp.org/barcampklvenue"&gt;Inti College Subang&lt;/a&gt;. Some pretty &lt;a href="http://barcamp.org/barcampklsessions"&gt;interesting talks have been scheduled&lt;/a&gt; ahead of time although the organizers have promised to implement a “real” unconference where the talks are voted at the opening of each day.&lt;/p&gt;

&lt;p&gt;So, are you coming? &lt;a href="http://barcamp.org/BarcampKLregister"&gt;Register here&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=kqBDiCXs8LI:_pPvgURxAuQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=kqBDiCXs8LI:_pPvgURxAuQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/kqBDiCXs8LI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/kqBDiCXs8LI/91503795</link><guid isPermaLink="false">http://blog.bitfluent.com/post/91503795</guid><pubDate>Tue, 31 Mar 2009 16:26:11 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/91503795</feedburner:origLink></item><item><title>Secure and Signed AuthSub Requests in Ruby</title><description>&lt;p&gt;I pulled the trigger in my last blog post about &lt;a href="http://blog.bitfluent.com/post/87311646/solving-this-website-has-not-registered-with-google-to"&gt;solving Google AuthSub’s warning&lt;/a&gt;. It solved only half the problem - the not-showing-the-warning half. I was too quick to assume it would work since Google returned a token. Actually performing &lt;code&gt;GET&lt;/code&gt; on the contacts feed would yield me a &lt;code&gt;401 Unauthorized&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;So, what did I get wrong? A few things.&lt;/p&gt;

&lt;p&gt;Firstly, I didn’t have to set the &lt;code&gt;sig&lt;/code&gt; in the request authorization URL. A simple &lt;code&gt;secure=1&lt;/code&gt; would have been sufficient. I confused this concept with other request schemes like Facebook’s which signs the request and appends the sig to the URL parameters.&lt;/p&gt;

&lt;p&gt;Secondly, for secure AuthSub requests, you need to set &lt;a href="http://code.google.com/apis/accounts/docs/AuthSub.html#signingrequests"&gt;special signed headers&lt;/a&gt;. Regular non-secure AuthSub requests only need a short header.&lt;/p&gt;

&lt;script src="http://gist.github.com/81165.js"&gt;&lt;/script&gt;&lt;p&gt;However, if you want secure requests, you need to sign the request. It’ll look something like this.&lt;/p&gt;

&lt;script src="http://gist.github.com/81166.js"&gt;&lt;/script&gt;&lt;p&gt;I thought I nailed it but it still returned me &lt;code&gt;401 Unauthorized&lt;/code&gt;. I downloaded the &lt;a href="http://code.google.com/p/gdata-python-client/"&gt;Python GData client&lt;/a&gt; to compare the sig values and indeed the sig I generated was off.&lt;/p&gt;

&lt;p&gt;So the final piece of the puzzle is how do I correctly generate the signature. &lt;a href="http://github.com/stuart/google-authsub"&gt;google-authsub&lt;/a&gt; (and &lt;a href="http://github.com/kamal/contacts/commit/2ceaadbcc8e18cd94759399c357ef0db051ba513"&gt;my contacts commit&lt;/a&gt;) got it wrong. This is what it was doing:&lt;/p&gt;

&lt;script src="http://gist.github.com/81167.js"&gt;&lt;/script&gt;&lt;p&gt;After much googling, I found the answer. Immad Akhund posted &lt;a href="http://groups.google.com/group/google-help-dataapi/tree/browse_frm/thread/5893816ff68a689e/f8689d7a9bf611bc?rnum=1&amp;_done=%2Fgroup%2Fgoogle-help-dataapi%2Fbrowse_frm%2Fthread%2F5893816ff68a689e%3Ftvc%3D1%26#doc_2cea553921272a53"&gt;the solution on the Google Data Protocol mailing list&lt;/a&gt; in June 2008. The correct way to sign &lt;code&gt;data&lt;/code&gt; is to use the &lt;code&gt;OpenSSL::PKey::RSA#sign&lt;/code&gt; method and remove the newlines after Base64 encoding.&lt;/p&gt;

&lt;script src="http://gist.github.com/81168.js"&gt;&lt;/script&gt;&lt;p&gt;So, there you have it. I’ve pushed a &lt;a href="http://github.com/kamal/contacts/commit/b3e9585fe1688f946eeb5fb8fe028bd2f63e374b"&gt;new commit&lt;/a&gt; to the contacts library with all the fixes. I’ll be forking google-authsub and pushing fixes there too in hopes that another person wouldn’t need to spend a day figuring it out like I did.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=UFI4klm5OsY:cRrXU8AvbXg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=UFI4klm5OsY:cRrXU8AvbXg:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/UFI4klm5OsY" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/UFI4klm5OsY/87588119</link><guid isPermaLink="false">http://blog.bitfluent.com/post/87588119</guid><pubDate>Wed, 18 Mar 2009 23:21:00 +0800</pubDate><category>authsub</category><category>signed</category><category>gdata</category><category>contacts</category><category>api</category><category>ruby</category><category>openssl</category><feedburner:origLink>http://blog.bitfluent.com/post/87588119</feedburner:origLink></item><item><title>Solving "This website has not registered with Google to establish a secure connection for authorization requests"</title><description>&lt;p&gt;I recently ran into an ominous warning on the Google Contacts Access Request landing page.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://img.skitch.com/20090317-daidwk7cmj89eg4d54wfbksstf.png"&gt;&lt;img src="http://img.skitch.com/20090317-d86gb6ij7r6k1d3f51i4k4i332.png" alt="This website has not registered with Google to establish a secure connection for authorization requests."/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After some googling, the solution is to &lt;a href="https://www.google.com/accounts/ManageDomains"&gt;register the requesting domain&lt;/a&gt; and &lt;a href="http://code.google.com/apis/gdata/authsub.html#Registered"&gt;upload a self-signed X.509 certificate&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Once completed, I retried the request and got a slightly less threatening warning.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://img.skitch.com/20090317-1ybbgbjxi2gbcxsutf59pbfqq7.png"&gt;&lt;img src="http://img.skitch.com/20090317-hhy3wq68s4b9gxadxgb39u6kp.png" alt="This website is registered with Google to make authorization requests, but has not been configured to send requests securely."/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The solution was to add two additional parameters to the request: &lt;code&gt;secure=1&lt;/code&gt; and a signature. Fortunately, I found how to generate the signature in the &lt;a href="http://github.com/stuart/google-authsub"&gt;google-authsub gem&lt;/a&gt;. A few minutes later, I added support for signing AuthSub requests to &lt;a href="http://github.com/mislav/contacts"&gt;Mislav’s contacts library&lt;/a&gt; and got the results I wanted. &lt;a href="http://github.com/kamal/contacts/commit/2ceaadbcc8e18cd94759399c357ef0db051ba513"&gt;Commit&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://img.skitch.com/20090317-fxneu9qf5rqfww8ce7b53gdug.png"&gt;&lt;img src="http://img.skitch.com/20090317-emmmiy9nxdgk4jqefkxyibxf9x.png" alt="Yay!"/&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Update&lt;/strong&gt;: I got it wrong about appending the signature to the parameter. I posted a follow up on &lt;a href="http://blog.bitfluent.com/post/87588119/secure-and-signed-authsub-requests-in-ruby"&gt;how to correctly perform signed AuthSub requests in Ruby&lt;/a&gt;.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=jiP7T3m4w5Q:z-gAmIKJjQ0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=jiP7T3m4w5Q:z-gAmIKJjQ0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/jiP7T3m4w5Q" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/jiP7T3m4w5Q/87311646</link><guid isPermaLink="false">http://blog.bitfluent.com/post/87311646</guid><pubDate>Wed, 18 Mar 2009 01:47:00 +0800</pubDate><category>ruby</category><category>contacts</category><category>authsub</category><category>gmail</category><category>google</category><category>api</category><category>authorization</category><feedburner:origLink>http://blog.bitfluent.com/post/87311646</feedburner:origLink></item><item><title>#rubinius</title><description>evan: i'm curious, how do you know the JVM is deopt'ing in certain cases?&lt;br /&gt;&#xD;
headius: it tells us&lt;br /&gt;&#xD;
evan: twitter?&lt;br /&gt;&#xD;
evan: us post?&lt;br /&gt;&#xD;
evan: collect call?&lt;br /&gt;&#xD;
headius: reaches out of the screen and slaps us sideways&lt;br /&gt;&#xD;
evan: hah&lt;br /&gt;&#xD;
headius: there's a bunch of debug options for hotspot&lt;br /&gt;&#xD;
evan: NOT SO FAST BUCKO&lt;br /&gt;&#xD;
headius: some in the released jdk, some require a debug build&lt;br /&gt;&#xD;
headius: LogCompilation, PrintInlining, PrintAssembly&lt;br /&gt;&#xD;
evan: -XXSlapRatio=1persecond&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=F_kW1wrKhV4:MtArllWubf0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=F_kW1wrKhV4:MtArllWubf0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/F_kW1wrKhV4" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/F_kW1wrKhV4/72282131</link><guid isPermaLink="false">http://blog.bitfluent.com/post/72282131</guid><pubDate>Thu, 22 Jan 2009 17:28:00 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/72282131</feedburner:origLink></item><item><title>Sharing Contracts</title><description>&lt;p&gt;I love it when companies that provide professional services share the contracts they use when dealing with clients. Many people consider contracts to be part of their secret sauce and competitive advantage over their competition so it’s understandable that these documents are not discussed much (plus they also cost money having to go through legal counsel).&lt;/p&gt;

&lt;p&gt;However, &lt;a href="http://blog.obiefernandez.com/"&gt;Obie Fernandez&lt;/a&gt; of &lt;a href="http://hashrocket.com/"&gt;HashRocket&lt;/a&gt; and &lt;a href="http://www.stuffandnonsense.co.uk/"&gt;Andy Clarke of Stuff and Nonsense&lt;/a&gt; have been awesome by sharing the contracts they use in their daily business:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="http://blog.obiefernandez.com/content/2008/10/msa-series-2-cooperation-and-reliance.html"&gt;Master Services Agreement Part 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://blog.obiefernandez.com/content/2008/09/master-services-agreement-part-1.html"&gt;Master Services Agreement Part 2&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://24ways.org/2008/contract-killer"&gt;Contract Killer&lt;/a&gt; (via &lt;a href="http://twitter.com/cheeaun"&gt;@cheeaun&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://blog.flavert.com/2008/12/23/fast-reply-to-sharing-contracts-by-kamal-fariz/"&gt;Flavert Media Lab’s Contract&lt;/a&gt; (thanks &lt;a href="http://twitter.com/tekong"&gt;@tekong&lt;/a&gt;!)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I’d love to collect more of these kinds of write-ups. Do you have some? &lt;a href="http://twitter.com/kamal_fariz"&gt;Twitter me!&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=pxJJxKmxd9M:PgbnWttbBqk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=pxJJxKmxd9M:PgbnWttbBqk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/pxJJxKmxd9M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/pxJJxKmxd9M/66347173</link><guid isPermaLink="false">http://blog.bitfluent.com/post/66347173</guid><pubDate>Tue, 23 Dec 2008 12:41:00 +0800</pubDate><category>contract</category><category>client</category><category>msa</category><category>agreement</category><category>freelance</category><feedburner:origLink>http://blog.bitfluent.com/post/66347173</feedburner:origLink></item><item><title>Test autoposting from Posterous</title><description>I never knew posterous could autopost to other services as well. That’s pretty rad.&lt;p style="font-size: 10px;"&gt;  &lt;a href="http://posterous.com"&gt;Posted via email&lt;/a&gt;   from &lt;a href="http://kamal.posterous.com/test-autoposting-from-posterou"&gt;kamal’s posterous&lt;/a&gt; | &lt;a href="http://kamal.posterous.com/test-autoposting-from-posterou#comment"&gt;&lt;span style="font-size: 11px"&gt;Comment »&lt;/span&gt;&lt;/a&gt;  &lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=t63NWM7PoS0:FZzVodt7u08:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=t63NWM7PoS0:FZzVodt7u08:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/t63NWM7PoS0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/t63NWM7PoS0/65875090</link><guid isPermaLink="false">http://blog.bitfluent.com/post/65875090</guid><pubDate>Sat, 20 Dec 2008 15:14:31 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/65875090</feedburner:origLink></item><item><title>Full List of 1,339 Rails Contributors</title><description>&lt;p&gt;One of the biggest plus points of using git for open source projects is the preservation of the original author of the patch. Here’s how it looks like when displayed in &lt;a href="http://github.com"&gt;GitHub&lt;/a&gt;:&lt;/p&gt;

&lt;p&gt;&lt;img src="http://img.skitch.com/20081031-mjqbkapmx62bbkt35di6wj9ywa.png" alt="Committer sign-off"/&gt;&lt;/p&gt;

&lt;p&gt;In the Subversion days, patches into Rails were attributed by adding an arbitrary combination of the author’s name/email/nick at the end of the commit messages. Makes it kind of hard to keep track of the number of distinct contributors over the lifetime of the project.&lt;/p&gt;

&lt;p&gt;Fortunately, &lt;a href="http://github.com/fxn"&gt;Xavier Noria&lt;/a&gt; whipped up a &lt;a href="http://pastie.org/304092"&gt;script to parse the legacy commit messages&lt;/a&gt; to extract the number of commits per author using these rules:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;First extract authors from commit message&lt;/li&gt;
&lt;li&gt;If empty, check changelogs via &lt;code&gt;git show id&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;If empty, author is the committer&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The full list is below (you probably can’t see it if you are reading this via Google Reader)&lt;/p&gt;

&lt;script src="http://gist.github.com/20721.js"&gt;&lt;/script&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=UtIr6a8_FHU:emd7GSipp_g:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=UtIr6a8_FHU:emd7GSipp_g:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/UtIr6a8_FHU" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/UtIr6a8_FHU/57244160</link><guid isPermaLink="false">http://blog.bitfluent.com/post/57244160</guid><pubDate>Fri, 31 Oct 2008 15:42:27 +0800</pubDate><category>github</category><category>rails</category><category>git</category><category>contributor</category><category>patch</category><category>svn</category><category>patch</category><feedburner:origLink>http://blog.bitfluent.com/post/57244160</feedburner:origLink></item><item><title>Tumblr Client On The iPhone</title><description>Would having a tumblr client on my iPhone see me posting more frequently? Obligatory test post. &lt;br/&gt;&lt;br/&gt;Posted with &lt;a href="http://lifecast.sleepydog.net"&gt;LifeCast&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=BPCrTa4_qH0:zLNKvEFd6Po:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=BPCrTa4_qH0:zLNKvEFd6Po:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/BPCrTa4_qH0" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/BPCrTa4_qH0/45323921</link><guid isPermaLink="false">http://blog.bitfluent.com/post/45323921</guid><pubDate>Sat, 09 Aug 2008 23:43:54 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/45323921</feedburner:origLink></item><item><title>On the Beauty of Rubinius' Design (I Wish I Had Rails.new)</title><description>&lt;p&gt;In &lt;a href="http://rubini.us/"&gt;Rubinius&lt;/a&gt;, you can spawn off a brand new complete &lt;a href="http://en.wikipedia.org/wiki/Virtual_machine"&gt;VM&lt;/a&gt; by simply calling &lt;code&gt;Rubinius.new&lt;/code&gt;. It’ll behave exactly as though it was invoked directly from an rbx binary sitting in your &lt;code&gt;$PATH&lt;/code&gt;, complete with STDIN/STDOUT (which you can override). I believe this is one of the basis of how Rubinius’ multi-VM architecture works.&lt;/p&gt;

&lt;p&gt;Anyway, I bring this up because I really, really wish Rails was architected in a similar fashion. I am building a &lt;a href="http://en.wikipedia.org/wiki/Content_management_system"&gt;CMS&lt;/a&gt; on top of Rails and would love to get my hands on a &lt;code&gt;Rails.new&lt;/code&gt; if there ever was one. Here’s why.&lt;/p&gt;

&lt;p&gt;In a CMS setting, very little of what Rails offers out of the box is usable. You don’t have access to Rails routes so from the very beginning, you don’t have Rails automatically invoking the right controller, the right action and rendering the right view. This doesn’t make sense anyway - you don’t expect your CMS users to start writing controller code in your web editor, do you? (Unless you are &lt;a href="http://heroku.com/"&gt;Heroku&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;On a slight tangent, the assumption when writing a CMS is that when you ship, you would have written every conceivable controller and model there is (views don’t fall into this because users are generally familiar with the concept of customizable templates). One strategy to extend your “frozen code base” is via the use of widgets and third-party apps (like Facebook) so that you can create seemingly new pages served by custom controllers.&lt;/p&gt;

&lt;p&gt;So how do you design a CMS? I’ve been prototyping something for the past week and came up for a breather to check out how other people have solved it. I am delightfully surprised to find out that &lt;a href="http://radiantcms.org/"&gt;Radiant&lt;/a&gt; does it very close to what I have. In particular, Radiant has one single controller that accepts all requests (lets ignore the entire admin portion for the time being). Based on the path array (provided by the globbed route), it decides what to do / where to dispatch. It takes care of locating the page that corresponds to the URL (it uses a &lt;code&gt;Page&lt;/code&gt; model), rendering it and returning the result to the user. It is interesting to note that Radiant directly manipulates the &lt;code&gt;request&lt;/code&gt; and &lt;code&gt;response&lt;/code&gt; objects, something that Rails developers almost never had to reach for in a regular app. On the other hand, I am exploring the use of serializing the templates to disk and simply calling &lt;code&gt;render :template&lt;/code&gt; on it.&lt;/p&gt;

&lt;p&gt;Wait a minute. &lt;strong&gt;Holy cow, we just built (a simplified) Rails on top of Rails!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;What I’d love to see here instead is a &lt;code&gt;Rails.new&lt;/code&gt; method just like Rubinius. Boom, a full blown MVC at your fingertips. Configure it right and there you have your very own CMS with minimal work. Or maybe there is. Lazyweb?&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=ITRrgXzZZSA:niLZSpb3Xr8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=ITRrgXzZZSA:niLZSpb3Xr8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/ITRrgXzZZSA" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/ITRrgXzZZSA/36867302</link><guid isPermaLink="false">http://blog.bitfluent.com/post/36867302</guid><pubDate>Mon, 02 Jun 2008 17:13:00 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/36867302</feedburner:origLink></item><item><title>An update in a really long while</title><description>&lt;p&gt;Woah, one month with no updates.&lt;/p&gt;

&lt;p&gt;I started contracting for a startup in Seattle, WA since beginning of April and have been neglecting to update stuff. It’s pretty nice here plus I get to access things that people here take for granted like attending &lt;a href="http://www.rubyholic.com/groups/show/1"&gt;Seattle.rb hack nights&lt;/a&gt;, &lt;a href="http://www.pandora.com"&gt;Pandora&lt;/a&gt;, &lt;a href="http://www.hulu.com"&gt;Hulu&lt;/a&gt; and this weekend, &lt;a href="http://barcamp.org/BarCampPortland"&gt;Barcamp Portland&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;See you guys in a bit.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=ASFJ_qhUgUQ:AS7zliEdnyY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=ASFJ_qhUgUQ:AS7zliEdnyY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/ASFJ_qhUgUQ" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/ASFJ_qhUgUQ/33455744</link><guid isPermaLink="false">http://blog.bitfluent.com/post/33455744</guid><pubDate>Fri, 02 May 2008 03:53:52 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/33455744</feedburner:origLink></item><item><title>http://dev.rubyonrails.org/ticket/11491</title><description>&lt;a href="http://dev.rubyonrails.org/ticket/11491"&gt;http://dev.rubyonrails.org/ticket/11491&lt;/a&gt;: &lt;p&gt;Finally, &lt;code&gt;render :partial =&gt; some_collection&lt;/code&gt; will pick the right template based on each object in the collection. I can now retire my workaround:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;% some_collection.each do |item| %&gt;
  &lt;%= render :partial =&gt; item %&gt;
&lt;% end %&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Best part is that the &lt;code&gt;partial_counter&lt;/code&gt; is maintained across the different partials.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=yCmzONXMqAE:32WLmoUZO4k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=yCmzONXMqAE:32WLmoUZO4k:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/yCmzONXMqAE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/yCmzONXMqAE/30422191</link><guid isPermaLink="false">http://blog.bitfluent.com/post/30422191</guid><pubDate>Tue, 01 Apr 2008 12:03:51 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/30422191</feedburner:origLink></item><item><title>Updating Counter Cache in Migrations</title><description>&lt;p&gt;I’m nearly complete with an app I’ve been working on, so I thought I’d dedicate some time for optimization. One of the first things I did to my models was to add &lt;a href="http://api.rubyonrails.com/classes/ActiveRecord/Associations/ClassMethods.html#M001105"&gt;counter cache&lt;/a&gt;s so that performing counts on my association were fast.&lt;/p&gt;

&lt;p&gt;First try,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class AddCommentCounterCacheOnTopics &lt; ActiveRecord::Migration
  def self.up
    add_column :topics, :comments_count, :integer, :default =&gt; 0
  end

  def self.down
    remove_column :topics, :comments_count
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Very standard. However, it initializes the column to 0, effectively “losing” all my comments (they’re there in the DB, but Rails adds an additional optimization whereby it won’t fetch the association if the counter cache is 0). Looks like I need to update the &lt;code&gt;comments_count&lt;/code&gt; column to whatever it was at the time of migration.&lt;/p&gt;

&lt;p&gt;Second try,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class AddCommentCounterCacheOnTopics &lt; ActiveRecord::Migration
  def self.up
    add_column :topics, :comments_count, :integer, :default =&gt; 0

    Topic.find(:all).each do |t|
      t.comments_count = t.comments.count
      t.save!
    end
  end

  def self.down
    remove_column :topics, :comments_count
  end
end
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Two things to note: First, I’m using the &lt;code&gt;#count&lt;/code&gt; method in &lt;code&gt;t.comments.count&lt;/code&gt; because calling &lt;code&gt;#size&lt;/code&gt; will use the value in &lt;code&gt;t.comment_count&lt;/code&gt; which is 0. &lt;code&gt;#count&lt;/code&gt; on the other hand will perform a SQL &lt;code&gt;count()&lt;/code&gt;. Second, &lt;strong&gt;this won’t work!&lt;/strong&gt; Why? Because counter cache columns are set to &lt;code&gt;attr_readonly&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;To work around this, a little hack. Final result,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;class AddCommentCounterCacheOnTopics &lt; ActiveRecord::Migration
  def self.up
    add_column :topics, :comments_count, :integer, :default =&gt; 0

    def Topic.readonly_attributes; nil end # A little evil hack

    Topic.find(:all).each do |t|
      t.comments_count = t.comments.count
      t.save!
    end
  end

  def self.down
    remove_column :topics, :comments_count
  end
end
&lt;/code&gt;&lt;/pre&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=INPPIZC6qek:V-2chdhcKLw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=INPPIZC6qek:V-2chdhcKLw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/INPPIZC6qek" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/INPPIZC6qek/30194408</link><guid isPermaLink="false">http://blog.bitfluent.com/post/30194408</guid><pubDate>Sun, 30 Mar 2008 01:34:00 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/30194408</feedburner:origLink></item><item><title>Excellent panel on scaling customer support. Definitely...</title><description>&lt;object type="application/x-shockwave-flash" data="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&amp;feedurl=http%3A%2F%2Fgetsatisfaction%2Eblip%2Etv%2Frss&amp;file=http%3A%2F%2Fblip%2Etv%2Frss%2Fflash%2F683327&amp;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" width="400" height="255" allowfullscreen="true" id="showplayer"&gt;&lt;param name="movie" value="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&amp;feedurl=http%3A%2F%2Fgetsatisfaction%2Eblip%2Etv%2Frss&amp;file=http%3A%2F%2Fblip%2Etv%2Frss%2Fflash%2F683327&amp;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" /&gt;&lt;param name="quality" value="best" /&gt;&lt;embed src="http://blip.tv/scripts/flash/showplayer.swf?enablejs=true&amp;feedurl=http%3A%2F%2Fgetsatisfaction%2Eblip%2Etv%2Frss&amp;file=http%3A%2F%2Fblip%2Etv%2Frss%2Fflash%2F683327&amp;showplayerpath=http%3A%2F%2Fblip%2Etv%2Fscripts%2Fflash%2Fshowplayer%2Eswf" quality="best" width="400" height="255" name="showplayer" type="application/x-shockwave-flash"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;Excellent panel on scaling customer support. Definitely something to take into account whenever you think of launching a new product out there. Are you too caught up in the idea and the development, forgetting the most important ingredient of your success: the users?&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=ddgTH4hQDHo:C8SUGysSScI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=ddgTH4hQDHo:C8SUGysSScI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/ddgTH4hQDHo" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/ddgTH4hQDHo/29670819</link><guid isPermaLink="false">http://blog.bitfluent.com/post/29670819</guid><pubDate>Mon, 24 Mar 2008 11:56:00 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/29670819</feedburner:origLink></item><item><title>My First Podcast Mention!</title><description>&lt;p&gt;It’s the first time I’ve ever gotten mentioned in a podcast! It’s on &lt;a href="http://railsenvy.com/2008/3/19/rails-envy-podcast-episode-023-03-19-2008"&gt;Episode 023&lt;/a&gt; of the Rails Envy Podcast for my blog post on &lt;a href="http://blog.bitfluent.com/post/28517435"&gt;using the Fire Eagle gem with Rails&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Download the episode and fast forward to 11:24 :)&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=Du8LU26O1ZI:5-UnrCavSFk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=Du8LU26O1ZI:5-UnrCavSFk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/Du8LU26O1ZI" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/Du8LU26O1ZI/29384602</link><guid isPermaLink="false">http://blog.bitfluent.com/post/29384602</guid><pubDate>Thu, 20 Mar 2008 22:03:55 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/29384602</feedburner:origLink></item><item><title>Google Gears for Safari Soon?</title><description>&lt;div id="shcp_9030"&gt;&lt;blockquote style="margin-left: 0; padding-left: 1em; border-left: 1em #eee solid; "&gt; &lt;span class="content comments_count_1 withoutphoto"&gt;&lt;span class="text"&gt; &lt;blockquote class="comment_body comment_body1"&gt;Adds support for offline storage for Web applications in SQL databases&lt;a href="http://r6.sharedcopy.com/3ckdhv12#shcp1"&gt; &lt;sup&gt;link »&lt;/sup&gt;&lt;/a&gt;
&lt;/blockquote&gt; &lt;/span&gt;&lt;/span&gt; - from &lt;a href="http://r6.sharedcopy.com/3ckdhv12"&gt;About the Safari 3.1 Update&lt;/a&gt; via &lt;a href="http://sharedcopy.com"&gt;sharedcopy.com&lt;/a&gt;
&lt;/blockquote&gt;&lt;/div&gt;

&lt;p&gt;&lt;style&gt;#shcp_9030 blockquote blockquote { margin-left: 1.5em; font-size: 0.95em; font-style: italic; }; #shcp_9030 .html_gist { display: none; }&lt;/style&gt;&lt;script&gt;  var json_9030 = {   host: 'sharedcopy.com',   width: '376px',   height: '250px',   bgcolor: '#ffffff',   background: '#ffffff url(http://docs.info.apple.com.sharedcopy.com/images/loading.gif) no-repeat center center; ',   src: 'http://docs.info.apple.com.sharedcopy.com/embeds/copy/kamal/6ca363f08816f8b04723229310fc3262/376.250/BBBBBB.ffffff.CC0000/shcp1.html' };&lt;/script&gt;&lt;script src="http://sharedcopy.com/static/embed/script.js"&gt;&lt;/script&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=GEH55d0CnvM:5MAXjL7GI_Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=GEH55d0CnvM:5MAXjL7GI_Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/GEH55d0CnvM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/GEH55d0CnvM/29190056</link><guid isPermaLink="false">http://blog.bitfluent.com/post/29190056</guid><pubDate>Tue, 18 Mar 2008 22:40:20 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/29190056</feedburner:origLink></item><item><title>Jaws drop How it recovered from the guy kicking it and later...</title><description>&lt;object width="400" height="336"&gt;&lt;param name="movie" value="http://www.youtube.com/v/W1czBcnX1Ww&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/W1czBcnX1Ww&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="336" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;&lt;em&gt;Jaws drop&lt;/em&gt; How it recovered from the guy kicking it and later slipping on ice was freaking amazing! via &lt;a href="http://www.37signals.com/svn/posts/912-incredible-big-dog-robot-from-boston-dynamics"&gt;SvN&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=O5B_teTvMjE:iQS8Q5zslaE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=O5B_teTvMjE:iQS8Q5zslaE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/O5B_teTvMjE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/O5B_teTvMjE/29134793</link><guid isPermaLink="false">http://blog.bitfluent.com/post/29134793</guid><pubDate>Tue, 18 Mar 2008 09:07:49 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/29134793</feedburner:origLink></item><item><title>#ruby-lang</title><description>ddfreyne: Somebody decided that the best way to let all tests pass... is to comment out the tests that fail&lt;br /&gt;&#xD;
ddfreyne: ...&lt;br /&gt;&#xD;
kamal_fariz: i'd go one further and mock rspec's expectation matcher to return true&lt;br /&gt;&#xD;
ddfreyne: heh&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=9fNgAgiY76M:eTbzp48q8BI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=9fNgAgiY76M:eTbzp48q8BI:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/9fNgAgiY76M" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/9fNgAgiY76M/29066950</link><guid isPermaLink="false">http://blog.bitfluent.com/post/29066950</guid><pubDate>Mon, 17 Mar 2008 17:07:00 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/29066950</feedburner:origLink></item><item><title>via Paragon Adrift</title><description>&lt;object width="400" height="336"&gt;&lt;param name="movie" value="http://www.youtube.com/v/V6eFn45xOCY&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;param name="allowFullScreen" value="true"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/V6eFn45xOCY&amp;rel=0&amp;egm=0&amp;showinfo=0&amp;fs=1" type="application/x-shockwave-flash" width="400" height="336" allowFullScreen="true" wmode="transparent"&gt;&lt;/embed&gt;&lt;/object&gt;&lt;br/&gt;&lt;br/&gt;via &lt;a href="http://maraby.org/"&gt;Paragon Adrift&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=FPHMMAgeIRE:20E76Jd15wQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=FPHMMAgeIRE:20E76Jd15wQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/FPHMMAgeIRE" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/FPHMMAgeIRE/28805926</link><guid isPermaLink="false">http://blog.bitfluent.com/post/28805926</guid><pubDate>Fri, 14 Mar 2008 11:29:57 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/28805926</feedburner:origLink></item><item><title>Interfacing a Rails App to Fire Eagle Pt 1: Exploration via IRB</title><description>&lt;p&gt;Here are my notes as I explore interfacing a Rails app to &lt;a href="http://fireeagle.yahoo.net"&gt;Fire Eagle&lt;/a&gt;. Tokens have been masked to protect the innocent :)&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a &lt;a href="https://fireeagle.yahoo.net/developer/create"&gt;new application&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Get the fireeagle gem.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;MacBook-Pro:src kamal$ git clone git://github.com/kamal/fireeagle.git fireeagle
Initialized empty Git repository in /Users/kamal/src/fireeagle/.git/
remote: Generating pack...
remote: Done counting 377 objects.
remote: Deltifying 377 objects...
remote:  100% (377/377) done
remote: Total 377 (delta 192), reused 0 (delta 0)
Receiving objects: 100% (377/377), 75.91 KiB | 9 KiB/s, done.
Resolving deltas: 100% (192/192), done.
MacBook-Pro:src kamal$ cd fireeagle
MacBook-Pro:fireeagle(master) kamal$ rake install_gem
(in /Users/kamal/src/fireeagle)
sudo gem install --local pkg/*.gem
Successfully installed fireeagle-0.6.1
1 gem installed
Installing ri documentation for fireeagle-0.6.1...
Installing RDoc documentation for fireeagle-0.6.1...
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Fire up irb and instantiate a client with the Consumer Key and Secret provided by Step 1.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;MacBook-Pro:~ kamal$ irb
&gt;&gt; require 'fireeagle'
=&gt; true
&gt;&gt; client = FireEagle::Client.new(
  :consumer_key    =&gt; 'AAAAAAAAAAAA',
  :consumer_secret =&gt; 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB')
=&gt; #&lt;FireEagle::Client:0x1bef504 ...&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Generate a Request Token and associate it with the user because we’ll need to locate who authenticated our app.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt; client.get_request_token
=&gt; #&lt;OAuth::Token:0x1bddb24 @secret="emfPurZAbYlRqNL7fSxhXOkxCJRZ2T1r", @token="mGxmGcGPNyjr"&gt;
&gt;&gt; current_user.update_attributes!(
  :request_token        =&gt; client.request_token.token,
  :request_token_secret =&gt; client.request_token.secret)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Redirect the user to the &lt;a href="https://fireeagle.yahoo.net/oauth/authorize?oauth_token=mGxmGcGPNyjr"&gt;Authorization URL&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt; client.authorization_url
=&gt; "https://fireeagle.yahoo.net/oauth/authorize?oauth_token=mGxmGcGPNyjr"
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;After the user grants us permission, Fire Eagle will redirect the user’s browser to our Callback URL (defined in Step 1) with the same &lt;code&gt;oauth_token&lt;/code&gt; params.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;a href="http://yourapp.example.com/your_call_back_path?oauth_token=mGxmGcGPNyjr"&gt;http://yourapp.example.com/your_call_back_path?oauth_token=mGxmGcGPNyjr&lt;/a&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Find the User by the &lt;code&gt;oauth_token&lt;/code&gt; and instantiate a new client (&lt;code&gt;client2&lt;/code&gt; in our IRB session) with the request token and secret.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt; user = User.find_by_request_token(params[:oauth_token])
&gt;&gt; client2 = FireEagle::Client.new(
  :consumer_key         =&gt; 'AAAAAAAAAAAA',
  :consumer_secret      =&gt; 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
  :request_token        =&gt; user.request_token,
  :request_token_secret =&gt; user.request_token_secret)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Convert the Request Token to a long-lived Access Token and save it. Optionally, you can nil out the Request Token because you are not going to need them anymore.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt; client2.convert_to_access_token
=&gt; #&lt;OAuth::Token:0x23c4824 @token="CCCCCCCCCCCC", @secret="DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"&gt;
&gt;&gt; user.update_attributes!(
  :access_token         =&gt; client2.access_token.token,
  :access_token_secret  =&gt; client2.access_token.secret
  :request_token        =&gt; nil
  :request_token_secret =&gt; nil)
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Go to town!&lt;/strong&gt; From here on out, you can directly instantiate a client using the user’s Access Token to read or update their location.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&gt;&gt; client3 = FireEagle::Client.new(
  :consumer_key        =&gt; 'AAAAAAAAAAAA',
  :consumer_secret     =&gt; 'BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB',
  :access_token        =&gt; user.access_token,
  :access_token_secret =&gt; user.access_token_secret)
&gt;&gt; client3.update(:q =&gt; 'petaling jaya')
=&gt; #&lt;FireEagle::Response:0x2549a8c ...&gt;
&gt;&gt; client.user.best_guess.name
=&gt; "Petaling Jaya, Malaysia"
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;A lot of the stuff above can be extracted into a Rails plugin. First dibs on &lt;code&gt;acts_as_hatchling&lt;/code&gt;!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=Oofk1metXeM:9SLUUUTGZsc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/bitfluent?a=Oofk1metXeM:9SLUUUTGZsc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/bitfluent?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/bitfluent/~4/Oofk1metXeM" height="1" width="1"/&gt;</description><link>http://feedproxy.google.com/~r/bitfluent/~3/Oofk1metXeM/28517435</link><guid isPermaLink="false">http://blog.bitfluent.com/post/28517435</guid><pubDate>Tue, 11 Mar 2008 12:57:29 +0800</pubDate><feedburner:origLink>http://blog.bitfluent.com/post/28517435</feedburner:origLink></item></channel></rss>
