Show/hide hidden files in OSX Lion (and Mountain Lion and (hopefully) Mavericks)

I recently had my Mac at work upgraded to Lion from Snow Leopard (bless it; the 2007 device can't cope with Mavericks) which hid a lot of folders and files I'd gotten used to being able to access. A quick Google turned up these solutions:

To show a user's (not sure if it works for all users) library:

chflags nohidden ~/Library/

…or if that comes back with a 'not enough permissions' error message:

sudo chflags nohidden ~/Library/

…and then enter your (admin) password when prompted.

To show all hidden files:

defaults write com.apple.Finder AppleShowAllFiles TRUE

…then:

killall Finder

To hide all hidden files again:

defaults write com.apple.Finder AppleShowAllFiles FALSE

…then:

killall Finder