Textmate

Learn Ruby

by David Chin on August 17, 2009

The Ruby Study Notes / Tutorials on rubylearning.com is a good place to start learning Ruby.

I'd already written my first "Hello" Ruby program in Textmate.

First, I created an empty p001hello.rb file and opened that in Textmate.

Next, I pasted and tidied up the sample code, and executed the program by pressing ⌘R, which opens an HTML preview window showing the results.

My first Ruby program

That was all there was to it. I'm pretty amazed how smoothly it all went.

If you get a wrong dateTime error when fetching posts from your WordPress blog using the Blogging Bundle in Textmate, this could be due to the existence of a recent draft post.

TextMate Fetch Posts From WordPress

If you create a Draft post in WordPress using the browser-based WordPress editor, a record is created with all zeros in the post_date_gmt field of the draft post record. I used phpMyAdmin for this screen capture of the posts table.

(click to view larger)
All zeros in post_date_gmt field of the draft post

You can do one of two things to address this problem.

Firstly, you could just go ahead and create a new post in Textmate and publish it to your WordPress blog – it will successfully publish.

Or, you could force a proper date to be updated in the post_date_gmt field by calling up the draft post in the WordPress editor and changing the publish date of the post from "Publish immediately" to a specific date in the future, and re-saving the draft post.

This issue only crops up when creating draft posts in WordPress itself. Draft posts made using Marsedit or Textmate have the post_date_gmt field filled in with the date and time of the post creation. However, you would need to remember to manually change the date and time later, at the point of publishing the post.

Panic Sans Font in Textmate

by David Chin on August 10, 2009

Thanks to a tip in this post by DamienG, I've managed to install the gorgeous Panic Sans font that comes with the Coda application, and used it in Textmate.

Here's a screen shot showing a comparison of both fonts.

Monaco (click to view larger):
Pastels on Dark, Monaco Font

Panic Sans (click to view larger):
Pastels on Dark, Panic Sans Font

I'm still sticking with Textmate's Pastels on Dark theme though, as it is easy on the eyes (Twilight is a tad more contrasty).

I've also decided that the combination of Textmate and Forklift is best suited for my needs in adding and modifying content (Textmate) on Digital Photography Notes locally on my Mac, and syncing the new and modified files (Forklift) with my remote hosting server.

Forklift also acts as a splendid File Manager / Finder alternative, with its two-pane, multi-tab approach to presenting folders, servers and mounted storage.

TextMate productivity tips

by David Chin on August 9, 2009

These tips are great for Textmate newcomers like me.