My new toy.. MacBook Pro

I come from a Linux background but heard many great things about Macs, especially from my designer friends. I finally went out and bought one. It cost me more than my car, so “buyers remorse” was immediate.

The first night was not quite a good experience, probably because I was a die-hard Linux/Ubuntu user and not quite sure, “Where should I put my stuff?”. This machine cost me more than my car and I didn’t feel like breaking it (I knew I couldn’t break it. No comments, please.)

The weekend was kinda shot for playtime because of Mother’s Day, but after some work I finally have a working CakePHP LEMP development environment setup. In other words, I can do my job.. meh.

So tonight I’m playing with all the bells and whistles when you get to play with..

[To be continued]

Redirecting bookmarked links: A quick hack

This question was asked on #cakephp:

I have a cake app that was not using mod rewrite so url are like /index.php/home Now I've started to use mod rewrite. How can i redirect users who still use /index.php/home to /home? The page shows fine except the css and js are not correct. The path of the css becomes /index.php/css/layout.css. I guess it's just some mod rewrite rule which would fix this bug I'm no apache expert

I was intrigued by this problem. Looking at the rewrite rule, I did not see a way to incorporate what the OP was hoping to do.

At first, I thought this could be done in APP/config/routes.php. After some trial and error, I realized this would not work either.

Finally, I came up with a solution that seems to work. In APP/webroot/index.php before any existing code place the following snippet:

	if (preg_match('/\/index\.php/', $_SERVER['REQUEST_URI'])) {
		$newLocation = preg_replace('/\/index\.php/', '', $_SERVER['REQUEST_URI']);
		header('Location:' . $newLocation);
	}

Gift of love

Gift of love on Christmas day,
For us to heaven paved the way.
The Child was sent to conquer sin,
Redeeming those who believe in Him.

Gift of love, He suffored long,
So we could sing redemption’s song.
He came, redeemed, now leads our way.
Earth celebrates His birth this day.

– Helen Gleason

About Dogs and People

  • If there are no dogs in Heaven, then when I die I want to go where they went. – Will Rogers
  • The average dog is a nicer person than the average person. - Andy Rooney
  • Everything I Need to Know I Learned From My Dog:
    1. When loved ones come home, always run to greet them.
    2. Never pass up the opportunity to go for a joyride.
    3. Allow the experience of fresh air and the wind in your face to be pure ecstasy.
  • If you pick up a starving dog and make him prosperous, he will not bite you; that is the principal difference between a dog and a man. - Mark Twain
  • There is no psychiatrist in the world like a puppy licking your face.  - Ben Williams
  • Scratch a dog and you’ll find a permanent job. – Franklin P. Jones
  • Don t accept your dog s admiration as conclusive evidence that you are wonderful. – Ann Landers
  • Properly trained, a Man can be Dog’s best friend. - Corey Ford
  • I wonder if other dogs think poodles are members of a weird  religious cult..  - Rita Rudner
  • Ever consider what our dogs must think of us? I mean, here we come  back from a grocery store with the most amazing haul chicken, pork, half a cow. They must think we re the greatest hunters on earth! – Anne Tyler
  • Anybody who doesn t know what soap tastes like never washed a dog. - Franklin P. Jones
  • If I have any beliefs about immortality, it is that certain dogs I have known will go to heaven – and very, very few persons. – James Thurber
  • The most affectionate creature in the world is a wet dog. – Ambrose Bierce
  • My dog is worried about the economy because Alpo is up to $3 a can. That s almost $21 in dog money. – Joe Weinstein
  • If your dog is fat, you aren’t getting enough exercise.
  • My Goal in life is to be as good a person as my dog already thinks I am.
  • Dogs love their friends and bite their enemies, quite unlike people, who are incapable of pure love and always have to mix love and hate - Sigmund Freud
  • Dogs are not our whole life, but they make our lives whole. - Roger Caras
  • The reason a dog has so many friends is that he wags his tail instead of his tongue.
  • Women and cats will do as they please, and men and dogs should relax and get used to the idea. – Robert A. Heinlein

How I spent my Saturday morning

I love Saturday mornings. No alarm goes off and I can spend time surfing the web for fun!
This morning I did a vanity google on my name.  It was fun! I learned that there are a few people I never knew about before that share my name. One person is a producer for A&E. Very cool. Then comes the usuaL suspects, my dad and my son.
I learned other namesakes had references to obituaries from Connecticut. It was sad to see one of his siblings passed away at an early age.
I learned that there is a person in my hometown who goes by the name I am known by in my family. It is very strange I never heard of him.
I learned I still have an account with myspace. Woohoo! ;)

Multiple CakePHP applications, multiple CakePHP versions

In an earlier post I showed one method of maintaining multiple applications using a single core library. One shortcoming with this method is if you have applications built on a different CakePHP version. Unless you update your older applications, you will need to have a separate cake library.
One way around this is to go to /usr/share and execute:

git clone https://github.com/cakephp/cakephp.git cake12
cd cake12
git checkout --track -b 1.2 origin/1.2

Now in the application webroot, add the line to the .htaccess file

php_value include_path ".:/usr/share/cake12"

Now, your CakePHP 1.2 applications should run happily alongside your 1.3 apps and you can easily update the core as necessary.