A friendly reminder

A friendly reminder from your local web developer/designer:

How to Ruin a Web Design – The Design Curve.

A little bit less abstract: How to live happily with a great designer.

Maybe I’m not a great designer, but I will say I may be a better designer than a lot of other web designers (and average Joes, for that matter). Hmm sounds a bit cocky, doesn’t it? Consider it an attempt to balance confidence with the proper humility.

Diggnation in La Jolla

Just got back from the taping of Diggnation from the La Jolla Brew House with my good friend Chad Martin. Kevin and Alex are down with the crew (including Martin Sargent) for Comic-Con. Kevin Gamble (aka Johnny Johnny, Mixologist) of TikiBar made several on-camera appearances offering the guys shots. Honestly, I was expecting them (especially Alex) to get a LOT more sloshed by the end of the night. Probably better they didn’t. Couple other podcasters and online personalities showed up – none of whom I recognized. Meh.

Overall it was a pretty good time. Definitely try the Brew House’s hefeweissen (I think it’s their Belgian Wheat). Fantastic.

Mr. Fish Lite is coming

If you’re interested in the DFL project, you’ll be happy to know that German and I are tasked with a bit of a crack programming job in the next week or so. Actually, we told our boss the idea we had about making a “Lite” version of the data viewer program that runs through some fancy AJAX and DOM scripting, with a Java frontend on VTK for the image production.

Crash course on DOM here I come!

Enjoy…

Export Evolution contacts data to Apple Mail

It was bound to happen – I finally got a Mac at work for most of the web/media authoring I do. It’s important for me to at least be able to send email (i.e. attachments) without having to go an extra step by copying things like PSD and movie files over to linux just so I can send an email from there…

* Open the Evolution Email app and go to your contacts card
* Select all the contacts
* Right-click one of them and select “Save as VCard…”
* Save the file as list.vcf
* Open in Apple mail (you’ll need to email for FTP the file over to your mac)

You’re done.

The one thing I was surprised (and a bit annoyed at) was that is a lot of Evolution metadata that’s been stored in the Apple address book: Things like “X-EVOLUTION-FILE-AS: Last, First”, X-EVOLUTION-LAST-USE, and X-EVOLUTION-USE-SCORE. Otherwise, it’s alright and definitely a lot better than having to retype all your contacts manually.

SSH Tunnel for Samba Shares

German (my coworker and friend) posted something a while ago which I am now finding pretty useful: http://eichberger.de/2006/01/ssh-tunnel-smb-for-mac-os-x.html

Note that this post is oriented toward those with macs, but the same should work on other *nix systems with a few minor modifications.

Why do I need this? Well, I’m still on the campus network, but currently in another building, which precludes me from being able to mount the SMB share from the file server… something about the network that neither do I care to understand at this point, nor do I need to. There’s an easy work-around:

You need to forward ports to another server/workstation that has access to the samba share. Once you have the tunneling up and running you can act as if you were sitting at that other computer.

From the terminal: sudo ssh -L 139:host-ip:139 uname@server.ext

From the “Connect to server” dialog in the finder: smb://localhost/name-of-your-share

Put it to use: an example
Say you have ssh access to a computer, mydomain.com, which also happens to host the Samba share.

Open the terminal and type: sudo ssh -L 139:mydomain.com:139 username@mydomain.com
enter your password on the computer you’re sitting at now
enter the password for the server you’re tunneling to
…ok Now you should be properly tunneled to mydomain.com

Open the “Connect to Server” dialog (Apple-K, or from the Finder: Go->Connect to Server…). Since the samba share is hosted on mydomain.com, you don’t need to do too much from here. For the sake of this example, we’ll call the mount “files.”
Enter smb://localhost/files
You’ll be asked for your username and password on the server mydomain.com

There you go… the samba share will mount on your desktop and you’re done!

php|architect

I just wanted to plug the php|architect (phparch.com) Magazine. It’s not too expensive and there are a lot of good articles each month.

