Archive for Category ‘Reviews‘

 
 

Handcrafted CSS Book Review

Handcrafted CSS As a developer now a days, it’s becoming more and more important to have a firm grasp on front-end development. The rise of Ajax has impacted more than just Javascript though — the document object model has been a driving factor in how easy it is to work with an Ajax heavy page. Getting a handle on good DOM design and the use of the right HTML elements with CSS markup does more than just make the HTML look pretty — it makes your life MUCH easier when it comes to maintenance and Javascript integration.

A few years ago, I read an amazing book that turned me on to this idea called Bulletproof Web Design by Dan Cederholm. You can read my glowing review as a sign that it’s a book I often recommend. Handcrafted CSS is a the latest book by Cederholm, and runs a similar track. While BulletProof is geared towards designers with some CSS experience, with the goal of refining their skills, Handcrafted CSS focuses on how to integrate CSS3/HTML 5 techniques into your existing skill set.

Browsers Matter

One of the main questions the book asks is Do Websites Need to Look Exactly the Same in Every Browser? (actually, that site is featured in the book). While previous design ideas concentrated on creating a look that was identical in every browser, Cederholm focuses a lot of attention on the idea of progressive enhancement. Instead of crafting every little detail the same in multiple browsers, certain details could be considered browser specific. Rounded corners are a prime example. They are an absolute pain to do cross browser, yet if you concentrate only on Firefox/Webkit/Opera you can round corners in a single line, or at most a few lines:

.rounded {
  border: 1px solid #3792b3;
  border-radius: 4px;
  -webkit-border-radius: 4px;
  -moz-border-radius: 4px;
}

One thing you’ll notice a lot throughout the book, is a focus on cross-browser support for CSS3. For instance, the border-radius attribute is not yet implemented by Firefox of Safari – the implement browser specific rules instead. So although the border-radius property won’t be used by these right now, once these browsers support the final version of CSS3, you won’t have to make any changes to your CSS. This futureproofing, and paying attention to flexibility is what Cederholm considers as craftsmanship; where the developer goes a step beyond the result and concentrates on longevity.

What’s this RGBA thing?

Although I’d heard about just about every concept in this book, it put a new spin on all of them. There was one addition, however, that I was completely unaware of — RGBA. Defining colors using RGB has been possible for a good decade or so, but the A makes all the difference. RGBA (red, green, blue, alpha) defines the amount of red/green/blue (as integers from 0 to 255), as well as a transparency amount from 0-1. Much of what you can do with RGBA was available using the opacity CSS attribute, but some of the major differences are highlighted.

h1 { color: rgb(55, 146, 179); }
h1 em { color: rgba(55, 146, 179, .8); font-size:80%; }

The first rule uses only rgb, generating a 100% opacity, normal font color. The inner <em> uses rgba for colors, specifying a .8 alpha amount. This creates a very pleasant affect where the emphasis text is a little bit lighter than the h1 text. As someone who get annoyed picking out tons of very similar font colors, being able to just lower the alpha transparency to create new colors is a huge time saver. It offers an additional bonus over setting opacity as well. Take for example a popup box on a page that you want to have a partial opacity — like a lightbox. If you set the opacity of this box to something, say .25, then the box and the text within the box will both be partially transparent. Usually you’ll just want the box itself to be like this. Using RGBA you can do exactly that — setting the background of the box to a a .25 alpha amount.

Going a step Farther

These are some of the easiest to describe parts of the books, but it goes into many more ideas. Float management, fluid grid design and even adding the extra touch with some Javascript (jQuery is the language of choice) are all entire chapters. I grabbed the video version of the book as well, which I’m gad I did. It features just over an hour of Dan Cederholm talking about each of the 10 chapters from the book. For the most part it’s all him talking — not reading from the book — but elaborating on some of the ideas. It occasionally shifts to the demo Tugboat side used in the book, with voice over description. If you read through the book completely you won’t learn anything new from it, but it serves as a good reminder of what the major focuses of the book are distilled to 65 minutes.

