Archives
Admin / Logout

Adam Merrifield

a picture of me
I am a web designer, theme designer, professional photographer and internet personality. I make many pretty things and I write a lot of content for the internet.

I am one of those guys that, because of the industry I am in, need to be connected at all times. At any given moment you'll find me posting on a forum, updating with twitter, Digging things worthy of attention, uploading pictures, or tagging cool sites.

here i am

seyDoggy Systems:
This is home base, the corporate headquarters, the hub, if you will, seyDoggy.com.

seyDesign news:
these are the RapidWeaver related posts that originally appear in the seyDesign.com blog

Uploads from seyDoggy:
these are the pictures that I upload to flickr

Merrifield Photography:
as a professional photographer I my camera ready at Merrifield-Photography.com.

delicious.com/seydoggy:
these are the websites I want to share or revisit later on. I just tag them on delicious.com.

what i am

I am the owner and operator of seyDoggy Systems, a small theme, code and design outfit based in Kitchener, Ontario, Canada. We primarily develop web based technologies but have begun to dabble in the desktop realm.

what i do

I code like a fool. I design like a fool. I am happiest when I can split my time between the two (though I tire of Photoshop faster then I do TextMate or Terminal), and somehow I have managed to etch out a living doing so.

One of My Old Favorites All Fresh and New

The postman just delivered my fresh copy of Build Your Own Database Driven Web Site Using PHP & MYSQL, 4th Edition. It’s not that there was anything wrong with my previous copy, but it was getting a little dated. Plus I am a little nostalgic for this particular publication.

With a quick glance I can already see that the book has been restructured quite a bit moving chapters around. I am really looking forward to reading this book again with renewed purpose and updated perspectives.

No comments | Trackback

LittleSnapper Touch Is Soon to Hit Realmac Lineup

LittleSnapper Touch from Realmac SoftwareThis looks interesting, a companion iPhone application to LittleSnapper (desktop Mac app) and QuickSnapper (web based snapshot sharing). It’s yet to be released but the new app, dubbed LittleSnapper Touch promises to allow the user to snap photos and webpages (or parts of them) and then post them to QuickSnapper.

Anyone familiar with QuickSnapper will be aware that you will, in turn, be able to pull down those snaps into the desktop version of LittleSnapper with a simple click of the “Send to LittleSnapper” button. It’s not clear yet whether there will be any syncing option that will negate this step. I guess we’ll have to wait and see.

No comments | Trackback

Control your processors in Mac OS X 10.5

control your processorRemarkably after nearly one month I am still trying to tweak my system just so. I think this is one of the last things though, my processor preference pane. By default, the CPU controls in Mac OS X 10.5 and not enabled and in fact, can’t be enabled unless you have the developer tools installed.

I like to be able to turn off some of my processors when I am just doing day to day web design and theme development. It’s a good way to save some energy (it’s good to be green) and to be totally honest, coding in HTML, CSS, PHP, Javascript and XML isn’t all that processor intensive. With the developer tool installed you can do this. There two things you can do, you can run the CPUPalette.app and/or you can install processor preference pane.

The CPUPalette.app can be found in /Library/Application Support/HWPrefs/. It’s a simple app that doesn’t allow much other than turning the processors on or off. If you click the little pill button in the top right-hand corner you can see a couple of basic preferences for window type, sampling rates and information display. It’s a quick and easy way to both monitor how your cores are being taxed and whether or not you can afford to shut a few of them down.

Your other option, if you you are already familiar with your processor usage, is to install the processor preference pane. Go to /Developer/Extras/PreferencePanes and find Processor.prefPane. Double click to install it. Once installed I highly suggest you click the “Show control in menu bar” for quick access. You’ll notice by installing the processor preference pane you get access to the CPUPalette.app without having to dig for it.

No comments | Trackback

Let Them Know You're Open With PHP

office hoursI wanted a php script that would inform visitors to a web page that the office was either open or closed, depending on the day of the week and what time of day it was. I made a half hearted attempt to find one on the internet, but to be honest I knew I could write one faster. I thought of making it a proper extensible class but thought I’d better move on before I tie up too much time in it.

It’s pretty basic but I thought some of you might find it handy for your own purposes. The directions are in the script itself which you can download here.

Comments (5) | Trackback

