Clean up the “Open With” menu on OS X

I have what I guess may be a bad habit of installing all the new software I come across, tinkering with it and then removing it.  Unfortunately there are a lot of times doing this can clog up your “Open With” menu on OS X.  I have noticed even using some nightly builds of software will really clutter it up.

When that starts to happen you can use the following snippet to clear all the dupes, as well as restart finder.