Who is this book for?

If you already have your head around CSS, and want to elevate your skills with some CSS3 spice, and focus on craftsmanship for current CSS ideals, this is a good one to checkout. What it’s not is an encyclopedia of all that is CSS3. Not all chapters are on CSS3 either, although many of them mention solutions with IE6 incompatible of solutions. For these it usually gives an IE6 solution, using css hacks (rather than optional html includes for a special stylesheet). Even though it’s not comprehensive, what it does cover, it handles very well. My only complain would be that it seemed a bit short. I finished it on a plane ride — and I’m not a fast reader. The full code from the book is available on the official site, but only if you have the book. :) The Tugboat example used is very pretty though, and a lot can be learned from the source. If you see it a store, be sure to give it a once over and see if it’s for you.

8 Awesome Uses for DropBox

Although only a very small part of my backup strategies post dealt with Dropbox, after using it for a second week I’ve fallen for it. Sure, it’s useful for syncing commonly used files between computers, and there’s many more files that it would be useful to have revision history on, but there’s more to it than just sharing files. With that in mind I’ve been on a rampage to use it for simplifying my life as much as possible. Here’s a few tricks I’ve found that help make things easier.

Backup Folders Not in Dropbox

Right now Dropbox installs itself into a pre-selected location, then everything in that folder is archived in Dropbox. Syncing outside of the Dropbox folder is on the todo list, but for now there’s a workaround to do this. Create a symbolic link within the Dropbox folder pointing to the folder you want to archive. For instance, lets say within Dropbox you want your Documents folder. To do this you’d create a sym link for this.

ln -s ~/Documents/ ~/Dropbox/Documents

Dropbox should start syncing right away, and will sync from here on out whenever. Anything that goes into your ~/Documents folder will be backed up. One very important thing to note is that if you delete something from the ~/Dropbox/Documents folder on another computer, it will be removed from your ~/Documents folder on the computer with the symlink, so keep that in mind.

Syncing Adium Log Files Between Macs

So you’re looking through chat logs for a conversation you know you had, but you can’t seem to find it. Turns out it was on a a different computer. Has this ever happened to you? There’s a convenient way of syncing Adium log files (or any other log files) with Dropbox. Adium doesn’t allow you to change your Log directory, but there’s no reason why you can’t make the default location a smylink to somewhere else. I have a ~/Dropbox/Sync directory where I store any settings/items that I want to keep in Sync between computers, so this is the perfect place for it. I created a ~/Dropbox/Sync/chat folder, quit Adium and dragged my existing Adium logs folder into Dropbox (from /Users/adam/Library/Application Support/Adium 2.0/Users/Default/Logs). All you have to do is point a folder at your Dropbox and you’re good to go! In my case, the command was:

ln -s ~/Dropbox/Sync/chat/logs/ "/Users/adam/Library/Application Support/Adium 2.0/Users/Default/Logs"

Just setup multiple computers with this same path and you should have a single repository for all your chat logs. I’m not too sure how this works with conflict resolution, but unless you’re chatting to the same person on multiple computers at the same time you should be good. If you’ve tried that though, I’d be interested to see how it works.

Backup configuration

This was mentioned earlier, but having a shared space for your backup scripts makes life easier. Dropbox is amazing, but the Dropbox application does have the ability to delete files from your computer. Lets say the worst happens and they delete your account, causing your Dropbox to be deleted on all your computers — would you mind? If you have your ~/Documents and other folders linked, this might be a huge blow to lose unless you’re backing it up somewhere. This same doomsday scenerio could happen if someone hacks into your Dropbox account and removes your files from the web interface. You’ll probably be able to restore them in that case, but then you’re relying on Dropbox to fix the Dropbox problem.

