When writing JavaScript, very frequently I need to check if a given thing exists in a list of things. Every single time I need to look up the function that does that for the sort of list I’m working with. You see, there are three possible options: includes(), contains() and has() and I mix them […]
Yoda and binary in Firefox with Ubiquity
A couple of weeks ago I made two Ubiquity commands: A binary (and back) translator, and a Yoda speak translator. While perhaps not particularly useful, they were a lot of fun to make and use, and got me acquainted with the process of building a Ubiquity command.
Ubiquity?
Ubiquity is quickly becoming my most used Firefox extension. I love it. If you are familiar with Gnome-do (Linux), Quicksilver (Mac) or Launchy (Windows) then you already know how powerful a keystroke launcher is. Ubiquity is such a keystroke launcher for the internet. For a great overview, read this article by Ryan Carson.
Ubiquity commands are basically Javascript, but Ubiquity provides some handy additional options to make it very easy to use (and also, you get to write Javascript for just one browser, yay!). They have an excellent tutorial available here: Ubiquity Author tutorial.
Binary
A while ago xkcd posted this comic which features a bunch of binary. Unlike some people, I can’t read binary, so I set out to find a binary translator for Ubiquity. Turns out there wasn’t one! So I immediately promised to make one that weekend, which I didn’t. Instead I made it a weekend later.
You can also try it out on that page, or out in the wild, for example with Google’s first Twitter message.
Yoda speak
Now, It might not be much of a surprise that I am a huge Star Wars geek. Dutch television recently aired all Star Wars movies, and during The Empire strikes back, Leon ported the Yoda speak translator to Ruby. Realizing how awesome it would be to use that in your browser as well, I immediately set out to port it to Ubiquity.
I hadn’t had much experience with handling sentences (and cutting them up and placing them back in different orders), so the Yoda translator turned out to be a bit harder to make. Luckily I had help from friends that reviewed my sometimes silly code and gave corrections.
I also included a handy list of Star Wars quotes to get you going.
Ubiquity = Fun!
Building Ubiquity commands is fun. I didn’t describe how to build them in this article because the aforementioned tutorial is much better than I ever could. If you are familiar with Javascript, it’s pretty easy as well. Writing a Ubiquity command is the perfect bite-size afternoon project.