Auto mount/unmount your Mac volumes when required

Earlier this month you might recall the solution I gave you for keeping unused volumes unmounted on your mac. The next part of the equation, automatically mounting those volumes when needed to run my backup scheme, took me a little longer to sort out. In fact I wasn’t able to write a solution on my own, try as I might, so I finally went searching for one.

I needed a script of some sort that would mount my unmounted volumes when it was time for ChronoSync to run and then unmount my volumes when ChronoSync was finished. After several IRC queries, forum posts here and there and countless Google searches I finally stumbled upon this post at Mac OS X Hints. This solution was the answer I needed and it works perfectly. I won’t recap the whole thing here, but I will give you the bits that were most important to me.

Copy the following script into Script Editor.app (/Applications/AppleScript/Script Editor.app), changing the diskname and appname to suite your needs:

property diskname : "MyDisk"
property appname : "ChronoSync"

on idle
  tell application "System Events"
    set x to the name of every process
    if appname is not in x then
      if (exists the disk diskname) then
        do shell script "disktool -l | egrep -i "Mountpoint = '/Volumes/" & diskname & "" | cut -d\' -f2 | xargs -n1 disktool -p"
      end if
    else
      do shell script "disktool -l | egrep -i "Mountpoint = '', fsType = 'hfs', volName = '" & diskname & "" | cut -d\' -f2 | xargs -n1 disktool -m"
    end if
  end tell
end idle

Next you need to save it as a bundled app and select “Stay Open“, give it a useful name and save it where you will be able to find it. In my case I chose /Library/Scripts/ChronoSync/:

Save as dialog box in Script Editor.app

Then you have to make it run in the background. To do this, find your newly created app, right click on it, “Show Package Contents“, find the Info.plist and open that in your favorite plain text editor. Above the key that says CFBundleAllowMixedLocalizations you want to add the following:

<key>LSBackgroundOnly</key>
<string>1</string>

Get out of the package and find your app again and double click on it. It should launch in the background but not show in the dock. You can see that it’s running by opening Activity Monitor.app (/Applications/Utilities/Activity Monitor.app):

Activity Monitor showing our disk mounting app working

Now to truly make this process automated, you need this app to be on when your computer is on, so it needs to launch when you login. So open your Accounts preference pane in System Preferences.app (/Applications/System Preferences.app), select the Login Items tab, select the plus button button and add your newly created app:

add your newly created disk mounting app to your login items

And that’s it! Next time your backup program fires up to do it’s regularly scheduled backups, your disk mounting app will mount your volume, wait for your backup app to finish and then quietly tuck your volume back up for the night.

Other references

  1. A Script to mount/unmount a volume on app launch
  2. An AppleScript to mount, run, unmount a disk image
  3. MountPart
Comments (2) | Trackback

YourHead launches Stacks 1.0

StacksFellow RapidWeaver developer, Isaiah of YourHead Software announced today that Stacks, a fluid layout plugin for RapidWeaver, is now official, hitting the big version 1.0. Those of you familiar with YourHead’s previous heavy hitting page layout tool, Blocks, will immediately recognize what this RapidWeaver plugin is all about, but the two are as different as night and day.

Don’t get me wrong, Blocks is a brilliant feat of plugin engineering and is the life blood of literally throngs of RapidWeaver users unable to do such layouts on their own. But it’s not a plugin that ever fit my web design sensibilities. The web is fluid, ever changing, growing, shrinking… for me, Blocks was too rigid.

Enter Stacks; a completely fluid, flexible, drag’n'drop all about layout tool for RapidWeaver that can generate oodles stacked up, blocked up, split up, embedded here and there kind of page layouts that only a pocket full of hand coded snippets could achieve perviously. Just like Blocks, Stacks allows to drop in text, HTML, images and whatnot, but then it allows to stacks onto stacks and those onto more stacks. You can make columns, columns in columns, columns where one column is an image, one is some code, one is some text, etc… drag that under some more columns… before you know it, you’ve got your very own 960 Grid System built into a RapidWeaver plugin.

If you are looking for the ultimate in flexible page layout with RapidWeaver, go check out Stacks. There are some great movies demonstrating the raw power of it and there is also and Stacks API if you’re interested in creating a custom Stacks library or two.

Comments (1) | Trackback