A more secure way of handling this might be to have a full copy of your Dropbox somewhere locally. With Dropbox maxing out around 55GB, making a full copy of this on some HD you have laying around isn’t a bad idea. Automating the process and backing up your Dropbox nightly is even better though! So what would something like this look like.

rsync -rpLtgoDE --delete ~/Dropbox /Volumes/Drobo/Users/adam/current

This rsync command will copy everything from my Dropbox to a local directory, in this case on a Drobo. This follow all symlinks and copy the contents of them, rather than copying the symlinks themselves. Try saving this one line in a file, backup.command. You should be able to run it by double clicking or from terminal. I store this file in ~/Dropbox/Sync/scripts/backup.command so it can be edited from anywhere.

Version your crontab

You don’t want to run that backup script manually everyday do you? To save time (and guarantee a good backup strategy), you’ll want to have this automatically run. I’ll recap real quick how to set this up. Just open up terminal on the computer you’ll be automating the backup. You can call things on a scheduling using cron, which can be opened by entering crontab -e. I’ve decided to run the above script every day, and backup my list of cron jobs every day.

@daily crontab -l > ~/Dropbox/Sync/scripts/crontab.txt
30 3 * * * sh ~/Dropbox/Sync/scripts/backup.command

The first line will save the crontab contents in the ~/Dropbox/Sync/scripts/crontab.txt file. The @daily parts means this’ll happen every night at midnight. The second line is scheduled to run every night at 3:30am as well, but usually takes a little longer. Rsync isn’t the fastest in the world, but it’ll get the job done — usually in under a minute for me.

Sync Your Things Tasks

For a while during the beta, Things was my GTD/todo list of choice. The interface has a level of polish that few apps obtain — and even fewer in the GTD relm where complexity is the norm. One downside of Things is that it doesn’t use MobileMe syncing like OmniFocus, it’s competitor. You can get around this and use your Dropbox for syncing in the same way as Adium though. Just close Things and move your Things database files folder to your Dropbox on one computer — I threw it in ~/Dropbox/Sync/Things. Create a symlink from where it used to be to the new Dropbox location and you should be good! You’ll need to do this same step on your other computer(s), but without the copying the file to Dropbox step. This does have a caviat though — you must close Things each time you switch computers. Unlike Adium, when there’s a conflict, well it’s very bad. Your Things database is a single XML file that cannot be merged. So be sure to always close Things when you switch computers to be safe. If anything goes wrong though, you can always sign into the Dropbox web interface and roll the file back.

Or you could just use Remember the Milk and not have to worry about syncing.

Host a Local Wiki

TiddlyWiki is a Wiki unlike any other I’ve heard of. It has all the storage characteristics of a normal wiki, but exists as a single html file that edits. Just copy it to your Dropbox, open it up in Firefox (you are using FireFox right?) and start making changes. Upon saving it’ll update the file in Dropbox. As with a few other tips, you probably shouldn’t have TiddlyWiki open on another when saving. If you’ve jumped on the TiddlyWiki bandwagon but you’re using a USB drive to transfer your Wiki around, Dropbox is a simple upgrade to save some time.

Sync your Passwords

I don’t personally use any sort of password manager, but LifeHacker has a good article on How to Use Dropbox as the Ultimate Password Syncer. According to the Lifehacker article, changes are pulled in right away, even when using multiple computers. This is because 1Password, the password manager used in the article, stores your data in lots of little files, making it ideal for minimal conflicts.

Sync your Firefox Bookmarks

Firefox bookmarks are another one that seem like a no-brainer to use Dropbox for. There are so many different bookmark sync services out there that can do this, but why use another service when you’re already using Dropbox? The basics for this are just copying your firefox profile to Dropbox, then starting Firefox with the -p option which allows you to specify a profile path. Just follow the directions on how to Sync Firefox Bookmarks from the Dropbox Wiki and you should be good. This tip doesn’t use symlinks like a number of others, making it a little easier to setup.

Join Dropbox

