December 23, 2008 – 9:09pm Symfony 1.2: upload a file inside an embedded form

Symfony 1.1 introduced the ability to embed forms inside other forms. Symfony 1.2 enhanced this feature greatly by providing the ability to automatically save any related objects found within these nested forms (see this blog post). Another new feature introduced in 1.2. is the ability to automatically handle file uploads in forms. Basically if you have a propel object with a file field, and define this field in your form validation schema as an sfValidatorFile, symfony takes care of removing any old field, saving the new one, and updating the column in the object to reflect the new file name. Pretty sweet. (You can read more about this feature in What’s New in 1.2.)

Everything is nearly perfect, except one problem: File fields in embedded forms are *not* processed automatically. It took me a long time to track down the issue, but it was a good opportunity for me to explore some of the new sfForm framework and really get under the under to understand how it all works. More…

Posted in  Uncategorized   |     |  No Comments »   |  delicious   |  Digg

December 16, 2008 – 1:11pm CocoaMySQL finally replaced with Sequel Pro

As much as I love the command line for mysql, sometimes it’s nice to have a GUI to see your tables and columns visually or to do a data dump into CSV. On OS X I’ve always used CocoaMySQL, although it became apparent a long time ago that it was no longer under development. My brother recently told me about Sequel Pro, a “MySQL database management app for Mac OS X 10.5.” You can download it here. So far it’s been working great. It truly does feel like CocoaMySQL with a Leopard interface.

Posted in  OS X Web Development   |     |  No Comments »   |  delicious   |  Digg

December 10, 2008 – 8:05pm Starting a new symfony project: Tips for sanity and bliss with SVN

There is something gratifying about starting a new project. You get to start fresh and it may be the only time during the project lifespan where everything is perfect.

Over time I’ve learned a few tricks that personally make my project environment a pleasure to work with. More…

Posted in  Web Development   |     |  1 Comment »   |  delicious   |  Digg

November 21, 2008 – 5:39pm Javascript get window hash/anchor, get link target

There are two functions I find myself using all the time. They are very useful for javascript events that read the link href attribute to determine an action’s target. More…

Posted in  Uncategorized   |     |  2 Comments »   |  delicious   |  Digg

November 21, 2008 – 1:08pm Installing Xdebug for PHP on OS X Leopard with Entropy PHP 5

I was so ready to get my hands dirty with this. Like most cases where I try to install a custom extension or php library, the directions may appear easy but it never quite goes so smoothly. More…

Posted in  Uncategorized   |     |  No Comments »   |  delicious   |  Digg

November 13, 2008 – 3:58pm Gmail Spam from ui-mall.com — Don’t fall for it!

A friend’s gmail password was either cracked or stolen somehow and his account started sending out mass messages to his contacts. The message contains the following: More…

Posted in  Uncategorized   |     |  24 Comments »   |  delicious   |  Digg

October 24, 2008 – 5:01pm IE6 mouseover event not firing, png filter

This took me way too long to figure out. I had a series of div tags that had mousover and mouseout events attached to them using prototype. I couldn’t get these events to fire in IE6 no matter what I tried! Events worked on links, but not any other element.

First thing to check: Are you using the png filter trick?
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop src='/images/white_bg.png');

If so, make sure your mouseover elements have “position:relative” or else the event won’t fire on any element inside another element with the png filter.

This post along got me on the right track.

Posted in  Uncategorized   |     |  No Comments »   |  delicious   |  Digg

August 28, 2008 – 11:40am Using rsync to synchronize local and remote directories

When our design team is done with an html / css design, they upload it to a webserver for the client to review. Once it’s been approved, it’s time for the developers to download the static site and start integrating it into the php application. To pull down the site files, FTP does the job just fine, but invariably there will be changes made to the template even after it’s been approved. Or, perhaps the developers want to start on a few pages that have been finished before every page has been coded into html. A nice way to pull down only the latest files changed by your designers, making sure to get any related images or css files, is by using rsync.

Here is what works for us:

rsync -avcn -e 'ssh -p [ssh port number]' [user]@[your remote domain]:/home/[user]/[your remote template path]/ [your local template path]

This will do a dry-run, meaning it won’t actually copy any files, but it will show you what it would have done. When you are ready to go for it, remove the “n” from “-avcn”, and you’ll automatically pull down any files that have been modified on the remote server.

Posted in  Web Development   |     |  No Comments »   |  delicious   |  Digg

June 5, 2008 – 12:50pm Get value of radio button group using prototype

If you want to get the value of the selected element of a radio group, prototype makes this easy. There is more than one way to do it. I’ll update this post as better methods surface. Check out code after the jump.

More…

Posted in  Web Development   |     |  5 Comments »   |  delicious   |  Digg

February 29, 2008 – 1:45pm Propel Transactions with Symfony

It’s easy to create transactions with Propel. This can be very useful when you are deleting rows from your database from multiple tables, and want to do an “all or nothing” approach so that things don’t get messy. More…

Posted in  Web Development   |     |  3 Comments »   |  delicious   |  Digg