Growl Notifications for Kynetx KRL Command Line Tool

KRL Commit Growl Notification

KRL Commit Growl Notification

I have been using the Kynetx KRL command line tool for several weeks now and it has made my development of Kynetx apps much easier. The only problem that I have had as I have been using the command line tool is that once I commit my app I have to wait a few seconds before being able to run the new version in my browser. Until now I have been doing a lot of command + tab switching between windows to check to see if it has finished saving.

I have now created a clean solution that allows me to know when the version has finished being committed to the Kynetx servers and had one unexpected benefit.

I started out by creating a simple bash alias that would pipe the output from the ‘krl commit’ command to a growl notification

# Growl notify after krl commit is done
alias krlc="krl commit | growlnotify -t "KRL" --image /Users/mikegrace/src/kynetx-x.png;"

I quickly realized that this wouldn’t work for me because piping the console to the growl notification means that the commit output wouldn’t be visible on the console.  I need to be able to see on the console what the output was in case there were errors or the latest saved version so I started looking for a better solution and came up with this

# Use growlnotify to alert user of commit status
krl() {
 if [[ $@ == "commit" ]]; then
  command krl commit | tee status.txt | growlnotify -t "KRL" --image /kynetx-x.png;
  cat status.txt;
 else
  command krl $@
 fi;
}

I created a function in my bash profile that runs when I run the krl command. When it sees me using the commit parameter it will do a krl commit and then tee that output to a status.txt file and pipe it to the growl notification. To have the output also show up on the console I cat the status.txt file back to the console. The unforeseen benefit here is that it is now really easy to share error output with others because it can be found in the status.txt file in the app folder.

I also created a bash script, available on my github, that takes care of the installation for you. I created this script purely for fun and I had a blast doing it!

I had a really great time doing all of this and learned a lot. There is a lot of power in being able to manipulate command line tools to make tasks easier.

As Bigweld would say, “See a need, fill a need”

Chrome extensions I’m in love with

Here is my short list of Chrome extensions I’m in love with.

1Password

goo.gle URL shortener

Delicious Tools

Google Voice (by Google)

Web Dveloper

RSS Subscription Extension (by Google) via @snay2

MeasureIt

Please, PLEASE! let me know of other “can’t live without extensions for Chrome.

Google Chrome

Google Chrome

Why I love keyboard shortcuts

WARNING: Learning and using keyboard shortcuts will drastically impact your relationship with your mouse and greatly improve your experience on a computer. Proceed with caution. : )

Some look at me strange when I get excited about learning a new keyboard shortcut but there is a reason for my crazed excitement.

I love keyboard shortcuts for several reasons.

  • I can get work done faster
  • Faster than just using a mouse
  • More efficient than using a mouse in most cases
  • Easier on my hands
  • Don’t have to find home row again after task like with mouse
  • Cool Geek factor
  • Did I mention it’s faster than just using a mouse?

Proof of benefits

To illustrate the benefits of learning and using keyboard shortcuts I present to you 2 images with lines representing mouse movement over a period of time.

Mouse usage illustrated by Anatoly Zenkov over a 3 hour period of programming using Eclipse.

3 hours programming on Eclipse

3 hours programming on Eclipse

Mouse usage illustrated by myself over a 7 hour work day of programming using TextMate.

7 hours of programming using TextMate

7 hours of programming using TextMate

There are keyboard shortcuts for Eclipse, but I feel that it is very mouse centric in its layout and functionality.

Eclipse IDE

Eclipse IDE

Contrast that with TextMate that has a very simple and plain interface that relies on many shortcuts for its functionality.

TextMate

TextMate

TextMate does have a tray for a project file structures but I have not needed it since I now use keyboard shortcuts to navigate to different files and sections within each file. That rocks!

TextMate Project File Tray

TextMate Project File Tray

I show and hide this as I need it with a keyboard shortcut.

TextMate Go To File Shortcut Window

TextMate Go To File Shortcut Window

I use this keyboard shortcut to navigate to and pull up the files that I want ALL the time. HUGE time saver!

TextMate Go To Symbol Shortcut Window

TextMate Go To Symbol Shortcut Window

This lets me jump to specific sections of a document. Use it all the time now that I know about it. : )

Keyboard shortcuts are EVERYWHERE! I’ll even be soo bold as to say that applications that don’t have good keyboard shortcuts are not well thought out or well designed. (one of my biggest pet peves with Adobe Air applications!) So how do you learn them all? You don’t! You don’t really need to know them all. You should know and use the ones that will give you the most benefit.

How can I become a keyboard shortcut master?

Learn as you go. I try as best as I can to only use menu items or buttons once or twice if there is an associated keyboard shortcut. If I go to a menu or a button and it shows that there is a keyboard shortcut to do the same thing, I don’t use the menu or the button and use the keyboard shortcut right then and there and try to remember it the next time. It only takes a few times of doing this and the keyboard shortcut will start to become habit. I also learn a lot from others. Many people post their favorite keyboard shortcuts on blogs for the applications they use and watching and asking pros how they do it is great and they love being asked about what keyboard shortcuts they are using.

Read the users manual on the software or read the help. No kidding! I have found some of my favorite keyboard shortcuts by finding the section on keyboard shortcuts in the help menu or in the online how to manual.

Give your mouse the cold shoulder. If you decide you are going to use the mouse as little as possible, you are going to start making a bigger effort to learn keyboard shortcuts. Use them for everything you can and even make a little cheat sheet of your favorite shortcuts to make it easy to remember… even the pros do it.

Conclusion:
I have benefited greatly from learning keyboard shortcuts and I think you would also. I encourage everyone to learn more keyboard shortcuts to increase the effectiveness and productivity on the computer. I also recognize that the keyboard is not a replacement for the mouse. The mouse is a great tool for interfacing with computers but only reaches its full potential when coupled with great keyboard shortcuts and good interface design.

If you are interested in the software that I used to track my mouse usage, it is called IOGraph and can be found at http://iographica.com/

Access Local Mac Dev Environment from VM

Testing my web development in IE is the bane of my existence. Since I run Apache and MYSQL on my local host on my Mac it was always a trick to view my work though my Windows VM until my friend Mike Farmer showed me an easy way to access my development environment on my Mac from my virtual machine.

Steps:

  1. Get default gateway of VM machine
  2. Use that address the same way you would “localhost” on your Mac

Example:

Get IP address of VM

Get IP address of VM

Local Mac development environment

Local Mac development environment

Dev environment from VM

Dev environment from VM