Sync And Share Your iCal Calendar With Multiple People Using BusySync and Google Calendar

Posted in General, OS X on January 11th, 2009 by Michael – Be the first to comment

My wife and I keep our calendars in iCal, but without some divine intervention we couldn’t sync our calendars or view each other’s calendar in iCal. We ran into this same issue at the office as well - I needed our Project Manager to see my calendar, but because we were both using iCal we were isolated into our own little islands of calendar hell.

So we started using Google Calendar, where we could share calendars and see each others events - even add events to each others calendars. But let’s face it… it’s just not as pretty or convenient as iCal, and it won’t sync events to my iPhone. If only there was a way to do this in iCal…

Well, I found a way. Using BusySync, I can use Google Calendar as a conduit, which holds and shares all of our calendar information. So I can see the calendars of others, and they can see mine. When I add an event in iCal, BusySync sends that information to Google Calendar, and BusySync on the other user’s computer picks it up and updates the information in iCal for them. The whole process happens within seconds - it’s pretty amazing. Watch the video to see what I mean.

So what happens if I have multiple computers and an iPhone? (Which I do). That’s where MobileMe comes in. Here’s the full setup:

We have an iMac at home which we use as our “base” - that’s where BusySync is installed. This computer is always on, so there’s never a lag in the data getting synced. If I add a calendar event on my laptop, MobileMe syncs that information with my iPhone and the iMac at home. BusySync then picks it up and syncs it to Google Calendar, which in turn triggers BusySync on other user’s machines to update the calendar event on their iCal calendar. And with MobileMe it shows up on their iPhones as well.

So with the two services combined, you can have multiple shared calendars, managed by multiple people, syncing on multiple computers and phones without doing anything more than simply adding an event.

Database Exports From phpMyAdmin Add Garbage Text After Every Link

Posted in Code, Fixit, Web Development on January 11th, 2009 by Michael – Be the first to comment

This is an issue that has plagued me for months and months, and I finally found a way around this VERY strange bug.

For some reason, exporting a database from phpMyAdmin inserts garbage after EVERY LINK in the database content. So if you have a database row with <a href="mylink"> in the data, it will end up looking something like <a href="mylink?phpMyAdmin=hxLEzQ1rOQcEE5fSSzkpIuPI8E7"> after export. Obviously, this causes all kinds of issues.

The only way I’ve found to stop this behavior is to NOT check “Save as file” when exporting your database. Just click “Go” and let the dump print to screen. Then copy/paste it into a text file (save as .sql) and import that into your database. If the export is too large to print to screen, you’ll have to manually do a search and replace on the resulting .sql file. The hash that comes after ?phpMyAdmin= is different on every export, but luckily it’s the same in each dump file - meaning it’s relatively easy to find it and replace it.

Set media=print Using The CakePHP CSS HtmlHelper

Posted in CakePHP, Code, Web Development on July 18th, 2008 by Michael – 5 Comments

It seemed so simple, yet it took forever to figure this one out. I’ve been using CakePHP for several projects lately, and I’m really enjoying using it. But much of the documentation is lacking. Luckily there are plenty of blogs detailing the progress of this framework and what can be done with it. But I searched in vain for quite a while on how to create a link to a css file and designate it for “print” only.

Here’s how to create a link to a stylesheet and set the media type to “print”:

$html->css(array('filename'), 'stylesheet', array('media' => 'print'));

That will output the following code:

<link href="/css/filename.css" rel="stylesheet" type="text/css" media="print" />

Hope that helps the next person trying to figure this one out.

Hidden Files in OS X Finder - No Terminal Hacking With Path Finder

Posted in General, OS X on December 21st, 2007 by Michael – 3 Comments

I posted a way to show hidden files in OS X’s Finder a while back and have found a much better option that I thought I’d share. Path Finder from cocoatech is an amazing app, and even with the improvements to the Finder in Leopard, Path Finder still blows it out of the water. Five reasons I can’t live without it:

1) Show Hidden Files. This is huge when you’re working with a website that requires the .htaccess file or editing system files without the Terminal. If I want to copy a folder or group of files while ignoring .DS_Store files and .svn (Subversion) files, the Finder is great. But .htaccess is going to be left behind too. Path Finder shows and hides system files with a simple “show invisibles” checkbox.

2) Those Relentless .DS_Store Files. Sure, they tell the finder what font size, color or format to show each unique finder window in, but come on… do we REALLY need this written in every folder the Finder touches whether we change the layout or not? I hate clutter. Even if it’s invisible clutter. Path Finder shows folders without adding a .DS_Store file to tell you it’s been there.

3) Compressing Folders. Have you ever opened one of those .zip files you’re sending your PC friends that you compressed from the Finder? They’re filled with all kinds of extra junk that you can’t see on a Mac, but confuses the hell out of someone on a PC who’s looking at two versions of every file in the folder (a hidden __MACOSX folder contains duplicates (0 or 1KB versions) of every file - most likely meta data about each file). Path Finder compresses folders without adding… whatever that is that the Finder adds.

4) Tabs. Tabs… hello, Apple? TABS!! They’re everywhere now. They should be on the Finder too. Even my toaster has tabs now.

5) Sort Folders First. If I had to choose one thing I miss from my days on Windows, it would be that the Windows Explorer always sorted folders first, and then files. I always found it hard to quickly find things in the Finder with folders and files all jumbled together (sorting by “Kind” fixes this… sort of). Path Finder brings that back, and it’s oh so nice.

Another nice feature (I could go on with 20 more of these, but I won’t) is something they call the “Drop Stack.” It’s a magical place where you can put files… almost like a little favorites drawer, to access quickly, or burn to a CD, without creating a folder on the Desktop for them.

So I suggest you check out Path Finder - it’s well worth the $35 you’ll shell out for it.

Local Web Development With OS X 10.5 (Leopard)

Posted in Apache, OS X, Web Development on October 30th, 2007 by Michael – 18 Comments

With the release of Leopard last Friday, it appears the bulk of my previous tutorials are now taken care of out of the box. mod_rewrite is enabled by default, and a decent (but not robust) installation of PHP 5.2.4 is ready to go - it only needs to be uncommented in the Apache configuration file.

The PHP installation is missing some key extensions, like PostgreSQL support and the GD library to name a few. But the majority of commonly used extensions are ready to go. Marc Liyanage is already on the case and working out the kinks for his own installer including those additions. The only thing missing at this point is MySQL support for Leopard. As of this writing, there is no installer available yet.

The rest of this post assumes you are working from a clean install or an “archive and install” of 10.5. I’m not sure what the Apache configuration files may look like if you simply upgraded from 10.4 or 10.3 - if they are clean this should work just fine.

Open the Apache configuration file (I’m using TextMate, which is where the ‘mate’ command comes from):
$ mate /etc/apache2/httpd.conf
and scroll to line 114 - it should look like this:
#LoadModule php5_module libexec/apache2/libphp5.so
Just remove the comment:
LoadModule php5_module libexec/apache2/libphp5.so

To enable Virtual Hosts, uncomment line 461:
Include /private/etc/apache2/extra/httpd-vhosts.conf
and add your own directories in your /etc/apache2/users/you.conf file. Similar to the 10.4 configuration, change the first two lines (inside <Directory "/Users...>) like so:
Options All
AllowOverride All

and add your Virtual Host directives after that:

<VirtualHost *:80>
DocumentRoot /Users/yourname/Sites
ServerName localhost
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /Users/yourname/Sites/devsite
ServerName devsite
</VirtualHost>

Restart Apache:
$ sudo apachectl restart
and you’re all set.

The only thing left to do is update your hosts file:
$ mate /etc/hosts
and add whatever you used for your ServerName after the other entries:
127.0.0.1 devsite

Enjoy!

Now I need to figure out if those rumors of Ruby on Rails out of the box are true…