Posted on April 19th, 2008
It’s been a while since I did an Appdate, but here is number 11.

Today’s pick is called NicePlayer and it is as they say themselves “Quite simply, the nicest media player for Mac”. In the backend NicePlayer uses Quicktime and all available components to playback media, but in the frontend there is a major difference.
The frontend look is very fresh and exactly what I needed. First of, the entire app can be made to “float on top” which is a major issue if you like to watch video on your 13-inch MacBook while doing some other work. Quicktime doesn’t support this and that has bugged the hell out of me for years.
But even then, if you manage to get Quicktime to float on top with some third party plugin, you’re still stuck with that bulky Quicktime interface. The NicePlayer interface though, is border-less, buttonless, and therefore only uses the minimal screen estate needed for playback. The look is a lot like those embedabble flash players you find on video sites like Vimeo, but instead it is an actual desktop app.
NicePlayer is open source, free as in beer, and only 2.8mb to download. And with joy I can say that it is my new default media player.
Posted on April 14th, 2008
Posted on April 7th, 2008
Update: It seems that my bookmarklet did not work in every browser, as Flick renders the sets differently in different browsers. I updated the code and it should now work.
As I was playing with Vimeo for the video of the Torchwood Swede, I ran into an issue that needed a bookmarklet to solve it. I have never made a bookmarklet, but now here it is.
The problem was that when you want to add photos to a Vimeo video all it accepts is a comma separated list of either URLs or Flickr Photo IDs. I already had made a set on Flickr of the photos I wanted to add and adding all those 18 URLs by hand was just too much work
So I got thinking: why not make a bookmarklet that gets all the links of the images in the set from the page, and outputs them to the user as a comma separated list? Although I have never done something like this before, it only took me a few minutes to build this and the result is the following link.
Flickr Set Photos for Vimeo
Using it is very easy. Just drag the bookmarklet into your bookmarks-bar. Now when you want to add all the photos from a set to your Vimeo photo, go to the phoo set on Flickr and click on the bookmarklet. This will give youa popup with a long code of text. Copy and paste that text into your Vimeo text boxx for photos and submit.
The code has a few small issues. First of it returns URLs, not Flickr Photo IDs. This doesn’t really matter but it would be more human-readable maybe. Secondly it doesn’t catch if it is on a Flickr site at all. I might change that in the future but probably won’t. If you want to make your own edit, you can download the source from here.
To make this bookmarklet I used some code from this site, and this little tool helped me out to compress the code.
Posted on February 9th, 2008

If you ever read the comments here, you might have noticed the avatars that show up with some people. These are not Gravatars or MyBlogLog avatars, no they are avatars personally hosted by those commenters on their own site. What drives this mechanism? The plugin is called hAvatar and the technology involves Microformats.
hAvatar is build by Alper and what it does is simple: it fetches the URL you use in the comment (either your OpenID or other URL) and sees if you have a hCard on that page. A hCard is a Microformat and is nothing more than some extra semantics added to your page that represents you business-card. In the very literal sense, a hCard is the Microformat equivalent of the vCard format.
Now, if your hCard has a photo attached to it, the hAvatar plugin will take that URL, wrap it in a
tag and return it to the template. All you then need to do is call the hAvatar call somewhere in your comments loop, and boom you have an open-standards-defined avatar system on your blog!
Download it here and take a look at my front page for an example of an hCard with an attached photo. People using the plugin at the moment include MissGeeky, TheBleacher, and obviously Alper and I.
Posted on February 5th, 2008
About 2 weeks ago I wrote about a little script I used to backup some of my Wordpress installs automatically to Subversion. A serious problem arose with this method though, and the main reason was this line:
svn add --force *
I used this line to automatically add any new files to the repository. This was handy because often new files are created (e.g. attachments for posts in a blog), as you wouldn’t want to do this by hand every time.
This code doesn’t keep in mind deletes though. If you delete a plugin in your Wordpress, SVN will miss it and start complaining. Additionally the method above overwrites SVN:Ignore settings, which means you can’t ignore certain files (e.g. cache files that change constantly).
So instead I decided to come up with a new solution: see what files are new and what are removed, and perform “svn add” and “svn remove” actions on those files. I used a bit of code from this blog to come up with a fairly good solution.
And replace it with:
svnstatus=$(svn status)
added=$(printf "$svnstatus" | sed -n 's/^[A?] *\(.*\)/\1/p’)
removed=$(printf “$svnstatus” | sed -n ’s/^! *\(.*\)/\1/p’)
What this does is run the “svn status” command that will return a text output of all the modified files (starting with a ‘M’), added files (starting with a ‘?’) and deleted files (starting with a ‘!’). The next 2 lines do a regex to figure out the file names of the new and missing files.
Now add the following two pieces of code after the previous bit of code (and before the svn commit).
if [ "x$added" != "x" ]
then
echo adding “$added” to repository
svn add $added
fi
if [ "x$removed" != "x" ]
then
echo removing “$removed” to repository
svn remove $removed
fi
Both pieces of code use the previously regex calculated paramaters and sees if there are any files to be added or deleted. In then runs the “svn add X” and “svn add Y” commands to update the svn status. After this, a svn commit will include all new files and remove all old files from the repository. This does not remove the backup, so you always go back in time!
The “echo” commands used in these lines of code will show up on the command line, and if your cron job forwards output to an email address this can be used to check if the cron job is working correctly. If it becomes annoying, just remove them.