Wishful Coding

Didn't you ever wish your
computer understood you?

Trying out Posterous

Trying out Posterous

I received a message via Twitter that Posterous now features Wordpress in its switch campaign. Although I'm in Ireland at the moment, I did not hesitate to try it out!

This is just a message sent from Gmail, that will probably end up on several other places thanks to the autoposting feature in Posterous.

I will also attach an image, to see what will happen to it.

In the future I might make pepijndevos.nl the domain for pepijndevos.posterous.com, and make it my main website, but before I do that, I need to figure out how to port a few features of my old blog to the new Posterous blog.

Published on

A better Trash for Mac

Different at least... I bothers me that the Mac Trash leaves hidden .Trash folders everywhere, including external drives. I wrote a few AppleScripts to move all Trash in one place and delete files completely. If you only want to remove trash from external drives, see my earlier post. This approach is still far from ideal, but it's interesting and it might inspire someone to do a better job than I did. The idea is to move files to a sparse image and delete that image when you need to empty the Trash. You can do this with Disk Utility and a bit of AppleScript.

A better Trash for Mac

To create the image, open Disk Utility in /Applications/Utilities, click New Image and create a Sparse Image.

A better Trash for MacI think it is nice to make the image a Stationary Pad, so you get a new Trash can every day for easier selective deletion. To do this, select the image and press CMD+i and select Stationary Pad. Now all that remains are the AppleScripts. Save those as Application Bundles named Trash and Delete respectively.
property image : POSIX file "/Users/pepijndevos/Trash/Trash.sparseimage" -- edit this
property mount : POSIX file "/Volumes/Trash" -- and this

tell application "Finder"
        if not (exists mount) then
                open image
                delay 5
        end if
        open mount
end tell

on open the_files
        tell application "Finder"
                if not (exists mount) then
                        open image
                        delay 5
                end if
                repeat with the_file in the_files
                        do shell script "mv -f " & quoted form of POSIX path of the_file & " " & quoted form of POSIX path of mount
                end repeat
        end tell
end open
on open the_files
        repeat with the_file in the_files
                do shell script "rm -rf " & quoted form of POSIX path of the_file
        end repeat
end open
A better Trash for MacNow drag these to the Dock for easy access to the Trash and Delete functions. You can just drag files on them to trash or delete them. Another option of course is to have only the Delete script and a regular folder in your Dock, but that is not half as fun, is it?
Published on

Updating to Wordpress 3.0

I'm trying to upgrade this blog to WordPress 3.0. While I skipped 2.9.2 because it was only a minor fix, this time there are some cool new features, which I'm not going to tell about, use Google! This theme used the default comment template in WordPress 2.9, but unfortunately this has been removed or broken. To fix this, I had to use the comments.php from the new and shiny twentyten theme. I copied their comments.php over to my theme, but unfortunately this only made matter worse. It uses a few functions defined in functions.php. Rather than trying to copy those specific functions over to my functions.php, I just included theirs:
include(TEMPLATEPATH . "/../twentyten/functions.php");
Can you think of a more ugly solution? I'll fix it later. There might be more bugs to be discovered. Do you see anything out-of-order on this blog? Please leave a comment.