Schalk Neethling

Scripting on Caffiene

Duck It! ~ Useful Bangs for Developers and Other Goodies

| Comments

I have switched to using DuckDuckGo as my preferred search engine some time ago now, and I have really ben enjoying it. Of course, on of the biggest reasons for doing this is related to my online privacy.

We all know that Google used to be the Do no Evil company but, this has changed drastically in recent history, and most people now know how Google is tracking you all over the web. Now, whether you are ok with this or not, is of course up to you. For me though, I choose to support services that does not track me.

Over and above that, and to get of my soap box, there is another great reason for everyone, but specifically developers/designers to use DuckDuckGo on a daily basis.

It’s all about the bang(!).

There are a multitude of bangs available that are useful for a wide variety of needs. In this post however, I am going to focus on those which are useful for developers, and will speed up your daily workflow. So let’s get started.

A couple of things that apply to all of the below:

  • These will work from your browser’s location bar, if DuckDuckGo is set as your default search provider but, it will also work when using the search field on DuckDuckGo.
  • The main goal here is to get you to the answer you a re looking for as quickly as possible without having to jump through multiple hoops(read: multiple page loads and clicks).

The Bangs(!)

jQuery

Your working on a piece of code and the exact syntax of the inArray function has slipped your mind. No problem:

1
!jquery inArray

The above will, without any further action on your part, take you to jQuery website results view page, showing results for your above query.

StackOverflow

Say you are running into an error whilst using Casperjs. Most people nowadays will head directly to StackOverflow to see if someone else ran into the same problem, and more importantly, how they resolved the problem.

1
!so timeout error casperjs

Again this will take you directly to StackOverflow, show the results fo your search query.

Github

Looking for a repo on Github?

1
!github grunt-perfbudget

Which, as you expect by now, will send you to Github showing the relevant results. Using Github’s search field parameter, you could also search for a specific file or piece of code in a specific repository. For example:

1
!github isFirefox() repo:mozilla/bedrock

The only downside of the latter is that the default category shown is not `code` but `repositories` but hey, it’s one click right.

Mozilla Developer Network(MDN)

The Mozilla Developer Network is the defacto resource for developers looking to learn about web development or look up the syntax or state of Web APIs. And as can be expected, there is a bang for this to.

1
!mdn web bluetooth

Bugzilla

This one is a little specific but extremely useful, especially if you contribute to the Mozilla project. How this works is two-fold. The first option is to just search for a string, let's say plugincheck

1
!bugzilla plugincheck

The above will return a list of results for the search term plugincheck as you would expect. However, what is super useful is, when you know the id of the bug you are after. Let's say, you have the bug number 1217896, you can get directly to the bug entry in one go:

1
!bugzilla 1217896

Try it, it’s awesome.

On that note, a MildlySerious on Reddit mentioned that one can get even more accurate, direct results for sites that has a, not stellar on site search implementation, by simply using the !/I’m feeling lucky syntax. For example:

1
! jquery inArray

The above will, instead of taking you to the search page on jQuery, take you directly to the entry for the jQuery.inArray function. Happy Ducking!

The Other Goodies

Over and above all of the already useful shortcuts listed, there is even more things that DuckDuckGo offers that does not involve a bang. Let's take a quick look at those.

Cheat Sheets

Cheat sheets are awesome, and not cheating at all. Finding and keeping track of all of them can be a bit of a challenge sometimes though. Thankfully with DuckDuckGo, it is as easy as:

1
atom cheat sheet

Really, that is all you need to type into the search bar to find a cheat sheet for the Atom code editor. And what is just as awesome, because DuckDuckGo is an open source project, is that you can contribute your own cheat sheets. It is also not just cheat sheets for software applications, how about one for HTML?

1
html cheat sheet

Color

Want to quickly know the RGBA, HSL or CMYB for a Hex color?

1
#333333

Screenshot of results showing various color models

As you can see from the above, for colors that are not neutral, such as for example `#333666`, it also provides you with complementary and analogous colors and their hex codes. You can of course also type in a RGB color and get the same result, for example:

1
rgb 25 40 65

Color Picker

Need a color picker? No need to launch anything, just enter:

1
color picker

Screenshot of the color picker UI

Just want a range of Hex color codes?

1
color codes

Screenshot of the color table

Coversion

Often one needs to convert pixels to ems or vice versa. There are multiple tools available online and built into some applications. Of course, you can also do it straight from the Duck.

1
20 px to em

Screenshot of the result of converting px to em

And of course the reverse also works. Another useful Goodie is the ability to convert a character to it’s HTML entity.

1
html copyright

Screenshot of entity conversion

There are lot’s more Goodies and Bangs out there. Please share your favorites in the comments below and, if you cannot find the one you need, why not create it!

Comments