• "Many people hack together shell scripts quickly to do simple tasks, but these soon take on a life of their own. Unfortunately shell scripts are full of subtle effects which result in scripts failing in unusual ways. It’s possible to write scripts which minimise these problems. In this article, I explain several techniques for writing robust bash scripts." This looks really useful.
  • "This is all very preliminary, but here is a first pass as a Processing Kinect library." Ooh.
  • Trap streets – yes, of course. But trap rooms; trap architectures? That's iiinteresting.
  • "Bookland is a fictitious country created in the 1980s in order to reserve a Unique Country Code (UCC) prefix for EAN identifiers of published books, regardless of country of origin, so that the EAN space can catalog books by ISBN rather than maintaining a redundant parallel numbering system." Awesome. Via Kim (who else?)
  • "This tutorial assumes no previous knowledge of scripting or programming, but progresses rapidly toward an intermediate/advanced level of instruction . . . all the while sneaking in little nuggets of UNIX® wisdom and lore. It serves as a textbook, a manual for self-study, and a reference and source of knowledge on shell scripting techniques. The exercises and heavily-commented examples invite active reader participation, under the premise that the only way to really learn scripting is to write scripts." Really good stuff, which Nick pointed me at this morning when I revealed I couldn't write bash scripts.
  • And, with their 119th update, Valve helpfully included the list of all their previous patches, as well. Just look at the amount that's changed – and how swiftly. A proper, living game (unlike the stillborn 360 version). Can't wait to play it on the Mac; it's almost like a different game to the one I played at the beginning.
  • "Ben Gimpert is a friend of the Open Library. He and I got together over lunch a few months ago to talk about big data, statistical natural language processing, and extracting meaning from Open Library programmatically. His efforts are beginning to bear some really interesting fruit, and while we work out how we might be able to present it online, we thought you might be interested to hear what he’s been up to." Answer: good things. Ben is awesome, and this work sounds great. (I can't quote a suitable passage, so George's intro will have to do).
  • A few short tips on find; one of the bash tools I use least, and should probably use more.
  • "Diller, Brill, and Murdoch seem be stating a simple fact—we will have to pay them—but this fact is not in fact a fact. Instead, it is a choice, one its proponents often decline to spell out in full, because, spelled out in full, it would read something like this: “Web users will have to pay for what they watch and use, or else we will have to stop making content in the costly and complex way we have grown accustomed to making it. And we don’t know how to do that.”"
  • "Red dot fever enforces a precision into your design that the rest must meet to feel coherent. There’s no room for the hereish, nowish, thenish and soonish. The ‘good enough’." Dingdingding. +5 points to Taylor, as usual. Place, not location.
  • "TinkerKit is an Arduino-compatible physical computing prototyping toolkit aimed at design professionals. The interest in physical computing as an area in development within the creative industries has been increasing rapidly. In response to this Tinker.it! is developing the TinkerKit to introduce fast iterative physical computing methodologies to newcomers, and particularly design professionals." Standardised modules, standardised connectors, Arduino-compatible. I remember Massimo showing me his keyboard-emulating board ages ago. Nice to see Tinker productising the platform, too.
  • "The buttons are designed to look very similar to basic HTML input buttons. But they can handle multiple interactions with one basic design. The buttons we’re using are imageless, and they’re created entirely using HTML and CSS, plus some JavaScript to manage the behavior." Dark, dark voodoo, but very impressive – and excellently explained by Doug Bowman. It's nice to see Doug blogging again.
  • "If 2009 is going to see the emergence of high-quality browser-based games, then 2009 is going to be the year of Unity. It has: lots of powerful features; iPhone support; Wii publishing; a developing community; quality developers using it; and an upcoming upcoming PC version. In short, it is about to make a major splash. I feel compelled to jump in with it — the indie license is cheaper than the Flash IDE."
  • "bash completion support for core Git." Ooh. This looks really, really nice.

Rob Orsini’s got a nice little shell script for opening iTerm with everything he needs for his app: a vim window or two, a dev server, the Rails console, and a final tab to tail the development logs.

Of course, I’m a TextMate man myself, and so a bit of tweaking this morning brought out my own version of it. The first tab opens the project in Textmate and puts your shell into the project root, all ready for running tests and specs (unless you’ve already caught the autotest bug); the second tab fires up Mongrel on port 3000; the third fires up the console; the fourth tails development.log . The changes in filenames/commands are mainly my personal environment, so tweak away. Hardly warrants a blogpost, really, but thought I’d share, because it’s really going to be useful in future. Requires iTerm, TextMate, and the mate command (which should be set up by default when you install TextMate).

#!/bin/sh

if [[ $# == 0 ]]; then
  PROJECT_DIR=$PWD
elif [[ $# == 1 && -d "$1" ]]; then
  PROJECT_DIR="$@"
else
  print "usage: railsterm.sh [rails project directory]"
  return 1
fi
    
osascript <<-eof
  tell application "iTerm"

    make new terminal

    tell the last terminal

      activate current session

      launch session "Default Session"

      tell the last session
          set name to "$PROJECT_DIR"
          write text "cd \"$PROJECT_DIR\""
	      write text "mate .;"
          write text "clear; ls;"
      end tell
		
      launch session "Default Session"
      tell the last session
          set name to "server"
          write text "cd \"$PROJECT_DIR\""
          write text "mongrel_rails start"
      end tell

      launch session "Default Session"
      tell the last session
          set name to "console"
          write text "cd \"$PROJECT_DIR\""
          write text "./script/console"
      end tell

      launch session "Default Session"
      tell the last session
        set name to "development log"
        write text "cd \"$PROJECT_DIR\""
        write text "cd log"
        write text "tail -f development.log"
      end tell

    end tell
  end tell
eof

Don't forget to chmod +x the file if you want to make it executable.

Memo to self

19 March 2006

Memo to self: bash profile is in /etc/profile. Not anywhere else, they don’t work. No idea why. But next time you need to alter your $PATH – it’s there.