Drupal module - summary

My first “official” open source contribution: a module for Drupal that I threw together for the family web site called summary. It’s intent is to allow a summary page for a drupal site, displaying headlines for recent photos and stories.

It has since been taken over and completey revamped by Nedjo Rogers, somewhat for the better I hasten to add. As well as making it much more theme- and drupal-compliant, Nedjo moved the lists of headlines into a block, making layout control easier.

I still hope to contribute to the module, and other drupal development, in the future.

Broken Arm

My son broke his arm today. I'm very proud. I've never broken any bones (well, except my big toe, but that hardly counts), and he's gone and busted his arm before he's even four! He did it riding his new bike, of course; lost control going down a little hill.

He was obviously in pain, so Jo took him to the doctor, where he got x-rays and the whole deal. They said he was exceptionally brave, even when they had to put his are back in place before applying the plaster. And the first thing Kian does when he gets home? Goes outside and climbs the freaking fence! There's no stopping this boy.

New Blog - Blosxom

Trying out some new blogging software, Blosxom (pronounced "blossom"). It's actually rather neat, in a minimalist kind of way. A simple Perl wrapper that turns text files into -- optionally templated -- HTML. Much more light-weight than big old database-backed stuff (like drupal, which I'm also using).

I've set up my blog directory as a CVS module, with a check-in trigger to automatically update the live web-sever directory whenever I check in a new (or updated) file. For the curious, the follow entry in CVSROOT/loginfo in my CVS repo does the trick:

^blog (date; cat; (sleep 2; cd /home/mrowe/www/blog; cvs -q update -Pd) &) \
    >> $CVSROOT/CVSROOT/updatelog 2>&1

This means: match any check in for a module starting with "blog", then wait a couple of seconds (for the check in to complete), change to the web server directory, and run a cvs update.

Wait, there's more! You also get... syndication to the main mojain.com site. I've added a block (currently custom--you have to add it in your account set up) that displays and links to the latest blog entries.

How cool is this? Blogging made almost transparent! Just dump current brain state into text file, and commit to cvs! How much easier could it be? Still remains to be seen how often I do it, of course...

Quick techo update

I’ve played around a bit with the HTML “flavour” (template), and tried to make things look a bit like the main mojain.com site. I’ve also been experienting with plugins, as you can see on the left (and in described in more detail below).

The First of Many Frequent Updates

In what will be the first of many frequent updates, we look at the current state of my blosxom blog!

Well, I've got that out of my system. Phew. I've been playing around with a couple of plug-ins for Blosxom, and you can see the output of some of them on the left. I'll probably end up ditching the calendar, since there's not a lot of point when "frequent" is likely to mean once a week or so.

Two other plug-ins you can't directly see. They are flavourdir, which allows you to put flavour files (which are more or less HTML templates) in a sub-directory so they don't litter the blog root dir, and timezone, which allows me to display time stamps (the "Posted at" time below) in my local timezone (Australian Eastern Daylight at the moment).

In other news, not directly related to Blosxom... Last week was quite eventful at work. On Monday, I resigned! I've decided to do some contracting for a while, for the dual benefits of some more in-depth J2EE development experience, and a much-improved cash-flow picture. Yeah, yeah, I know, security, blah blah... but things definitely seem to be picking up in the local market, so I'm not too worried about my medium-term outlook.

On the home front, things are moving along at a rapid pace. Jo has been buying and putting up blinds, which is much more convincing than the sheets we have had on the windows. I've been doing some traditional blokey stuff, pulling up the temporary fencing from the backyard and turning a small patch of hardened clay into soil. That's not as much fun as it sounds, and I have a whole new appreciation for the term "back-breaking work". I'll no longer be applying it to debugging even the worst spaghetti code.

Monday - Friday

Well, as expected, I've left it too long between drinks, and I've forgotten most of what I did last week. No doubt beer was involved. Or maybe I'm just getting old. Most of my waking hours were spent at work, of course. Still plenty of left overs in the fridge, so sign of any cooking activities yet.

Thursday night I went to cricket training, and then dinner at Gav and Emma's. Pizza! Beer!! Black Adder!?! It doesn't get much better than this. Had a couple of drinks after work with Janis and Craig, then stopped by Andrew's on the way home to have a beer and try to watch the rugby. Odd game, really.

My wife's away...

... so here is a sort-of diary of what I've been up to, mostly for her benefit. Like anyone else would find it remotely interesting...

Friday

