sethmason.com The internet resource for all things Seth Mason.

Resolutions

I’ve been mulling these over for the past couple of days but I thought I’d post them to the internets in hopes of injecting some accountability into the whole morass.

  • Get knee fixed
  • Go on vacation somewhere besides San Francisco/Oakland or Rhode Island with wife and child
  • Take better photos
  • Lay off the sugar and don’t lay around as much
  • Learn Clojure
  • Fix what ails desktop computer
  • Clean out top drawer of bureau
  • Rebalance 401K
  • Turn 40 (yeah, I’m old)

If you are reading this and want a health check, feel free to ping me.


Dojo snippets for emacs

I’ve been using Dojo for a couple of months now and I really like it as it makes writing cross-browser JavaScript a breeze.

I’ve also been using emacs with YASnippet for a bit now too. YASnippet is a plugin for emacs that allows you to define a snippet that’ll get transformed into something much bigger in your file. It saves you a lot of typing as you can define areas in your snippet where you get prompted to enter text and it’ll autofill with your entries. Very handy, let me tell you. There’s a screencast on YouTube showing how powerful it is.

Which brings me to the point of this post. I’ve created a package of snippets aimed at people writing Dojo based JavaScript. It’s hosted up on GitHub if you would like to use it. Currently, it only includes (what I feel to be) the major functions but feel free to contact me if you’d like to add more.


svn log made easy

svn log is a great command to see what’s going on in your subversion repository. Unfortunately, at my job we are using a really old version (1.1.4!), a version so old that it doesn’t support the --limit argument. This makes the svn log painful to use as it outputs EVERYTHING.

Luckily, svn log is so awesome that it overcomes this weakness and allows you to use a date based criteria for listing log statements. Unfortunately, the syntax is hard for me to remember. Thus, I wrote this little shell script function that’ll list activity for the given days in the past. You can put it in your .bashrc and run it like svnlog 14. That’ll output logs from the last 14 days.

# svn function to get all changes in past 7 days
svnlog() {
    OFFSET=$1
    shift
    svn log -r HEAD:{"`date -d "$OFFSET days ago" +%Y-%m-%d`"} $*
}

Commandline Fun

Insprired by an article on ibm.com about using twitter from the command line, I wrote up a simple little script to get your friends updates.

Here it is:

curl -s -u username:password \
http://twitter.com/statuses/friends_timeline.xml |
awk '/<text/ {
  gsub(/<\/*text>/,"");
  text = $0;
}
/screen_name/ {
  gsub(/ *<\/*screen_name>/,"");
  print $0;
  print text;
}'

All it does it is use cURL to grab the timeline from twitter. Then it passes it through awk to extract the name and text from your buddies. Simple and silly, yes?


More Keyboard Fun

Continuing along on the keyboard theme, most Google apps have keyboard shortcuts. I’ve started using Google calendar and found the keyboard shortcuts for it as well. Very handy.

Google Calendar keyboard shortcuts


Older