RSS Valid
XHTML Valid
CSS Valid

Baking with MAMP

Monday, April 21st, 2008

Recently I’ve been using CakePHP’s Bake tool to create quick MVC skeletons based on a predefined database structure. While the Bake itself is quite buggy and leaves a lot to be desired, it’s still definitely pretty amazing for (at the very least) creating Models and the associations they have with other models.

Because you can set MAMP to use specific ports, you may have to let your system know where MySQL is (Bake will throw that ugly where the heck is mysql.sock error). This is the same issue I’ve had when I’ve done custom MySQL installs on Mac and one of the reasons I love MAMP so. Quite simply, you just create a symbolic link (ln) from where Bake is “looking” for it to where MAMP is. Here’s what I ended up running in the terminal:

ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock 

You might also have to create the /var/mysql directory to link them if this doesn’t work. Then navigate to where your cake installation is and inside of that head to /cake/scripts/ and:

php bake.php
Read the rest of this entry »

Last.fm Widget With PHP

Wednesday, April 9th, 2008

Had a couple people suggest that I do a write up on how one might create a simple Last.fm widget with PHP. I’ll walk you through how I created the badge on typeoneerror. First of all, start by heading over to Audoscrobbler’s web services listings. Here you’ll find the XML files you need to get your playlist information. I’m currently pulling “recenttracks” so we’ll use that as an example. Under User Profile Data, click the XML link for “Recent Tracks.” To get your feed, just replace the user name with your last.fm username:

http://ws.audioscrobbler.com/1.0/user/YOUR_USER_NAME/recenttracks.xml

Read the rest of this entry »

Availability

Ben is currently employed as the Development Director at BKWLD in Seattle, Washington and is also available for freelance gigs. Please see the services and contact sections for more information or for work inquiries.