bookmarklet

a better TinyURL bookmarklet!

TinyURL is amazing. They shortify any URL, so you can change from something long and heinous—think Google Maps addresses—to something far more palatable (ala http://tinyurl.com/2h5z5m). The end result is short, pithy, and emailable. They magically redirect it to the real URL for you, and the Internets are a better place for all of us. Check out their example:

that's one TinyURL...

As if this wasn't cool enough, TinyURL recently added the ability to tack on a custom alias. Now you can (optionally) choose a word or phrase to include in the hash portion of the tinyfied address, making it memorable as well as emailable. So now something like http://tinyurl.com/justin-hileman is possible.

Unfortunately the bookmarklet they provide only generates the old style TinyURLs with numbers and junk at the end. I use it all the time, so I decided it's time for an upgrade. I created a bookmarklet that lets you select a chunk of text to be used as the alias. it automatically converts the selected text so it's url friendly and everything!

Just drag this bookmark to your bookmark bar (or right click/save link as):

TinyURL!

To use it, browse to a page on the internet, select a word or two, and click the bookmarklet. MagicURL!

Note: this should work in any real browser. Read: you shouldn't expect anything in IE < 7. Aside: You shouldn't be using IE < 7, but that's another battle for another day...

Also: if you're reading this in a feed reader, there's a good chance that JavaScript has been stripped out of the bookmarklet. It's not gonna work like that. Visit the full post to get your TinyURL bookmarklet.

Reset menu sort "weight" in Drupal 6

One of the most amazing and annoying things in Drupal 6 is the menu system. Thanks to a bunch of JavaScript magick, you can drag menu items around to reorder them, create submenus, and so forth. Unfortunately, once you've moved a menu item it no longer alphabetizes itself. If you want things to alphabetize themselves again, you are left with two options:

You can manually alphabetize the menu or submenu every time you change things or add a new menu item, forever and ever and ever. If you're not too keen on that idea, you can edit each of the menu items and reset their weight to 0, which makes them alphabetize again.

Neither option is ideal, so I created a third: this bookmarklet will set the weight of all menu items to 0 in one fell swoop. It also works for resetting block sort order, if you wanted to do that for some reason.

grab the bookmarklet after the jump.