Server Side Includes: The Most Important Single Thing to Know

Includes, includes, includes. You can learn everything else later.

  1. ColdFusion: <cfinclude template = “includes/header.htm”>
  2. PHP: <? include(“includes/header.php”) ?>
  3. ASP: <!––#include file =”includes/”––>

Of course, each of these should be used within files that have the appropriate extension. The appropriate extensions are .cfm, .php or .asp respectively. Another assumption on my part is that you already have one of the appropriate server applications running to make sense of either of these.

What the hell is an ‘include’? I’ve spent some good amounts of time trying to find just these very simple include ‘tags’. The first hurdle is understanding the concept of an ‘include’. An include can insert the content of a specified text file in place of itself much like an ‘img’ tag replaces itself with an actual image or photo on screen. However, the include tag is part of a script, not part of the xhtml markup. If you look at the source of a ColdFusion, PHP or ASP web page, you won’t find any ‘include’ tags. When the file is received by a browser application it appears to be a normal html file. The advantage of this belongs in the realm of what most Dreamweaver or FrontPage web designers know as ‘Templates’. Only these are much better, because the server handles all of the updating if you make changes to parts of the template (and none of that stopping-you-from-editing parts-of-the-page crap). It’s simple: Your site’s top navigation is one file that is included into the top of every other page of your site dynamically. Updating your navigation no longer means copy/pasting your navigation markup into several or hundreds of separate html pages. Just update the one, single file. All of this is accomplished without buying a fancy Content Management System. Beautiful.

After you get comfortable with these you can always move on to the more complicated applications of these server side script languages. This one single element is huge though. To me, it brings the original meaning of PHP to mind: Personal Home Page. You don’t have to be an html guru to comprehend the impact these tags have on website management.

Please let me know of any other simple but powerful uses for any of these server-side script languages.

Ghetto iPod Blaster

Ghetto iPod Blaster

I’ve been using these for about a year now as speakers for my iPod Mini. I was painting a mural for a few months and recently I’ve been painting the interior walls of a house I’ll be renting. These old PC speakers beat the holy hell out of dragging CDs around or buying one of those overpriced iPod jukeboxes. I wouldn’t want to leave one of those in my car trunk through the winter or get paint on them. I don’t know about the quality of the sound (they are a bit ‘tinny’), but they sure do work in a pinch. It’s so simple of a concept that I won’t go into details. The picture says a thousand words. πŸ˜€

OSX: Print Contents of Folder as Text List

This Explains how to get a text version of any folder’s contents in OSX (and possibly other *NIX) added to the clipboard to be pasted wherever you like.

  1. Open the and CHANGE DIRECTORY to the folder you want to print
    1. Open Terminal and type
      followed by the directory path to the folder you need the list of contents for (example: /Users/jason/Desktop/foldername)
    2. press ‘enter’
  2. Change Directory in Terminal

    NOTE: Copy/Pasting these right now doesn’t work. I’ll get a little smarter on this and update this post as soon as possible.

    1. To get just the file names of the directory to which you just moved your Terminal, paste the following into Terminal and press Enter:
      1. ls -lT | awk ‘{print “\””substr($0,index($0,$10))”\””}’ \ | pbcopy
    2. To get file names, Creation Date, Size in CSV (If you don’t know what ‘Comma-Space-Delimited’ file is, look it up. Actually, this output is semicolon-delimited. Keep that in mind when importing into spreadsheet program) format, paste the following into Terminal and press Enter:
      1. ls -lT | awk ‘{print “\””substr($0,index($0,$10))”\”””;””\””$6″ “$7”, “$9″\”””;””\””$5″\””}’ \ | pbcopy

This seems to work, though not as smoothly as I remember OS9 doing it. πŸ˜€ However, I seem to recall OS9 having a few other problems that are not replicated in OSX. I attempted to write an applescript to execute this, but every time I try to get interested in AppleScript I quickly lose interest. If anybody out there can help me out with this, please do. I would think it would be as simple as that “File Path to Clipboard” applescript, but that’s a post I have yet to make. Let me know if this improves your Data-CD burning efficiency.

Yellow Dog Linux on G5 1.6GHz

I finally decided to go all-Linux and downloaded all 4 Yellow Dog 4.1 iso files this weekend. If I’m going to put Linux on the G5, it might as well be the most Apple-hardware specific type of Linux. I even have fantasies of checking out Compiz since all the rest of my hardware is so old and pathetic. Having Linux on my desktop as well as my laptop will allow me to move between the two of them more easily.

I can’t believe it, but I’m even starting to dislike working in OSX. It’s the little things. Does anybody know of a way to download one specific photo off of a camera using iPhoto? I don’t. The other day I was taking a pic off of my brother’s camera and I ended up spending 15 minutes downloading all 162 pictures. GTKam is so much more intuitive. More and more I am getting the feeling that OSX caters to the ‘For Idiots’ crowd. Not that they’re idiots, but they certainly don’t want to know very much about how their computer works or how and where it saves their data.

Okay, so it’s not really all that bad. Maybe I’m being way to subjective. Sometimes I wonder if I would have ever learned anything about Linux if I had bought a PowerBook instead of a G5 tower. Oh well. So I’m starting to prefer Linux over OSX. I’m still telling people that they should buy a Mac if they don’t want to worry about viruses. So I haven’t turned away entirely. Back to Yellow Dog:

I burned the first disk and tried to boot the G5 with it. It didn’t work, continued to boot into OSX and then caused a black-screen freeze or kernel panic as the Finder fumbled with the disk, unable to mount it. Once I got the disk out of the drive everything returned to normal. I guess I will download the first disk again and try it one more time. If that doesn’t work I’ll be extremely confused and frustrated. How hard can this be?