Categories
Product Technology UI UX Websites

Bookmarklet: Add Keyword Search to the Listings on IIMJobs.com

Job hunters from the IIMs and other such colleges often go to this cool site called IIMJobs.com, started by an alumnus of my alma mater. It’s quite a live board, but there is one thing that I sorely miss there – filtering the job listings by keyword. You can select your experience range, your preferred location, and search. You get to see all jobs in your preferred city for your preferred vintage, but you may not be interested in them. And you have to sift through the listings page to find jobs suitable for you.

This got me thinking – what if there was a filter box, where I could type in my preferred phrase and it would filter the listings on the page, keeping only those that you want to see?

So, I spent a Monday morning putting together some code, and here it is – a bookmarklet which, if you save it on your browser’s toolbar and click on it when you are on the IIMJobs listing page, you will get a cool keyword search input box. This will let you filter the listings on the page by keyword – basically it will hide all the listings which do not match your search phrase.

All you have to do is drag the button below to your browser’s toolbar.

<a style="padding: 18px 32px; font-size: 16px; margin-bottom: 40px; background-color: #444; color: #fff;" title="Drag me to your bookmarks/favourites" href='javascript:(function(){$("#searchform").find(".greybtn").closest("div").before("

“),$(“ד).appendTo(“.keywordParent”),$(“.keywordSearch”).keyup(function(e){var%20o=$(“.keywordSearch”).val().toLowerCase();$(“.jobRow”).each(function(e){-1Add Filter @IIMJobs

Do let me know in the comments below if you like it, or if you have any feedback on how to make it better.

Categories
Product Technology

The FizzBuzz Test

While reading Jeff Atwood’s blogpost entitled Why Can’t Programmers Program? I thought of testing whether I can pass the simple FizzBuzz test for programming he mentions. You can read the details of the test on his blogpost.

So I wrote a script in PHP, the language I am currently active in, to do what the test asks us to do.

But then, why stop at just solving the problem when you can optimize code for timepass?

I began with a 24 line-long (without counting empty lines) chunk of indented code, using a simple for loop and a bunch of if statements. But then I wanted to reduce the size of the code, so I decided to use the shorthand for if, and get rid of variable assignments that don’t “do” anything really. Now I am down to 5 lines of code, including the two lines of the for loop.

Turns out I am a programmer (though not formally educated as a programmer), and a good one at that – I passed the FizzBuzz Test!! πŸ™‚ Do I get a job as a programmer now? πŸ˜›

Here is the output of the script (yes, the script ran when you loaded this page):

[php]
for ($j = 1; $j<=100; $j++) {
$fizz = ( $j % 3 == 0 ? 1 : 0 );
$buzz = ( $j % 5 == 0 ? 1 : 0 );
echo ($fizz + $buzz == 0 ? “$j
” : ($fizz == 1 ? “Fizz” : “”).($buzz == 1 ? “Buzz” : “”).”
“);
}
[/php]