<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5625362727221449997</id><updated>2011-12-04T16:11:00.507+08:00</updated><category term='ruby on rails'/><category term='testing'/><category term='geek'/><category term='git'/><category term='movies'/><category term='gems'/><category term='database'/><category term='programming'/><category term='random'/><title type='text'>Jorrel's Online Notepad</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>22</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-6233899436007496620</id><published>2009-01-14T14:49:00.003+08:00</published><updated>2009-01-14T14:54:04.839+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='git'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Git: restoring accidentaly deleted files</title><content type='html'>&lt;span style="font-family: verdana;"&gt;To view a list of deleted files:&lt;br /&gt;&lt;pre&gt;git ls-files --deleted&lt;/pre&gt;&lt;br /&gt;To restore a deleted file (assuming the D is not yet commited)&lt;br /&gt;&lt;pre&gt;git checkout where/the/file/was.ext&lt;/pre&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-6233899436007496620?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/6233899436007496620/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=6233899436007496620' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/6233899436007496620'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/6233899436007496620'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2009/01/git-restoring-accidentaly-deleted-files.html' title='Git: restoring accidentaly deleted files'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-6815764992751049544</id><published>2008-12-03T12:12:00.004+08:00</published><updated>2008-12-03T12:25:54.481+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>custom assert_select_rjs matcher</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Background:&lt;br /&gt; I wanted to test rjs redirection:&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/31413.js"&gt;&lt;/script&gt;&lt;br /&gt;Problem:&lt;br /&gt; &lt;code&gt;ActionController::Assertions::SelectorAssertions#assert_select_rjs&lt;/code&gt; don't know about &lt;code&gt;:redirect_to&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt; I don't know if this is the right solution but I added this at the end of my &lt;code&gt;test_helper.rb&lt;/code&gt; then I can assert by &lt;code&gt;:redirect_to&lt;/code&gt; now&lt;br /&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/31414.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-6815764992751049544?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/6815764992751049544/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=6815764992751049544' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/6815764992751049544'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/6815764992751049544'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/12/custom-assertselectrjs-matcher.html' title='custom assert_select_rjs matcher'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-3038492601347838189</id><published>2008-11-18T20:22:00.003+08:00</published><updated>2008-11-18T20:29:25.213+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Application Controller</title><content type='html'>&lt;span style="font-family: verdana;"&gt;The file application.rb had just been officially renamed to application_controller.rb; and the special case in the code for checking it removed.  I'm not even OC but this was also bothering me since I used rails. &lt;br /&gt;&lt;br /&gt;The commit: &lt;a href="http://github.com/rails/rails/commit/fcce1f17eaf9993b0210fe8e2a8117b61a1f0f69"&gt;fcce1f1&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-3038492601347838189?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/3038492601347838189/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=3038492601347838189' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/3038492601347838189'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/3038492601347838189'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/11/application-controller.html' title='Application Controller'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-3754418624939872281</id><published>2008-10-30T15:53:00.003+08:00</published><updated>2008-10-30T16:06:06.644+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>reverse_sql_order</title><content type='html'>&lt;span style="font-family:verdana;"&gt;I just found this while browsing through AR Base's source code.  It seems very useful.&lt;/span&gt;&lt;br /&gt;&lt;script src="http://gist.github.com/20941.js"&gt;&lt;/script&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-3754418624939872281?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/3754418624939872281/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=3754418624939872281' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/3754418624939872281'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/3754418624939872281'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/10/reversesqlorder.html' title='reverse_sql_order'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-8446107045002511401</id><published>2008-10-29T20:36:00.003+08:00</published><updated>2008-10-29T20:40:31.833+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>"Only get, head, post, put, and delete requests are allowed." Ruby on Rails error</title><content type='html'>&lt;pre&gt;Only get, head, post, put, and delete requests are allowed.&lt;/pre&gt;&lt;span style="font-family:verdana;"&gt;If you get this while/after editing your routes, then you'll need to restart your local server. Thanks to &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://www.paulsturgess.co.uk/articles/show/71-only-get-head-post-put-and-delete-requests-are-allowed-ruby-on-rails-error"&gt;this guy&lt;/a&gt;&lt;span style="font-family:verdana;"&gt;.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-8446107045002511401?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/8446107045002511401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=8446107045002511401' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/8446107045002511401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/8446107045002511401'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/10/only-get-head-post-put-and-delete.html' title='&quot;Only get, head, post, put, and delete requests are allowed.&quot; Ruby on Rails error'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-8849891145169508986</id><published>2008-10-24T14:33:00.002+08:00</published><updated>2008-10-24T14:42:32.273+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><category scheme='http://www.blogger.com/atom/ns#' term='database'/><title type='text'>Using custom column type in Rails migrations</title><content type='html'>&lt;span style="font-family: verdana;"&gt;It seems if the type you gave to a column definition in a migration is not listed in native_database_types, Rails will just use what you gave it. &lt;br /&gt;&lt;br /&gt;Therefore this will work:&lt;br /&gt;&lt;script src="http://gist.github.com/19354.js"&gt;&lt;/script&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-8849891145169508986?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/8849891145169508986/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=8849891145169508986' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/8849891145169508986'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/8849891145169508986'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/10/using-custom-column-type-in-rails.html' title='Using custom column type in Rails migrations'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-1936688066273785191</id><published>2008-10-08T19:07:00.004+08:00</published><updated>2008-10-08T19:22:40.975+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='random'/><category scheme='http://www.blogger.com/atom/ns#' term='movies'/><category scheme='http://www.blogger.com/atom/ns#' term='geek'/><title type='text'>Obi-Wan vs Yoda</title><content type='html'>&lt;span style="font-family:verdana;"&gt;I just realized this the other night while watching The Amazing Race though it seems to have been talked about since Episode 3 was released.&lt;br /&gt;&lt;br /&gt;Obi-Wan:&lt;br /&gt;&lt;q&gt;Only a Sith deal in absolutes&lt;/q&gt;&lt;br /&gt;&lt;br /&gt;Yoda:&lt;br /&gt;&lt;q&gt;Do, or do not.  There is no try.&lt;/q&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-1936688066273785191?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/1936688066273785191/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=1936688066273785191' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1936688066273785191'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1936688066273785191'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/10/obi-wan-vs-yoda.html' title='Obi-Wan vs Yoda'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-7211816481530254335</id><published>2008-09-12T10:46:00.003+08:00</published><updated>2008-09-12T10:52:04.373+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='gems'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>Rubyforge gem problem</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Problem:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;starting the server and you get:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt; can't activate rubyforge (= 0.4.5), already activated rubyforge-1.0.0] (Gem::Exception)&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Solution:&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;remove old versions of rubyforge gem&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;jorrel@helen ~ $ sudo gem uninstall rubyforge&lt;br /&gt;&lt;br /&gt;Select gem to uninstall:&lt;br /&gt;1. rubyforge-0.4.4&lt;br /&gt;2. rubyforge-0.4.5&lt;br /&gt;3. rubyforge-1.0.0&lt;br /&gt;4. All versions&lt;br /&gt;&gt; 1&lt;br /&gt;Successfully uninstalled rubyforge-0.4.4&lt;br /&gt;jorrel@helen ~ $ sudo gem uninstall rubyforge&lt;br /&gt;&lt;br /&gt;Select gem to uninstall:&lt;br /&gt;1. rubyforge-0.4.5&lt;br /&gt;2. rubyforge-1.0.0&lt;br /&gt;3. All versions&lt;br /&gt;&gt; 1&lt;br /&gt;Successfully uninstalled rubyforge-0.4.5&lt;br /&gt;jorrel@helen ~ $ gem list | grep rubyforge&lt;br /&gt;rubyforge (1.0.0)&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-7211816481530254335?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/7211816481530254335/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=7211816481530254335' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/7211816481530254335'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/7211816481530254335'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/09/rubyforge-gem-problem.html' title='Rubyforge gem problem'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-4883034556104276652</id><published>2008-06-17T16:27:00.005+08:00</published><updated>2008-07-31T16:34:11.895+08:00</updated><title type='text'>Undo uncommitted changes in git</title><content type='html'>&lt;span style="font-family: verdana;"&gt;It seems that 'git revert' does not work the way that 'svn revert' does (reverting all uncommitted changes).  I don't know if this is the proper way, but I 'reverted' my changes using 'git stash':&lt;br /&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;git stash&lt;br /&gt;git stash clear&lt;br /&gt;&lt;/pre&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;git reset --hard&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-4883034556104276652?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/4883034556104276652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=4883034556104276652' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/4883034556104276652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/4883034556104276652'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/06/undo-uncommitted-changes-in-git.html' title='Undo uncommitted changes in git'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-181259728795890618</id><published>2008-04-28T08:07:00.002+08:00</published><updated>2008-04-28T08:11:52.490+08:00</updated><title type='text'>Ubuntu Hardy + Firefox + Firebug</title><content type='html'>&lt;span style="font-family: verdana;"&gt;The old firebug is not working for firefox 3 beta 5 in Ubuntu Hardy; and so firebug 1.1 from the &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://www.getfirebug.com/"&gt;official site&lt;/a&gt;&lt;span style="font-family: verdana;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;Solution: get the 'firebug' package from apt.  :)&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-181259728795890618?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/181259728795890618/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=181259728795890618' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/181259728795890618'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/181259728795890618'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/04/ubuntu-hardy-firefox-firebug.html' title='Ubuntu Hardy + Firefox + Firebug'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-6959859006886190710</id><published>2008-04-22T19:50:00.005+08:00</published><updated>2008-11-13T16:17:32.867+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>mod_rails + edge rails</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Based on &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://groups.google.com/group/phusion-passenger/browse_thread/thread/3182678b1862c3f1/20d05bfb466eb732?hl=en"&gt;a recent conversation at phusion passenger google group,&lt;/a&gt;&lt;span style="font-family:verdana;"&gt; there is a bug wherein mod_rails fails to start its spawner for an application that uses edge rails.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Basically, you'll get this error (complaining about a failed 'to_constant_name' somewhere):&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a style="font-family: verdana;" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_hp_olR743lI/SA3TBWJqy7I/AAAAAAAAAQw/EHQPf0a1DPk/s1600-h/screenshot2.png"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_hp_olR743lI/SA3TBWJqy7I/AAAAAAAAAQw/EHQPf0a1DPk/s320/screenshot2.png" alt="" id="BLOGGER_PHOTO_ID_5192037965507513266" border="0" /&gt;&lt;/a&gt;&lt;pre&gt;  Framework that failed to load:&lt;br /&gt;  Vendor directory: /path/to/vendor/rails&lt;br /&gt;Error message:&lt;br /&gt;  Anonymous modules have no name to be referenced by&lt;br /&gt;Exception class:&lt;br /&gt;  ArgumentError&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;More info about the bug can be found in the &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://code.google.com/p/phusion-passenger/issues/detail?id=29"&gt;bug report filed by hongli&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;span style="font-weight: bold;"&gt;update:&lt;/span&gt; This seems to be fixed in edge rails + git passenger (though I havn't tried yet), as hongli's comment below says.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-6959859006886190710?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/6959859006886190710/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=6959859006886190710' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/6959859006886190710'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/6959859006886190710'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/04/modrails-edge-rails.html' title='mod_rails + edge rails'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_hp_olR743lI/SA3TBWJqy7I/AAAAAAAAAQw/EHQPf0a1DPk/s72-c/screenshot2.png' height='72' width='72'/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-8809231607337449608</id><published>2008-04-14T11:24:00.004+08:00</published><updated>2008-04-14T11:40:48.596+08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby on rails'/><category scheme='http://www.blogger.com/atom/ns#' term='programming'/><title type='text'>mod_rails + rails 2.0</title><content type='html'>&lt;span style="font-family: verdana;"&gt;I you encounter a "500 Internal Server Error" after setting up mod_rails in a recent (rails 2.0) application, you need to delete 'public/.htaccess'.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-8809231607337449608?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/8809231607337449608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=8809231607337449608' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/8809231607337449608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/8809231607337449608'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/04/modrails-rails-20.html' title='mod_rails + rails 2.0'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-560751585941679208</id><published>2008-01-28T20:08:00.000+08:00</published><updated>2008-01-28T20:16:32.060+08:00</updated><title type='text'>Detecting the googlebot</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Detecting the googlebot as your site's visitor is easy by just checking user agent. Googlebot uses this user agent:&lt;/span&gt;&lt;br /&gt;&lt;pre&gt;Googlebot/2.1 (+http://www.googlebot.com/bot.html)&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;And in the app, we can just check:&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;request.user_agent =~ /googlebot/i&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-560751585941679208?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/560751585941679208/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=560751585941679208' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/560751585941679208'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/560751585941679208'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/01/detecting-googlebot.html' title='Detecting the googlebot'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-3307966267976985827</id><published>2008-01-25T21:20:00.001+08:00</published><updated>2008-11-13T16:17:33.401+08:00</updated><title type='text'>Planned Music Purchases</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Purchase albums:&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_hp_olR743lI/R5niuusJ5-I/AAAAAAAAAKM/LH0OcK19rcg/s1600-h/Foos-ESPG.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://3.bp.blogspot.com/_hp_olR743lI/R5niuusJ5-I/AAAAAAAAAKM/LH0OcK19rcg/s320/Foos-ESPG.jpg" alt="" id="BLOGGER_PHOTO_ID_5159404140564703202" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;and/or&lt;/span&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_hp_olR743lI/R5niu-sJ5_I/AAAAAAAAAKU/IkZ7jHs1dog/s1600-h/Gorillaz_D-Sides.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://4.bp.blogspot.com/_hp_olR743lI/R5niu-sJ5_I/AAAAAAAAAKU/IkZ7jHs1dog/s320/Gorillaz_D-Sides.jpg" alt="" id="BLOGGER_PHOTO_ID_5159404144859670514" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;once available and not too lazy to go to the mall.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-3307966267976985827?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/3307966267976985827/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=3307966267976985827' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/3307966267976985827'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/3307966267976985827'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2008/01/planned-music-purchases.html' title='Planned Music Purchases'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_hp_olR743lI/R5niuusJ5-I/AAAAAAAAAKM/LH0OcK19rcg/s72-c/Foos-ESPG.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-9209176047893225637</id><published>2007-12-24T20:08:00.000+08:00</published><updated>2008-11-13T16:17:33.522+08:00</updated><title type='text'>Windows + ext2/ext3 access</title><content type='html'>&lt;span style="font-family: verdana;"&gt;As of Ubuntu 7.10,  we now have read/write access to NTFS drives via ntfs-3g.  But what about the other way around?  I just needed that ability today to get a file from my linux install.  Since I'm too lazy to reboot twice; and since windows boots up very slow, I don't wan't to do this everytime I need a file from the other partition.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;A bit of google searching and I found this app called the '&lt;/span&gt;&lt;a style="font-family: verdana;" href="http://www.fs-driver.org"&gt;Ext2 Installable File System for Windows&lt;/a&gt;&lt;span style="font-family: verdana;"&gt;' which allowed me to mount my linux partitions to my preferred drive letter.  It gives me read and write (root) access to those files - very cool.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_hp_olR743lI/R2-kT6MUPqI/AAAAAAAAAJ0/x40D4cD7VVc/s1600-h/mounted_ext2.jpg"&gt;&lt;img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://1.bp.blogspot.com/_hp_olR743lI/R2-kT6MUPqI/AAAAAAAAAJ0/x40D4cD7VVc/s400/mounted_ext2.jpg" alt="" id="BLOGGER_PHOTO_ID_5147513561053150882" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-9209176047893225637?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/9209176047893225637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=9209176047893225637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/9209176047893225637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/9209176047893225637'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/12/windows-ext2ext3-access.html' title='Windows + ext2/ext3 access'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_hp_olR743lI/R2-kT6MUPqI/AAAAAAAAAJ0/x40D4cD7VVc/s72-c/mounted_ext2.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-1767391363202752147</id><published>2007-12-10T17:22:00.000+08:00</published><updated>2007-12-10T17:35:05.018+08:00</updated><title type='text'>Copying files using rsync</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Use rsync to copy files to files between servers through ssh with continue option:&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;rsync -P --rsh=ssh from_machine:/path/to/source.file destination/path&lt;/pre&gt;&lt;span style="font-family: verdana;"&gt;&lt;code&gt;-P&lt;/code&gt; is the same as '&lt;code&gt;--partial --progress&lt;/code&gt;'&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-1767391363202752147?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/1767391363202752147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=1767391363202752147' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1767391363202752147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1767391363202752147'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/12/copying-files-using-rsync.html' title='Copying files using rsync'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-5904138692844445656</id><published>2007-11-18T20:12:00.001+08:00</published><updated>2008-11-10T20:58:32.532+08:00</updated><title type='text'>Monaco for Ubuntu</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Trying to copy the 'All Hallows Eve' textmate theme in kate, I got stuck with the Monaco font. After a little searching, I found a nice &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://nilakanta-mallick.blogspot.com/2007/10/gutsy-gibbon.html"&gt;blog post&lt;/a&gt;&lt;span style="font-family: verdana;"&gt; which includes an instruction for adding the Monaco font to the system.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;Basically, &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://jorrel.googlepages.com/Monaco_Linux.ttf"&gt;get the font&lt;/a&gt;&lt;span style="font-family: verdana;"&gt; and run the following code to put it in the fonts directory:&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;sudo mkdir /usr/share/fonts/truetype/custom&lt;br /&gt;sudo mv Monaco_Linux.ttf /usr/share/fonts/truetype/custom/&lt;br /&gt;sudo fc-cache -f -v&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-5904138692844445656?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/5904138692844445656/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=5904138692844445656' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/5904138692844445656'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/5904138692844445656'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/11/monaco-on-ubuntu.html' title='Monaco for Ubuntu'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-1239426051200646732</id><published>2007-10-30T13:13:00.000+08:00</published><updated>2007-10-30T15:06:47.264+08:00</updated><title type='text'>HTTP basic authentication</title><content type='html'>&lt;span style="font-family:verdana;"&gt;HTTP basic authentication can be done in old rails versions through &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://blog.caboo.se/articles/2006/05/28/htpasswd-plugin"&gt;this&lt;/a&gt;&lt;span style="font-family:verdana;"&gt; plugin.&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;class ApplicationController &lt; ActionController::Base&lt;br /&gt;  htpasswd :user =&gt; 'username', :pass =&gt; 'secret'&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;span style="font-family:verdana;"&gt;Edge rails has its own HttpAuthentication::Basic module:&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;class ApplicationController &lt; ActionController::Base&lt;br /&gt;  USERNAME, PASSWORD = 'username', 'secret'&lt;br /&gt;  before_filter :basic_http_authentication&lt;br /&gt;  private&lt;br /&gt;    def basic_http_authentication&lt;br /&gt;      authenticate_or_request_with_http_basic do |username, password|&lt;br /&gt;        username == USERNAME and password == PASSWORD&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;&lt;br /&gt;I haven't tried the edge rails version though.&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-1239426051200646732?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/1239426051200646732/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=1239426051200646732' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1239426051200646732'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1239426051200646732'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/10/http-basic-authentication.html' title='HTTP basic authentication'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-5308762584733211455</id><published>2007-10-29T16:34:00.000+08:00</published><updated>2007-10-29T16:50:41.616+08:00</updated><title type='text'>Autotest and libNotify</title><content type='html'>&lt;span style="font-family:verdana;"&gt;After trying to get &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://www.mumbles-project.org/"&gt;mumbles&lt;/a&gt;&lt;span style="font-family:verdana;"&gt; to work with pidgin, I gave up and just used gnome's libnotify for the notification. Fortunately, there's a pidgin-libnotify plugin which is just one apt (or synaptic) away.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr  style="font-family:verdana;"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;I've installed and tried autotest(from the zentest gem) and it seems nice. I created my configuration file to make use of the red/green plugin and to throw notifications to libnotify. &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://ph7spot.com/articles/getting_started_with_autotest"&gt;This&lt;/a&gt; is a great article about doing that. The red/green stuff is not that much useful/nice on my terminal however because I've set it to use the green on black color scheme.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Make sure you set the path of the ruby gems. It's somehow not automatic in my machine so I had to do it manually.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;export PATH=$PATH:/var/lib/gems/1.8/bin&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Thanks to google and &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://www.locomotivation.com/comments/ruby_gem_not_found_on_ubuntu_linux/"&gt;this&lt;/a&gt;&lt;span style="font-family:verdana;"&gt; article.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;hr  style="font-family:verdana;"&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Through ajaxian, I &lt;/span&gt;&lt;a style="font-family: verdana;" href="http://www.mellowmorning.com/2007/10/25/introducing-a-cross-site-ajax-plugin-for-prototype/"&gt;found&lt;/a&gt;&lt;span style="font-family:verdana;"&gt; a way to force Prototype to do cross site scripting.  This may remove some ugly onload hacks I've done in finesay.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-5308762584733211455?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/5308762584733211455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=5308762584733211455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/5308762584733211455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/5308762584733211455'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/10/autotest-and-libnotify.html' title='Autotest and libNotify'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-2140716609558924888</id><published>2007-10-20T14:15:00.000+08:00</published><updated>2007-10-20T14:40:07.548+08:00</updated><title type='text'>Ubuntu Gutsy!</title><content type='html'>&lt;span style="font-family:verdana;"&gt;I finally installed Ubuntu Gutsy and got it working. I spent the whole night trying to move my windows xp installation from my SATA hard drive to my older IDE hard drive. I gave up by 3:30 a.m. so I just installed ubuntu on my IDE drivie.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;After downloading the iso twice and burning it to a disk (also twice). I finally got the installer running but the screen was distorted (basically some of the left part of the screen was on the right, and some of the bottom part is above). I though it will be fixed once the installation went through but it didn't.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;After searching the ubuntu forums, I found a similar problem and the fix:  recofigure xserver.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;sudo dpkg-reconfigure xserver-xorg&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;"&gt;Don't remove hal this time.&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-2140716609558924888?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/2140716609558924888/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=2140716609558924888' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/2140716609558924888'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/2140716609558924888'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/10/ubuntu-gutsy.html' title='Ubuntu Gutsy!'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-2479412574150698227</id><published>2007-10-16T22:54:00.000+08:00</published><updated>2007-10-16T23:01:00.272+08:00</updated><title type='text'>in_words</title><content type='html'>&lt;span style="font-family:verdana;"&gt;Taken from my solution for &lt;a href="http://www.rubyquiz.com/quiz138.html"&gt;a ruby quiz&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Usage:&lt;br /&gt;123.in_words  # one hundred twenty three&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;&lt;pre class="prettyprint"&gt;&lt;br /&gt;module InWords&lt;br /&gt;  words = %w(zero one two three four five six seven eight nine)&lt;br /&gt;  words += %w(ten eleven twelve thirteen fourteen fifteen sixteen seventeen eighteen nineteen)&lt;br /&gt;  %w(twenty thirty fourty fifty sixty seventy eighty ninety).each { |tens| words += [tens] + words[1..9].collect { |ones| "#{tens} #{ones}" } }&lt;br /&gt;  WORDS = words&lt;br /&gt;  MULTIPLIERS = [[100, 'hundred'], [1000, 'thousand'], [1000000, 'million'], [1000000000, 'billion']]&lt;br /&gt;&lt;br /&gt;  def in_words&lt;br /&gt;    if self &lt; 100&lt;br /&gt;      WORDS[self]&lt;br /&gt;    else&lt;br /&gt;      value, text = MULTIPLIERS.reverse.detect { |value, text| self &gt;= value }&lt;br /&gt;      multiplied_value, remainder = self / value, self % value&lt;br /&gt;      "#{multiplied_value.in_words} #{text}#{(remainder &gt; 0) ? ' ' + remainder.in_words : ''}"&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;class Fixnum; include InWords; end&lt;br /&gt;class Bignum; include InWords; end&lt;br /&gt;&lt;br /&gt;if $0 == __FILE__ &lt;br /&gt;  require 'test/unit'&lt;br /&gt;  class InWordsTest &lt; Test::Unit::TestCase&lt;br /&gt;    def test_zero_to_nine&lt;br /&gt;      assert_equal 'zero'   , 0.in_words&lt;br /&gt;      assert_equal 'one'    , 1.in_words&lt;br /&gt;      assert_equal 'two'    , 2.in_words&lt;br /&gt;      assert_equal 'three'  , 3.in_words&lt;br /&gt;      assert_equal 'four'   , 4.in_words&lt;br /&gt;      assert_equal 'five'   , 5.in_words&lt;br /&gt;      assert_equal 'six'    , 6.in_words&lt;br /&gt;      assert_equal 'seven'  , 7.in_words&lt;br /&gt;      assert_equal 'eight'  , 8.in_words&lt;br /&gt;      assert_equal 'nine'   , 9.in_words&lt;br /&gt;    end&lt;br /&gt; &lt;br /&gt;    def test_ten_to_twelve&lt;br /&gt;      assert_equal 'ten'    , 10.in_words&lt;br /&gt;      assert_equal 'eleven' , 11.in_words&lt;br /&gt;      assert_equal 'twelve' , 12.in_words&lt;br /&gt;    end&lt;br /&gt; &lt;br /&gt;    def test_teens&lt;br /&gt;      assert_equal 'thirteen' , 13.in_words&lt;br /&gt;      assert_equal 'fourteen' , 14.in_words&lt;br /&gt;      assert_equal 'fifteen'  , 15.in_words&lt;br /&gt;      assert_equal 'sixteen'  , 16.in_words&lt;br /&gt;      assert_equal 'seventeen', 17.in_words&lt;br /&gt;      assert_equal 'eighteen' , 18.in_words&lt;br /&gt;      assert_equal 'nineteen' , 19.in_words&lt;br /&gt;    end&lt;br /&gt; &lt;br /&gt;    def test_some_more&lt;br /&gt;      assert_equal 'twenty'       , 20.in_words&lt;br /&gt;      assert_equal 'seventy seven', 77.in_words&lt;br /&gt;      assert_equal 'ninety nine'  , 99.in_words&lt;br /&gt;    end&lt;br /&gt; &lt;br /&gt;    def test_hundreds&lt;br /&gt;      assert_equal 'one hundred'  , 100.in_words&lt;br /&gt;      assert_equal 'three hundred', 300.in_words&lt;br /&gt;      assert_equal 'seven hundred seventy seven', 777.in_words&lt;br /&gt;      assert_equal 'eight hundred eighteen', 818.in_words&lt;br /&gt;      assert_equal 'five hundred twelve', 512.in_words&lt;br /&gt;      assert_equal 'nine hundred ninety nine', 999.in_words&lt;br /&gt;    end&lt;br /&gt; &lt;br /&gt;    def test_multipliers&lt;br /&gt;      assert_equal 'one thousand', 1000.in_words&lt;br /&gt;      assert_equal 'thirty two thousand seven hundred sixty seven', 32767.in_words&lt;br /&gt;      assert_equal 'ten million one', 10000001.in_words&lt;br /&gt;      assert_equal 'one billion two hundred thirty four million five hundred sixty seven thousand eight hundred ninety', 1234567890.in_words&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-2479412574150698227?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/2479412574150698227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=2479412574150698227' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/2479412574150698227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/2479412574150698227'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/10/inwords.html' title='in_words'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5625362727221449997.post-1003437738867128923</id><published>2007-10-15T19:07:00.000+08:00</published><updated>2007-10-16T09:02:26.162+08:00</updated><title type='text'>to_stopwatch</title><content type='html'>&lt;span style="font-family: verdana;"&gt;Recent code I used in 2 projects.  Useful but not enough to be put in active_core.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family: verdana;"&gt;Usage&lt;br /&gt;&lt;code&gt;20.to_stopwatch  # 00:00:20&lt;/code&gt;&lt;/span&gt;&lt;pre class="prettyprint"&gt;class Numeric&lt;br /&gt;  def to_stopwatch&lt;br /&gt;    hours, remainder = (self / 3660).floor.to_i, self % 3660&lt;br /&gt;    minutes, seconds = (remainder / 60).floor.to_i, (remainder % 60).to_i&lt;br /&gt;    "#{sprintf("%02d", hours)}:#{sprintf("%02d", minutes)}:#{sprintf("%02d", seconds)}"&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;class NilClass&lt;br /&gt;  delegate :to_stopwatch, :to =&gt; 0&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5625362727221449997-1003437738867128923?l=jorrel.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://jorrel.blogspot.com/feeds/1003437738867128923/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5625362727221449997&amp;postID=1003437738867128923' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1003437738867128923'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5625362727221449997/posts/default/1003437738867128923'/><link rel='alternate' type='text/html' href='http://jorrel.blogspot.com/2007/10/tostopwatch.html' title='to_stopwatch'/><author><name>jorrel</name><uri>http://www.blogger.com/profile/04251207624235828396</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