Keeping unused hard disks unmounted

The question

How do you prevent Mac OS X Leopard from auto mounting disks, drives and volumes when the computer boots up or a user logs in? (skip to the solution)

The preamble

I have spent days (literally) searching for the answer to this one; I have a Mac Pro running Leopard with (count them) 4 internal hard drives. One is my system disk and the other 3 are backup disks. Two are weekly mirrors of my system while the third is a daily snap shot of my user account. We won’t even get into the external disks I have. Yes I am THAT anal about my data.

So what is the trouble here? When you have this many disks containing duplicate data, Spotlight, QuickSilver, Launchbar, Google QSB, etc… they all want to serve up information found on each disk. That would include duplicate information that you most likely don’t want to inadvertently open and/or edit. But further to this, why spin up a disk, potential shortening it’s life span and wasting precious energy, when it only gets used on occasion?

One way around this is to diligently eject each volume every time you boot up your system. But that is both a pain in the butt and no where near as geeky as it should be. So do a quick search on Google for a solution to “unmount disk on login” or “prevent volumes from mounting at the boot up in Mac OS X Leopard” and you get a great deal of outdated info, inefficient Apple Scripts, overly complex bash commands, apps that wrap bash in an executable app that you launch at login when the moon is at… you get the idea.

So I set forth to put together the best of the best and simplest of the simple and post it here, for my own reference, exactly what I did to prevent my back up volumes from mounting on boot up.

My Solution (proceed at your own risk)

First off, what you are going to find with most solutions out there is the need for a file called fstab in the systems hidden “/etc” folder. The trouble is that later versions of OS X (10.4.x and later) don’t have this file. However, there IS a redundant file called fstab.hd. WE ARE NOT USING THIS FILE. Instead we will create our own fstab file. So with that out of the way, let’s get started:

