chuyeow's pings
Sort By:
Time#advance and DateTime#advance just got, erm, more betterer in Rails 2.0.In Rails 1.2.6 and earlier, Time#advance and DateTime#advance only accepted :year, :month and :day options. You’d think :hours, :minutes and :seconds would work too but due to a bug in the code (see ticket #9818), you get something like this instead:Time.utc(2000,10,1,10,30,45).advance(:days …
Edge Rails now comes with a helper for creating form labels, so in your views, instead of doing this:<% form_for(:user, @user, :url => user_path(@user)) do |f| -%><label for=”user_login”>Login</label><%= f.text_field :login %><end>where the <label> is given a for attribute of user_login (since the …
I was at the 2nd WebSG (Web Standards Group Singapore) meetup (read about the recap of the meetup) on Wednesday (28 Feb 2007) where I hosted a short session on some Firefox tips. It’s all thanks the urgings and encouragement of Lucian (the organizer) that I finally got down to publicly sharing my Firefox knowledge ever since I wrote Firefox Secrets.I was asked to blog …
I’ll be out of town (i.e. Singapore) for the next week and a half. Going to Japan, more specifically Tokyo and nearby cities. Tentacle sex and soild panty vending machines here I come!Oh and if anyone has any pointers or places/food/experiences that are not to be missed, please let me know.
I thought it was funny (I was a hardcore World of Warcraft player). All the features are so true too. Fully PvP rawr! The penalty of death sucks though - if you thought the experience point penalty in EverQuest was bad, think again.
Tom Preston-Werner (of Gravatar and Chronic fame) wrote about this neat MySQL command line “trick” where instead of ending your SELECT statements with the usual semi-colon, using a “\G” gives you a very readable output.mysql> select * from locations where location_code = 'SIN' limit 1G*************************** 1. row *************************** …
This is a 2-part journal on setting up migrating and upgrading a Subversion repository, and then using svnsync to mirror the newly created repository. (Part 2 hasn’t been written yet!)Initial setupEver since Subversion 1.4 was released, I’d been eying the new svnsync tool because we had a single repository that was not, erm, really backed up (we had daily server …
God is a new process monitoring Ruby framework with a rather rather apt name (no, it’s not that God). The config files looks something like that:God.meddle do |god| god.watch do |w| ... endendInteresting code to write. And feels safe too to have God watching over your mongrels. Oh and you ...
I had to spend some time setting up Xen on one of the new Dell servers we bought and while there was some documentation around, I had to constantly refer to the different sources since there wasn’t a complete page which had everything I needed for my particular situation - I have a host machine with Ubuntu Feisty Fawn installed and wanted to install a couple of Xen …
Ugh, I wish I found this earlier: Tab Completion in IRb. I only went googling for this after I realized I have been tabbing to get auto-completion on script/console for a bit but it never sunk in that tab-completion wasn’t ever working. Useful stuff, go set it up if you haven’t already.
Yup I switched to Apple Mail from Thunderbird a few months back, primary reason being back then I was barely able to run my developer applications on 512MB of RAM (Apple Mail runs lighter than Thunderbird, unfortunately). It’s comforting to find that there is an IMAP-IDLE plugin for Apple Mail (Thunderbird got its IDLE support way back in 2004.)What’s IDLE? Well, …
Completely by accident, I discovered that you can now drag a tab out from its current window to a new window in a recent Firefox nightly. A short video 24-second better explains what I’m talking about:This tab tearing capability is a pretty neat feature - I know you can already do this in Safari, Opera ...
I just got back from PLAY! A Video Game Symphony over at The Esplanade Concert Hall (in Singapore) and man, it was good! I had doubts at first about buying the tickets since I didn’t play most of the games on their programme, but listening and watching to the gameplay of those games that I did play was pleasantly nostalgic. Here’s what was played, with the games …
At yesterday’s WebSG meetup, someone asked me how you can have 2 different user sessions in Firefox, and I was unable to answer as I never had the need for 2 different user sessions (though I imagine it’d be nice for testing certain types of interactive web applications).Anyway, I found the answer today after some Googling - Lifehacker’s “Manage …
You’d may not have noticed this yet, but Rails 2.0 has a new convenient syntax for generating ActiveRecord migrations. Go ahead, run the migration generator with script/generate migration. I’ll wait.Yup, you can now specify the columns you want to add in your migration by passing attribute/type pairs to the migration generator. Ergo,script/generate migration …
About a month ago, I logged in to Google Reader to see a shocking thing - all my subscriptions were gone and I was subscribed to some feeds that I’ve never heard of.I would say I’m a pretty heavy Google Reader user, checking my several hundred subscriptions several times a day, so it was pretty ...
I’ve always thought the Rails installation instructions on the official Rails website were pretty straightforward, so I couldn’t help laughing when I saw this chat transcript a friend copied and pasted for me:[5:23:05 PM] X says: try so many times finally can le[5:23:23 PM] X says: it is not about the version or wat[5:23:46 PM] ...
Not too long ago I was asked to use hook up the Mac Mini that was collecting dust in our office to our HP Deskjet printer (HP Deskjet 1280 to be exact) and have it function as a “print server” of sorts (we have since replaced it with a NAS with print server functionality, which subsequently broke - that’s how long this post has been sitting in my drafts …
I like to keep my links in my Rails applications that make AJAX requests degradable in non-JavaScript browsers so I often find myself doing this:link_to_remote 'Show details', { :url => { :action => 'show', :id => post.id } }, { :href => url_for({ :action => 'show', :id => post.id }) }This allows me to get HTML links like so:<a …




…