Wednesday, November 25, 2009

My Photo Fun: Green Light (Color Accent)


Green Light (Color Accent)
Originally uploaded by goodwill1120

Kinda off topic here :) I just got my Canon Powershot S90, and one of the really interesting effect I found in this little babe is the color accent feature- basically it helps you to filter the entire picture to black and white except the color you have chosen. Kinda fun effect. So I have experiment this with a traffic light near my office, enjoy :)

Sunday, November 22, 2009

So you can actually nest rails layout in nth level...

Yeah I know probably I have overlooked this feature (I mean, I should have know this long ago :P), but this is something really handy:

http://guides.rubyonrails.org/layouts_and_rendering.html#using-nested-layouts

There are a few things you can learn here:
1. A yield can be conditional by nil- if you yield something first or yield the other one, that would give you a chance to select which to be yielded with the first one as priority.
2. So by capturing everything in the layout and then call a render function, you can nest the layout.
3. Seems this also give me the answer to find out if a content_for is defined or no, by simply checking the yield function result nil would let me know if its defined, and I think as long as its not <%= that wouldn't trigger an output as well. Sweet.

Saturday, November 07, 2009

Freebie for Ruby: ISO Country List

So every time when a customer ask you to get an ISO country list setup on your project, you start to pull your hair and dig the source. Usually you would end up finding some kind of source, but then spend a few hours to do data nursing. This is what I have did, and to avoid you do it again, here is my output:

http://gist.github.com/228512

If there is smarter way please let me know :) Otherwise hope you found this link useful.


Note: The source is from wikipedia, and it supports a names hash which allows you to put in more than name in different language. In my case I have put in english, traditional chinese and simplified chinese.

Wednesday, October 28, 2009

So here is a big reason why you should use reCAPTCHA instead of doing your own

I might be too slow for this, but reCAPTCHA actually helps to recognize old text book (i.e. Human OCR)??? That's amazing.

http://recaptcha.net/learnmore.html

Now this is a very good reason for you to use it everywhere.

Tuesday, October 27, 2009

We have launched our new company website!

It's been long overdue, but finally we have launched our new website.

With no surprise, it is powered by our own developed Content Management System, named Prism. It's somewhat based on some concepts of Radiant, but as we found Radiant is so incomplete, we have developed our own with the mighty Ruby on Rails.

If you have interest to find out more about the product, feel free to contact us via the information on the website or even just shoot a comment here.

Latest Linode Feature: One-click resizing and libcloud support!

Finally finished busying with the office relocation and renovation, today spent sometime to read linode's blog. I realize they have just released two very exciting features:

1. One-click resizing of linode: Just select your new plan and click submit, 8 minutes later you got your new resized linode!
http://blog.linode.com/2009/09/09/self-serve-linode-resizes/

2. libcloud support: Now you can utilize libcloud library to talk to linode's node management service.

I guess most of the more traditional VPS service provider are going towards more support for various management APIs to make it more competitive comparing to the cloud hype rider like Amazon. This is a very cool thing as that also means sooner or later you could have most of your VPS hosting service works pretty much like the way you program it to run as a cloud service backend.

Monday, August 31, 2009

See you all @ Barcamp.hk 09

I would probably going to Barcamp this year too, so if you guys want to see me, we could meet at some kind of Ruby/Rails section I guess...

http://barcamp.hk/

Monday, August 24, 2009

Microsoft got your post from fixoutlook.org, still not listening

The worst way to market your company is really to hear what people say about you, and then still enforce what you believe is correct:

http://blogs.msdn.com/outlook/archive/2009/06/24/the-power-of-word-in-outlook.aspx#comments


This is freaking stupid idea- basically, we are not complaining the use of Word as the mail composer, but the use of Word as the mail renderer for EVERY EMAIL. The solution is very simple- if Outlook see there is an x-header saying the email is from another outlook client, use Word engine, otherwise, use Gecko (if you can't afford to pay your IE team for the engine!) I don't see any reason not to use this as it fix both worlds- Outlook users are happy about their sophisticated Word experience, yet they still read all other emails properly. The only reason I can think of, is MS still trying to mess around the standard game, first its IE, now IE failed, so they start this again on Outlook. As a user who cares about future computing, you should really go ahead and ditch Outlook. Its just so simple- people ditched IE, so IE8 finally is standard compliant. If you ditch Outlook today, 5 years later you will have a finally working properly Outlook.