The short of it

  1. Start by making a backup of your system. If you bugger up your system you’ll have something to recover from.
  2. Open terminal (/Applications/Utilities/Terminal.app)
  3. Do one on the following:
    • In Terminal, type the following (with your volume name) and return *: diskutil info /volumes/DiskName diskutil info volumes DiskName
    • Or, you can use Apples Disk Utility app (/Applications/Utilities/Disk Utility.app), select the disk in question and choose “info” from the toolbar. Disk Utility information
  4. Find the Volume UUID (Universal Unique Identifier). Copy the UUID to your clipboard **.
  5. In Terminal enter and return ***: sudo pico /etc/fstab
  6. Enter your password and return.
  7. You’ll enter a window that looks like this: sudo pico etc fstab
  8. Enter the following (with your UUID) and return ****: UUID=87635CC4-B2EF-3114-B854-F64347A39630 none hfs rw,noauto 0 0
  9. Repeat step for each device you with to hide, each on a new line. device id, mount point, filesystem, mount options, dump and fsck options
  10. Exit pico (&#x2303;X) and save (Y).
  11. Press return when prompted with: File Name to Write: /etc/fstab File Name to Write: /etc/fstab
  12. All that’s left to do is is cross your fingers and reboot your Mac.

The long of it

  • * substitute “DiskName” for the name of the volume you wish to hide. If your volume name contains a space, like “Macintosh HD” you need to escape the space with a backslash so it looks like “Macintosh\ HD”
  • ** We use the “Volume UUID” as the disk identifier since it is not prone to change like “Device Identifier” (i.e. “disk0s2″) which can change with each and every start up.
  • *** This will create/edit your “/etc/fstab” file with pico, a simple text editor.
  • **** The string you are entering is the device id followed by the mount point, the filesystem, the mount options, the dump and fsck booleans. In this case:

    • the device is my UUID (UUID=87635CC4-B2EF-3114-B854-F64347A39630)
    • the mount point is “none” (because we won’t be mounting it)
    • the file system is “hfs” (since it’s formatted for Mac)
    • the mount options are “rw” (read-write) and “noauto” (volume will not auto mount)
    • the dump option (backup utility) and fsck option (filesystem check utility) booleans are both set to 0 (false, off, nil, nada) since we don’t plan to mount the volume and therefor don’t need to backup or check them

    For more on fstab column structures, visit tuxfiles fstab help.

The wrap-up

For whatever reason, Apple decided to nix fstab from it’s own Unix core. Perhaps for security or perhaps they just deemed it unnecessary. If you look in the other file I mentioned, “/etc/fstab.hd” (in terminal, enter and return: sudo pico /etc/fstab.hd), you’ll see the message:

IGNORE THIS FILE. This file does nothing, contains no useful data, and might go away in future releases. Do not depend on this file or its contents.

However, I see no harm in extending the life expectancy of my disks and saving energy at the same time. All while doing away with the annoyance of long indexing times and being inundated with duplicate search results. If you have anything to add, please feel free to leave a comment.

Other references

  1. Mac OS X Hints from 2006
  2. Mac OS X Hints from 2005
  3. Mac OS X Hints from 2004
  4. Mac OS X Hints from 2003
  5. MacSeven from 2007
  6. Garbage In Garbage Out from 2007
  7. UUID on Wikipedia
  8. Pico on Wikipedia
  9. How to edit and understand fstab files
Comments (7) | Trackback

Working with PHP, PEAR and MAMP

So I am starting to play around with PEAR in my PHP development and since I use MAMP I thought I better brush up on getting these extensions to load via the command line like they show for each extension. Knowing that MAMP works things a little differently than what’s already on my Mac I knew that there would be some trick to getting this to work. A quick Google search brought me to this article which taught me just what I needed. Sweet!

No comments | Trackback

Use RapidWeaver's %pathto()% syntax in javascript files

UPDATE (2009-07-17): We have updated the code to account for those who were having trouble understanding the reg-ex nature of rTrim. The new code and instructions should make it harder to mess up your path.

filetype_jsIt may take me a while sometimes, but there is one simple truth about my workflow, I always strive to have the most efficient way of getting things done. This is especially true in RapidWeaver theme development. Developing themes for RapidWeaver is not like standard web design. You have no way of knowing how each user will structure their site, what plugins they’ll use, what they’ll add to their pages… All of these uncertanties leave us as developers scratching our heads sometimes, trying to sort out ways of dynamically including things and stuff without the end user being able to break it.

PHP would be the obvious choice here, but we don’t have the luxury of knowing what the end users hosting environment will be and whether they could, or even would be willing to support a host of PHP functions. So the next best thing is javascript; yes it’s a little slower and it does depending on the end user having javascript enabled, but the ubiquity of javascript has never been as great as it is today.

One thing that has plagued RapidWeaver developers for some time is how to utilize RapidWeaver’s %pathto()% syntax, the bit of code that allows RapidWeaver to imprint the end users chosen common file path, in any other file other than the index.html template file. For any javascript file that has required the inclusion of another file, we’ve previously had to fill our html with scripted variables for each file, each using the %pathto()% syntax and so forth until we have built a separate path to each file from outside our javascript that actually requires it. Since RapidWeaver will only write the path to files it can actually find, you need to do this for each and every file.

Today I had an AH-HA moment while in need of multiple paths to be defined for use in various javascript files. I decide to write a small bit of code that grabs RapidWeaver’s %pathto()% syntax while it chases a real file. Then I strip out the actual file name, and KABLOW! you have a common file path in the the form of a javascript variable, ready to be used in any javascript file you like.

Get the source code.
Get the code.
Get the minimized code.

No comments | Trackback

From pixels to paper, we're getting noticed

Design by exampleThere is no greater flattery than to be made an example of so when we were asked some time ago if we would consent to being published in DesignMeltdown’s, The Web Designer’s Idea Book, I was truly honored.

Today, I received my copy in the mail and was thrilled to find these kind words on page 102 along side a screen shot on page 103:

"A great example of a unified design is the seyDesign site. It has an office theme, and everything flows together perfectly. The corkboard background creates a terrific foundation to tie the site together. It essentially gives the office supplies a place to exist."

Of course this isn’t how the site looks today, but for this 2007 iteration of seyDesign.com to be forever immortalized in print is a true sense of accomplishment. All in all, RapidWeaver developers as a whole had a good showing in this book with various sites. Adam from Elixir Graphics has already written about his contributions. and I’ve heard there are more, I just haven’t had time to look through each page yet.

To get yourself a copy of this most excellent web design resource, go to Amazon.com.

No comments | Trackback
Powered by RapidWeaver, WP-Blog and WordPress 2.9.2