Dropbox provides 2gb of storage out of the gate, but if you signup with a referral link, you’ll get an extra 250mb of space (and I’ll get an extra 250mb too)! The desktop app works on Mac, PC and Linux with a very simple install on all of them. If you join up and have any other tips or tricks, feel free to share them here!

Building the Ultimate Media Center, Part 2: Plex

If there’s a killer app out there in the media center world, it’s Plex. Built on the long running XBMC, Plex is a fork of the project optimized to run on the Mac. XBMC has been around since the first Xbox, making one of the most established media center platforms out there. It’s long outgrown the console however, and now serves as the core for projects like Plex and Boxee. It was also featured on a recent FLOSS Weekly episode which is worth a listen. With lots of recent talk about Boxee, I thought I’d add Plex to the conversation with a little talk on why I think it’s the best media center software available.

Plex - Home Screen

Media Management

Like other projects based on XBMC, Plex has built in capacity for managing your media collection. This enables Plex to have an internal listing of what movies you have available in a much nicer format than the typical folder structure. Within Plex you do this by adding sources (in the form of folders containing files) and specifying what type of content resides there (movies, tv shows, music videos). Plex even allows for different sources to pull down the information on the video — from IMDB, OFDB, MovieMaze, TheTVDB, TV.com and many more. If you want to pull data from another site, it can be added using Python, so if a better movie database comes out, it’s just a matter of writing an adapter for it. Plex uses the file name or folder name to look it up, so it’s important to name your files correctly and add the year the movie/tv show was released. You can do this manually from within Plex as well, but it’ll find your media on IMDB if your files are named correctly.

Plex - Movie List View

One issue that always come up when crawling a media collection is varying file format and folder structure. Chances are not all of your videos will be in the same format. Some might be single file avis, mkvs, or they might be in multiple small files (disc1, disc2), or even in DVD rips (in a VIDEO_TS folder) or Blu-ray rips. If you follow Plex’s conventions, all of these can be used and you won’t even have to concern yourself with it later on. Here’s a sample folder structure for this setup:

