Text

Why I’m using DuckDuckGo instead of Google

DuckDuckGo is now my default search, both in the browser and on my phone. Here’s why:

!Bang syntax

DDG has a cool little feature that lets you search tons of websites directly, using !websitename. For example, if you want to search Drupal.org directly, type “!drupal whatever search terms” and you will be taken to a Drupal.org search for “whatever search terms.” This works on tons of sites.

First result jumping

The vast majority of my Google searches just led me to clicking the first result. On DDG, you can add a backslash (“") to the beginning of your sites to jump directly to the first result. This is a small thing, but it’s been great for me.

Zero-click info

I often Google something I’ve never heard of just to figure out what the crap it is. This usually involves clicking through to a Wikipedia page about it. DDG instead will give you a few sentences about that thing at the top of the search, before the results. It gets this info from sites like Wikipedia, StackOverflow, GitHub (DDG is obviously pretty programmer-oriented), LyricsMode, etc. It’s a big time saver for me.

Lots of useful special queries

Get a random number from 1-10 by typing “rand 1 10” or generate a 15 character password by typing “pw 15” or run a hash by typing “md5 whatever” or count calories by typing “calories in 2 eggs” etc. Lots of great stuff going on here. Here’s some more info.

Surprisingly good results

My main hesitation about switching was just that nobody could beat the big G when it came to giving me good search results. I’m actually pleasantly surprised with how good DDG’s results have been so far. The majority of my searches are technical, programming related things, and I remember reading somewhere on Hacker News that this is one of DDG’s primary focuses (like I said, it’s very programmer related).

That said, if you do want to search google, just type “!g search terms” to search Google using the bang syntax.

Useful options

On the settings page, you can select whether to open links in new tabs, whether to display favicons or WOT (trust) ratings beside links, whether to auto-load more results when you reach the bottom of the page, etc. Lots of useful things. You can even configure colors and fonts if you’re into that kind of thing.

The warm fuzzy feeling

DDG feels sort of personal or cozy somehow. It feels like you’re doing something good, like you’re sticking it to the man.

Give it a shot! Make it your browser’s default search engine for a few days and see what you think.

Text

A rundown of keyboards for Android phones

There are a ton of keyboards you can use instead of the Android default. Here’s my take on them.

Default (pre-gingerbread)

Nice, quick and simple. Light footprint and does decent job with the auto correction. No multi touch support, no alternate layouts, nothing fancy.

Swype

The current leader in the swipe typing category, in competition with the ShapeWriter and SlideIT. Does a pretty good, although I’ve found that recent-ish updates have vastly increased the size of the dictionary which means that it recommends stupid words that I would never say and have never heard. Also runs a bit sluggish on my phone. Also annoying is that it’s still in Beta which means that you have to download it through Skype’s website rather than the market and you must manually update.

SlideIT

Basically Swype but with slightly less accurate prediction/correction (at least in my experience). At least this one’s in the market, though.

ShapeWriter

In my experience, vastly superior to both Swype and SlideIT. Runs well on my phone and has good prediction. Downside is that it’s no longer on the Android market and there’s not even an official place to get it, so I had to resort to getting it through a random forum post, which is shady at best.

Smart Keyboard Pro

A great, flexible, multi-touch keyboard with a load of options, layouts, themes, etc. Did a pretty good job correcting my typing, even with me using two thumbs and going as quickly as possible. Not sluggish at all, themes look good, and the settings (although there are tons of them) are laid out logically. Fun to use.

Better Keyboard

Basically the same as Smart Keyboard Pro but with themes listed as separate market apps, not quite as many options, and (at least in my experience), slightly less accurate typing correction. Still worth a try.

SwiftKey

This is the one I’m using as my primary keyboard now. The thing that sets it apart is its contextual word prediction - it predicts what you’re typing based on which word makes the most since to go after the words before it, and also based on what you have typed in the past. This means that it predicts a word before you even start typing it, and lots of commonly used expressions can be typed out by just hitting the space key over and over. Also has good multi-touch and looks nice (although there’s only 1 theme). Runs a little sluggish on my phone but not enough to really complain.

Tags: Android Apps
Video
Tags: Music
Text

Toggling between event handlers using jQuery’s toggle()

Ever been in a situation where you need to do something on click except if it’s already been done, in which case you undo it? Previously, I would do this by setting a class on the first click and then checking for that class to see if it’s already been clicked.

Turns out, there’s a function that makes it easier. Just sticking this here in hopes that someone else stumbles on it.

Photo
Text

Use jQuery to fade to a different background image on submit button hover

There’s a pretty common and nice looking that lets you fade to a different background image when you hover over a link, div, etc. For an example, see Dragon Interactive’s navigation. That method basically involves adding an empty span tag inside the link or div, and setting it to take up the full available space but be transparent. Then, on hover, you fade it into view (and you can set whatever background image you want on it so it looks nice and pretty).

However, that method doesn’t work on form submit button inputs since you can’t add HTML inside an <input> tag (since they’re self-closing). So you’re stuck trying to figure out another method. Here’s a simple one that worked for me.

Basically, instead of setting a span inside the element, you wrap the element in a div, so you’re basically doing the opposite. Then, you can set whatever background image you want on the div, and write a bit of jQuery that, on hover, fades the button to an opacity of 0.01 (so it’s transparent, showing the div’s background image instead of the button’s, but still clickable).

Here’s some code to illustrate:

The HTML for the submit button

The jQuery which wraps the submit button in a div and does the fading on hover/mouseout

The CSS to replace the button with an image (using a large negative text-indent which is just my preferred method) and to set the background image on the background div

Give me a shout if you try it out and have trouble.