Went straight to work from airport. I was surprised how quick the trip is now, with the "new" (well to me anyway) CityLink freeway taking me all the way to the bottom of Spencer St. Since I am working at that end of Collins St, I was right there. Well, apart from the 10 minutes it took to drive up to the 10th level of the fscking car park.

After work, went to the pub with a few people from work. Only stayed for two pots, since I had to drive home. Once home I had a snack (dry crackers *sniff*) and then sat down in front of Chopper. Actually stayed awake until the end, remarkably. Just.

Saturday - Sunday

Up early this morning. Went down to the shops to get the paper, but The Age was late from the printers :-/ . After breakfast, I went over to Rebel Sport to change my cricket pants. They didn't have any in the size I wanted, but they called up the Greensborough store, and they did. On the way there, I dropped past our new house.

Between all this and messing around in the shopping center, it was time to head home and get ready for cricket. The first day of the match was pretty uneventful, we batted out the day. I went in at number six (was meant to be seven, but the previous guy went missing) and lasted a few overs for 2.

Since it was the first day, we all headed back to the club's rooms for a couple of beers with the guys. Cheap VBs! Went out for dinner with Andrew, Belinda and Lynn to some Malaysian place Andrew had seen. Which turned out not to be licenced (even byo!). The food was ok, but it took forever to come.

Old Man Michael was exhausted by the end of dinner, so I went home to bed.

Sunday

Quiet day at home. Had the usual for breakfast. Caught up on some email. Went for a drive in the afternoon. Still someone working on the house, so I couldn't snoop around. Watched a couple of Black Adder episodes in the evening (don't tell Gav!).

Weekend of Oct 11-12th

Saturday

Woke up early. Had a fight with the cat. Went back to sleep. Eventually got up around 8am, went down the street to get bread and the paper. Came back, had breakfast and read the paper. How about Matty Hayden?! Wish I could bat like that...

Took the obligatory trip up to Greensborough to check out proceedings on the house. They've built the fscking walls!! So much for letting me know so I could run cables. :( Called Jo to tell her the (good|bad) news. Spoke to Kian, who told me he's missing me. *choke* He's too cute! I assured him I was missing him very much too (which I am).

Anyway, by time I got back home it was time for cricket. It had been a pretty miserable morning, weather wise, but was clearing into a perfect afternoon for it. I was one of the opening the bowlers, but had a bit of trouble with consistency. Ended up with 0/31 off ten overs, not too bad but not great. We finished our game early with a win, so I was settling in to watch the firsts when Kemp called and said they needed an extra fielder in the 3rds game, so I drove into to the Brunswick St oval to help out.

With my outstanding contribution (well, I stood in the outfield, that's the same thing), the 3rds managed an outright win, to make it four wins for the club! Great opening round. Had a beer with the boys, went home. Aimee SMSed to say she was going to the Harp, but I was too sore and tired so stayed home and went to bed.

Sunday

Quiet morning, tried to sleep in. Bloody cat. Spoke to mum (it's her birthday), had leisurely breakfast. Decided to go and see Whitehorse's production of 42nd Street. I got there, and discovered that none of the usual lighting crew were doing the show. Oh well, pretty good show anyway, but I'm really not a fan of Jamie's lighting. The sound was surprisingly good. Band and cast good as usual.

Went home feeling all melancholy, wanting to run away to the theatre again. There's a surprise for you! Anyway, I offered to help with the bump out next week, so I'm going back at 7:30am on Sunday. Good grief.

Insert current time in an emacs buffer

A lot of text editors (way back to the days of Borland’s SideKick–wow, what a blast!) provided an easy way to insert the current date and time in the file you are editing. This is particularly useful for a notes/journal type of thing.

Emacs (the One True Text Editor) does not provide an “out of the box” way to do this, but a very simple piece of elisp can do it.

I put this (adapted from a suggestion found on the help-gnu-emacs list) in my .emacs:

(defun mr-insert-current-time ()
  (interactive)
  (insert (format-time-string "%F %T")))
(global-set-key (kbd "C-c d") 'mr-insert-current-time)

(defun mr-insert-current-time-block ()
  (interactive)
  (insert "n-------------------n")
  (insert (format-time-string "%F %T"))
  (insert "n-------------------n")
  )
(global-set-key (kbd "C-c C-d") 'mr-insert-current-time-block)

which allows me to press C-c d at any time to get the current date and time in my buffer (formatted the way I like). The second function puts it in a little block, good for seperating entries in a notes log.