/WALL.E (2008).mkv
/Wanted (2008)/any_file_name_disca.avi
/Wanted (2008)/any_file_name_discb.avi
/Waltz with Bashir (2008)/VIDEO_TS/* (DVD contents here)

To Plex all these will be listed the same, with IMDB show descriptions, artwork, genre listing and even actor/actresses if you want. When you play “Wanted (2008)”, it’ll queue up all files in the folder and play them in alphabetical order. I sometimes notice a short skip when it transitions to the second video, but it may not be noticeable all the time. Playing the DVD file is very similar as well. Upon selecting it to play, it’ll open you up to the DVD title menu, the same menu you’d go to if you were using the DVD itself! I’ve found there is a bit more overhead to using DVDs, as it has to put the entire menu into memory, rather than streaming the video from the start. This is really only an issue if you’re playing your media off a NAS. DVDs will still work, but they won’t be as snappy at starting.

Plex - Single TV Show - Arrested Development

TV shows are categorized by season number, but aside from that they work the same. Each season has it’s own folder, and within that each episode is named accordingly. You can choose to add in descriptions, or leave them blank. You can also combine episodes if multiple ones are in the same file.

/Arrested Development (2003)/Season 1/Arrested Development (2003) - S01E01 - pilot.avi
/Arrested Development (2003)/Season 1/Arrested Development (2003) - S01E02.avi
/Arrested Development (2003)/Season 1/Arrested Development (2003) - S01E03-04.avi

Like with movies, TV DVDs also work here, but you’d want to check the Plex Wiki for instructions on setting that up.

In addition to downloading cast, banners and artwork from movies and TV shows, Plex will also download TV theme songs. As you’re browsing through your TV shows you’ll hear a little snippet that Plex was able to grab for each series. One very relivieving thing to note is that Plex won’t touch your media folders or add new files to them at all. You know how you can set iTunes to manage your media library? There’s no similar setting on Plex. You have full control of your files, and Plex won’t alter them in any way. The additional files that Plex downloads will be stored your Application Support folder on the computer running Plex.

Library Searching

After all you files have been discovered by Plex that’s when the fun begins. Just browsing your movies and tv shows is a visual treat, and the Plex team has done an excellent job of making the experience similar regardless of what type of artwork is available. You can filter Movies or TV shows by year, imdb rating, director, genre, actor/actress, and even whether or not you’ve seen them or not. The ability to list what you haven’t seen, and even hide descriptions for new items, is extremely useful, serving as a bookmark for where you left off in a series. The Favorites system that was recently introduced gives one click access to some commonly used movies, shows or even apps. I’m currently re-watching a TV Series, so having in Favorites saves time. If you’re using a Harmony Remote, you can even setup a button to open favorite directly.

For instance, if you wanted to watch something with Christian Bale in it, you could filter your entire movie library to just movies he was in. Plex keeps an internal actor/actress list if you specify it when adding a folder (a source).

Plex - Actor Search - Christian Bale

3rd Party Plugins

With a little background in Python, anyone can create plugins to pull video from other sites. Since this feature was added to the .7 release of Plex a few months ago, there’s been a huge flood of these apps making Plex better and better. Some of the more popular include Hulu, Joost, MTV, Comedy Central, South Park, Ted, Escapist Magazine (Zero Punctuation!), Youtube, Apple Trailers, Pandora, CNN, The Onion, Daily Show, Colbert Report — the list goes on and on. The framework for building these apps allows full screen playback and scaling of flash videos, which just about all of these are. Need to click on a close button within the video so an ad doesn’t show? The plugin developer can even do that. These plugins have quickly become one of the most useful features in Plex for expanding it into new territory.

External Applications

You can setup any application to launch from within Plex. When this application is closed, Plex is reopened. This seems like a throwaway feature at first glance — why would you need to open up something else when Plex can do so much? But from a media center standpoint it helps having one more way of extending the livingroom feel without having to go back to the mouse/keyboard setup if you get it right. One application that is a prime candidate for launching in this manner is Emulaunch, and emulator launching program. Emulaunch fits in perfectly — running full screen and launching ROMs full screen. Emulaunch isn’t an actual emulator program, for that you’ll need something like SNES9x. Emulaunch will run the rom using whatever program it’s associated to run in (whatever program would run it when you double click). Without much trouble at all I was playing some Zelda a Link to the Past launched from Plex. If you were playing a specific game repeatedly, you could also set it up to run directly from Plex by launching the emulator you’d want to use and passing the game in as an argument. Since it’s possible to use Xbox 360 controllers (both wired, or wireless if you buy the controller adapter), this could easily become a new center for gaming.

Remote Control

I mentioned this last week, but it bears repeating — Plex has excellent support for apple remotes and Harmony remotes. I’d been using an Apple remote for the past year without any trouble actually. It’s so simple to use that you could give it to someone who’s never used Plex before and they’d be able to navigate around, play videos and even browse Hulu. To be fair, you can do all this with an Apple remote from Boxee as well. One of the advantages of Plex though, is that by holding down the menu button, you can get a list of advanced features which become important in managing a media collection.

You could be perfectly happy running Plex with an Apple remote for a long time. I still plan to use it when people are over because of how easily new people take to it. For general use though, I love having a universal remote — a single remote for all my devices. That’s where the Harmony One comes in. With the One, and other higher end Harmony remotes, you set all devices through the bundled software. I was shocked when I went to add my Mac Mini here only to find Plex as a listed device. This sets up the remote with all of Plex’s default keys, getting your running with Plex right away. There is also a screen from within Plex to set this up which can be set for the Harmony line of remotes.

Harmony Settings for Plex
Plex - Harmony screen


If you're wanting to learn more about Plex, it's worth watching the Plex Screencasts to get the hang of what it can do.