One thing I plan on implementing to one extent or another is the PHP Clustering on Linux – comes from a set of articles by Joseph H. Kouyoumjian. Most likely I won’t use it exactly as described in the articles, but the idea will be useful for the load balancing approach on the new DFL web servers (and to some extent the imaging servers).

Another article worth looking at is the main feature this month (Vol 5, Issue 6): Total Eclipse of PHP Development: Banish your text editor to the dark ages! by Alexander J Tarachanowicz II. I’m already running eclipse for most of the editing needs, and it’s really something more people should consider, especially when faced with growing needs that your typical text editor can’t handle (or you don’t want to spend a load of change on other commercial IDEs).
http://www.eclipse.org/
http://www.phpeclipse.de/tiki-view_articles.php

Firefox 2.0a3 (BonEcho) for Mac

I like what I see. It’s not quite polished, but it’s surprisingly mature for such an early release.

  • It’s fast, even w/o being a native PPC G4 buld like DeerPark (3rd-party FF build). I’d even go as far to say that it’s faster than my beloved Safari.
  • Doesn’t choke. Test: myspace. Most browsers I try choke pretty easily on the crappy MySpace pages.
  • Tabs can be reordered. You heard me right. Tabs can be moved around the tab bar as you wish. Safari users who are used to switching between tabs with Cmd-Shift-arrow left/right will need to use Cmd-Opt-arrow left/right in Firefox.

As expected my plugins/extensions aren’t compatible with this release, but I’m sure update will be ready sooner or later, especially now that the browser is in alpha. Did I mention it’s fast? It’s even faster than Safari, which is surprising, considering previous versions of FF were slow unless you found a build for your processor (i.e., the G4 DeerPark build).

I didn’t find any errors or inconsistencies on the small numbers of sites I’m testing this build on this morning, though I should make sure to give much credit to the app for not choking very much on MySpace pages. Even when the browser is waiting for data from the servers or is figuring out complex layouts it’s still very responsive, for the most part.

Find BonEcho here.
If you want the current FireFox release builds for the PPC G4 and G5 processors, go here (seriously – TONS faster than the native FireFox builds from the FF people).

Smarty: sections and iterators

Just wanted to point this out to any who may be interested, or can’t seem to figure out how to hop around array indices in the Smarty template.

In straight PHP it’s simple enough to bounce around to different array indices $array[$ii-1] etc. In Smarty, not so easy.

If you want to compare the current array member’s value to the one previous, you have to use a special modifier/keyword in your template: index_previous. Likewise you’d use index_next for the next index.

{section name=ii loop=$people}
{$people[ii].name} is {$people[ii].age}
{if $people[ii.index_prev].age < $people[ii].age}
{$people[ii].name} is older than {$people[ii.index_prev].name}
{/if}
{/section}

You can find more info on Smarty sections HERE.

Glossary links, anyone?

We’ve all been to those sites before – the ones that dubiously insert advert links on keywords throughout the page. It’s pretty annoying because they often have nothing to do with the reason(s) why you were on that page to begin with. So now here I am, telling you how to do it easily. But I assure you – my intentions are completely pure!

The task: Link glossary terms to some educational material (coming from a database).

1) Pull your list of terms from the database into an array. Call it $glossary_terms

2) Run a preg_replace command on your page content:

$replace='$0';
$updated_content=preg_replace('/b('. implode('|',$glossary_terms). ')b/i',$replace,$content);

3) Display the $updated_content link instead of the original $content.

Explanation
preg_replace() takes either strings or arrays as input, which is really helpful in situations like this where you have an array of terms to which content gets checked against.
The b modifier signifies word boundaries (spaces, punctuation, etc).
The i modifier tells to a case-insensitive search.

Thanks go to xblue and MarkR on PHPBuilder.com for the pointers (especially xblue for pretty much just handing me the answer!).

Hey there! Come check out all-new content at my new mistercameron.com!