Blogging with TextMate

Blogging with textmate

TextMate helps you blog

TextMate, a very impressive text editor for the Mac,
has built-in support for writing blog entries and editing old entries, etc.

You can see it in action
in this screencast.
I am writing this entry right now using the exact same techniques.
Apparently there is a “yowza!” moment at the end involving a dragged image, so I’ll add one when I get to that.

Okay, it is interesting, but I’m not sure if I will use it.
It uploads the dragged picture to the WordPress-configured images directory on the server and inserts a link
into the blog, complete with alt tag and width/height.
Very nice, but I don’t like to put my pictures there.
I prefer to put them on
Ah well.

making the most of “ls”

ls” is the age-old command to list files and directories in Unix.
Over the years it has permuted and grown very functional.
At the moment, I typically use two “forks in the road” versions of ls.

The first is the “ls” that comes pre-installed in Mac OS X.
It’s the BSD version.
The second is GNU “ls“, which I install on Macs using
Darwin ports.
Ironically enough, the term “ports” there comes from BSD.

No what I want out of “ls” is the following:

  1. use colour to hilight files types (*.jpg/gif/png/bmp vs *.mp3/m4a/m4b/ogg vs *.tgz/zip/rar)
  2. show file sizes in MB (not k, not 512-byte blocks)

So this is how you do this.

Using BSD “ls“, we would set the BLOCKSIZE to 1048576 and set the environment variable CLICOLOR (not to any particular value, just ensure it exists; under csh I do “setenv CLICOLOR”).

Using GNU “ls“, we need the flags “–block-size=1MB” and “–color”.

Now when you use “ports”, GNU ls shows up as gls, so you also need to alias “ls” to be “gls“.

There, now isn’t that fun?
Throw in to the mix some favorite other flags as well as some combinations and permutations of
listing only files, only directories, and maybe all the source code around here,
and you get the bottom of my .cshrc file
(the equivalent .profile is left as an exercise for the Bash user):

if($?prompt) then
	# make ls a nice, happy thing that:
	#	(a) uses color to show different file types
	#	(b) shows file sizes in megabytes
	#CLICOLOR - makes BSD ls always list in color
	setenv CLICOLOR
	#BLOCKSIZE - used by BSD ls to determine how to print the size of files
	setenv BLOCKSIZE		1048576
	setenv LS_OPTIONS		-AsCF
	setenv LS_COLOURS		'di=1;34:ln=1;36:ex=1;35'
	if("$term" == "xterm") set term=xterm-color
	# start off using the usual 'ls' in /bin
	alias base_ls /bin/ls
	# try to use gls, if it's available
	if ( "`which gls`" !~ *'not found'* ) then
		# GNU ls is better than BSD ls in general
		alias base_ls gls
		setenv LS_OPTIONS		"-AsCF --block-size=1MB --color"
	alias ls		base_ls ${LS_OPTIONS}
	alias ll		'base_ls -al'
	alias ls		'base_ls ${LS_OPTIONS}'
	alias ls.		"find . \!* -name '.[a-z]*' -maxdepth 1 -print0 | perl -p0 -e 's#^\./##;' | xargs -0 base_ls -da ${LS_OPTIONS}"
	alias lsd		"find . \!* -type d \! -name '.*' -maxdepth 1 -print0 | perl -p0 -e 's#^\./##;' | xargs -0 base_ls -d ${LS_OPTIONS}"
	alias lsf		"find . \!* -type f \! -name '.*' -maxdepth 1 -print0 | perl -p0 -e 's#^\./##;' | xargs -0 base_ls -d ${LS_OPTIONS}"
	alias lsfa		"find . \!* -type f               -maxdepth 1 -print0 | perl -p0 -e 's#^\./##;' | xargs -0 base_ls -Ad ${LS_OPTIONS}"
	alias lss		'base_ls -a ${LS_OPTIONS} \!* {,*/,*/*/}*.{h,cc,c,cpp,cxx,hxx,hpp,m,mm,py,rb,sh}'
	alias zappaths	rm ~/.cshpaths

We won’t even mantion that I sometimes run across versions of find that do not grok “-maxdepth”..

Sharp 45″ LCD TV

Sharp has a new LCD Monitor and related TVs (3 or 4 different models). I was quite concerned about the stated contrast ratios like 600:1 and 800:1 when I’ve heard of other TVs with ratios of 10,000:1.

I used to live in a bedroom community near Toronto and I went to the Best Buy there yesterday to look at the TV and for other reasons. They did not have the TV, but I again noted that several Plasma makers are still trying to peddle TVs that have truly horrendous contrast ratios, reminding me of the bad old days of 256-colour .jpg files in the 80’s.

Homeshow is “closing for ever”, reminding me of the good old days of the early 80’s when the furniture store that the Brick bought called “Stuarts” used to go out of business every other week. The Homeshow locations are being rebranded to “Brick Super-stores” in case you didn’t notice, and I went there looking for what exactly was 50% off, and predictably, not one LCD TV was on sale. Pretty much only used ashtrays and broken lamps were given the big discounts. I wonder if that’s really much of a joke…? hm, ok its a joke

Anyway, so about my former haunts. Over the years, salespeople in Pickering and Ajax have said the most incredible things to me. Like when I asked about a fairly nice non-luxury car in Pickering once, “Sir… This is only Pickering!”. Or I said to one employee, “Actually, is that a lot of money (for that thing)?”, and she said, “Well it is for us little people.”. I guess it didn’t help that I went to the Flea Market as well as the Amish furniture store in Pickering yesterday (nice place by the way) but the hick-town isms were rife. I never really cared when I lived there, except for the laughs and some time losses on undoing people’s pre-conceptions. Nice people live there, however after all of these years there are still many reasons to shop in Markham (near where I work) instead of Ajax-Pickering for all of those cool techo-nerd-toys.

Underrated movies

Take 1 part Blade Runner, 2 parts Logan’s run, a pinch of Coma, a dash of the Matrix, throw in a page from the short story “The Lottery”, fool all of the critics, have 3 climaxes and what have you got? “The Island” in HD on Roger’s pay-per-view. Its apparently based on a movie called “Clonus”, but is much more. You have been satirized…

Another is “Transporter 2” a Superman flick, confined to the same pit as “Last Action Hero”, for the same reasons.

Can you tell I like movies with chase sequences? Well whatever, criticize me if you like.

Don’t forget to get “Time Tunnel” (1966) on DVD, released last week. Seems a bit cliched after all these years, but its a gorgeous pressing (don’t ask — Japanese term).

Better living through web-ordering

Just received a shipment from with a Girls Aloud DVD in it. Sorry not available in Canada or the U.S., only in PAL and region 2. Their cover of the “Pointer Sisters” “Jump” is quite excellent.

Also got a book called “Is it just me or is everything shit? (Nov. 2005)” full of wonderfully British observations complete with a fine examination of Sofia’ Coppola’s Lost in Translation… er, and Macs, and DVD-user-restrictions, etc… Sorry not in the US or Canada, eh.. can get it for you in 1 to 4 months.

I think there was a moral to the story, then again maybe not. Just more content for your region-free player and filler to make the order from abroad worthwhile. Enjoy!