Sunday, September 28, 2008

Setting up Cake on a custom folder

I wanted to try the PHP framework Cake, but if you look at the documentation it assumes you want to install Cake under the /var/www/html folder.

You can obviously install to other folders, but if not done properly, you'll encounter a start page with no images, no styles, and some error messages.

The steps I took to make Cake work in my folder (/home/me/dev/myapp) and to work with the http://localhost/myapp URL where:

  1. Uncompress the latest version of Cake to /home/me/dev/myapp
  2. Edit my /etc/apache2/users/me.conf and add the following (replace braces with chevrons):
    Alias /myapp/ "/home/me/dev/myapp/"
    {Directory "/home/me/dev/myapp/"}
    AllowOverride All
    Order allow,deny
    Allow from all
    {/Directory}
  3. Edit the .htaccess file in your /home/me/dev/myapp folder and add RewriteBase /myapp/ to it. Should look something like (replace braces with chevrons):
    {IfModule mod_rewrite.c}
    RewriteEngine on
    RewriteBase /myapp/
    RewriteRule ^$ app/webroot/ [L]
    RewriteRule (.*) app/webroot/$1 [L]
    {/IfModule}
  4. Make sure your /home/me/dev/myapp/app/tmp folder is writable by all
  5. Restart apache

And that's it. After these steps you should be able to access your application and see the default Cake page, including images & CSS.

Saturday, September 13, 2008

Mighty Mouse design flaw

I bought a Mighty Mouse from Apple. I wanted a wireless mouse for my computer, and the Mighty Mouse seemed like the perfect choice for my Mac.

The mouse is beautiful, the buttons work pretty well and the scroll ball is great! But the mouse has a rather annoying design flaw:

You cannot lift the mouse while clicking!

Here's the problem: The mouse detects the button is pressed because you press the body of the mouse against the base of the mouse. When you lift the mouse, there's no longer pressure between the body and the base of the mouse. So our mighty mouse assumes you're no longer pressing the button.

There's somewhat of a work around for this... If you squeeze the mouse, the base does not drop and you can lift the mouse. But since squeezing the mouse brings up Exposé, things can get pretty weird...

This can be a real pain when you're trying to drag files from an end of the screen to another, or when you're trying to make a huge selection... it is one of those design vs. function options that I'm still not sure if Apple's done the right choice.