• missing xbfish.com image
Software
missing xbfish.com image
Posted on

Automatically refresh Mozilla Firefox

The Mozilla Firefox addons, ReloadEvery, is a useful tool for automatically refresh or reload your Firefox.

The function is embedded in the browser context menu and it also comes with custom timing input where you can set the automatic refresh rate:

missing xbfish.com image

This is particularly useful for me especially when adding tutorial slot is instantaneous in CORS.

Automotive Video
missing xbfish.com image
Posted on

Old grandma from Taiwan riding motorcycle

The grandma is unbelievably strong to spin the big bike…

Programming
missing xbfish.com image
Posted on

[CakePHP 2.0] Authenticating user with email

By default in CakePHP 2.0, the authentication component make use of 2 fields to authenticate a user: username & password

If your web application requires user to login using email instead of a username, you can add in the following code snippet in the respective controller:

1
2
3
4
5
6
7
8
public $components = array(
        'authenticate' => array(
            'Form' => array(
                'fields' => array('username' => 'email')
            )
        )
    )
);

Take note that $components is a variable instead of a function under a controller.

Explanation: In the above code snippet, the email posted by the form will be taken as the username for the authentication component. The authentication component will then authenticate the user using email when $this->Auth->login() is called.

For more info, please refer to CakePHP 2.0 authentication component.

Automotive
missing xbfish.com image
Posted on

White headlight on my Yamaha T135

Previously, I was using a non-OEM normal bulb (35W ratings):

missing xbfish.com image

Currently, I am using this white bulb that I posted last month, (25W ratings):

Video
missing xbfish.com image
Posted on

My Heart Will Go On (in Cantonese)

Singer: Sally Yeh

Software
missing xbfish.com image
Posted on

Installing Ruby on Rails on Windows

Firstly, download the latest Ruby Installer for Windows.

Next, install Ruby using the installer. Check the following 2 boxes during the installation:

missing xbfish.com images

At the same Ruby Installer download page, download Ruby development kit and install it.

By default, Ruby Installer for Windows includes RubyGems. However, it is not the latest version. Go to RubyGems download page to get the latest RubyGems.

Extract the RubyGem package. Open up Windows command prompt and navigate to the extracted directory. Enter the following command:

ruby setup.rb

To check for gem version, enter the following command in the command prompt:

gem -v

After that, enter the following command to install Ruby on Rails:

gem install rails

To check for rails version, enter the following command in the command prompt:

rails -v
Programming
missing xbfish.com image
Posted on

Checking JDK / JRE bit version on Windows

To check Java Development Kit (JDK) or Java Runtime Environment (JRE) bit version on Windows, open up command prompt and enter the following command:

java -version

If it is 32-bit, you should see something embedded in the version info: Java HotSpot(TM) Client VM

If it is 64-bit, you should see something embedded in the version info: Java HotSpot(TM) 64-bit Server VM

This information is gathered from Java 6. I am not sure this is applicable to Java 7. If anyone knows, please comment. :)

Video
missing xbfish.com image
Posted on

张学友 – 李香兰

Classic and nice Cantonese song:

Automotive
missing xbfish.com image
Posted on

Yamaha Genuine Parts in Singapore

Below are some dealers selling Yamaha Genuine Motorcycle Parts in Singapore:

Yamaha Hong Leong Corporation
Add: 178 Paya Lebar Road, #01-01/02, Singapore 409030
Tel: +65 6746 0415
Fax: +65 6748 9238
Web: http://www.hlcorp.com.sg/motorcycles/index.asp

Chong Aik International Pte Ltd
Add: 50 Desker Road, Singapore 209581
Tel: +65 6291 2532
Fax: +65 6392 1903
Web: http://www.chongaik.com.sg/outlets

Auto Machinery Supply Pte Ltd
Add: 41 Rowell Road, Singapore 207992
Tel: +65 6292 9452
FaxL +65 6296 9944

Autocycle Centre Pte Ltd
Add: 1070 Serangoon Road, Singapore 328177
Tel: +65 6291 2515
FaxL +65 6291 7823

Programming
missing xbfish.com image
Posted on

Create new Rails application with MySQL as default db driver

To create a new Ruby on Rails application with MySQL as the default db driver in database.yaml:

rails new app -d mysql

Add -d mysql at the end of the command.