How to instal mysql or mysql2 Ruby gem for Rails 3.0.x on OS X Lion 2

Posted on July 25, 2011

This hits me every time when I try to install mysql gem on a new OS X machine. Here’s the trick and this should work for Snow Leopard too. Prerequisite Install Xcode 4.x Lion offers free Xcode 4 in Mac App Store. Download and install “x86 64-bit” Mysql DMG (link) Install all supplied packages, it [...]

applescript

Launch and Hide Applications at Login with AppleScript

Posted on August 13, 2010

There are situations when we would like to launch an application but also hide the view once it has been launched. This can be achieved with simple AppleScript: This sample code will first launch “Things” application and tells the “Finder” to hide the window. In order to run this script at login as well as [...]

Install SML Compiler on Ubuntu

Posted on March 04, 2010

Here is a short tip if someone would like to install SML Compiler on Ubuntu. Standard ML of New Jersey interactive compiler SML/NJ is an implementation of the Standard ML programming language. Standard ML has many features, including type safety, polymorphism, algebraic data types with pattern matching, higher-order functions, and a sophisticated module system. It [...]

Configure Rails migration version type

Posted on December 02, 2008

Rails use a UTC time stamp as migration version by default. Although most examples in books have simple number based system for managing migration versions, there isn’t much information about version type configuration. By default, a migration file(>=Rail 2.0) name look similar to: We can turn this off and use numeric prefixes by adding this [...]

RubyGem update on Leopard

Posted on November 27, 2008

I have a RubyGem version 1.2.0 installed on Leopard. If you would like to update RubyGems to a newer version, the RubyGem user guide suggests for modern versions( >0.8.5 ) can use the following command: gem update –system But, console told me the 1.2.0 is the latest version – Nothing to update! The work around [...]

mySQL: Error 1045

Posted on August 16, 2008

If you get this error (in phpMyAdmin or other operation) after setting up a MySQL password: ERROR 1045: Access denied for user: ‘root@localhost’ (Using password: NO) This might caused by phpMyAdmin’s configuration doesn’t have the new password. If using XAMPP, you need to update the /Applications/xampp/xamppfiles/phpmyadmin/config.inc.php for the phpMyAdmin: $cfg['Servers'][$i]['password'] = ‘YOURPASSWORD’; Change the YOURPASSWORD [...]

VirtualHost browser cache

Posted on August 10, 2008

Setting up a virtual host on PC, Mac or Linux isn’t difficult, but the browser cache problem drives me crazy. Apart from editing the /etc/hosts mappings and httpd.conf, you need to restart both Apache and browser. Refreshing the browser(Firefox) doesn’t clean the cache, so the result will be always add /xampp/index.php at the end of [...]

Leopard system environment PATH setting

Posted on August 09, 2008

Leopard PATH setting is quite different from Tiger. Configuring PATH on Tiger, we used to either modify the /etc/path or user path configuration. With Leopard, system-wide path configuration is managed by /etc/profile. The file loads a path_helper script. So what the script does? The path_helper constructs the system environment PATH in this order: Reads the [...]