Saturday, April 11, 2015

Stack Overflow - 100k rep reached!

Yes, I finally did it. After 6 years, I have reached 100,000 reputation on Stack Overflow!

I received a nice, unexpected email from Robert Cartaino, Community Manager at Stack Exchange Inc., titled "Stack Overflow - You're killing it.":

It's not often we get to reach out and thank someone individually for their contribution to a site, but we wanted to take this time to congratulate you for reaching 100,000 reputation on Stack Overflow! To be in the top, top rankings among the millions of Stack Exchange users puts you in some really elite company.

Hitting a milestone like this is a great opportunity to take a step back and remember what the points are really about. It's not just the tens of thousands of community members who took the time to up-vote your posts; it's the uncounted millions of people - yes millions - who have also learned (and will continue to learn) from what you've given so selflessly.

Words cannot express how much we appreciate what you've done for this community. You've worked hard, and you deserve a lot of credit for what you accomplished. We hope you've found the experience rewarding in your own way. But getting a big ole box of cool stuff from our sites is also a fun way to mark the occasion, so we put together a collection of swag for you. It's just a small token of our appreciation for everything you've done.

Click here to tell us where to send stuff.

Once again, thank you for generously contributing your time, your passion, and your knowledge. You've made the Internet better for all of us.

And for that, you should feel incredibly proud.

Robert Cartaino
Community Manager
Stack Exchange Inc.

I'm looking forward to my box of swag! :)

The following table shows some stats about my long, but rewarding, journey on Stack Overflow:

0-10k 10-20k 20-30k 30-40k 40-50k 50-60k 60-70k 70-80k 80-90k 90-100k Total
Date achieved 01/2011 05/2011 01/2012 09/2012 02/2013 07/2013 12/2013 05/2014 10/2014 04/2015
Questions answered 546 376 253 139 192 145 66 58 32 0 1807
Questions asked 46 1 6 0 1 0 0 0 2 0 56
Tags covered 609 202 83 10 42 14 11 14 4 0 989
Badges
(gold, silver, bronze)
35
(2, 10, 23)
14
(0, 4, 10)
33
(2, 8, 23)
59
(3, 20, 36)
49
(0, 19, 30)
65
(2, 26, 37)
60
(5, 22, 33)
50
(2, 24, 24)
50
(7, 21, 25)
42
(3, 20, 19)
460
(26, 174, 260)

As the table above shows, I haven't been able to answer any questions over the last few months. This is because work has been keeping me so busy!

For me, Stack Overflow has not simply been a quest for reputation, but more about learning and helping fellow programmers in need.

Right, time to celebrate!

Saturday, March 28, 2015

Ext JS - Reading a JSON File

This post shows how you can read a JSON file in your Ext JS applications.

Let's say you have the following person.json file, which contains information about a person:

{
    "name" : "Joe Bloggs",
    "age"  : "15"
}

In order to load this file, you need to define an Ext.data.Store as shown below:

Ext.define('MyApp.store.Person', {
    extend: 'Ext.data.Store',
    fields: ['name', 'age'],
    autoLoad: true,
    proxy: {
        type: 'ajax',
        url: 'person.json',
        reader: 'json',
        pageParam: false,
        startParam: false,
        limitParam: false,
        noCache: false,
        listeners: {
            exception: function(proxy, response, operation) {
                // add appropriate error handling!
                console.log("Could not read file");
            }
        }
    },

    // return the specified field of the person e.g. name.
    get: function(field) {
        return this.first() && this.first().get(field);
    }
});

Then create the store and once it has loaded, you can access the data.

var store = Ext.create('MyApp.store.Person');
store.on('load', function() {
    console.log(store.get('name'));
});

Saturday, February 28, 2015

Speeding up Grep on Large Files

Here are a few tips to improve the performance of grep on large files:

  1. Prefix your command with LC_ALL=C, in order to use the C locale with its smaller ASCII charset, instead of UTF-8
  2. Use grep -F to search for a fixed string (if possible), rather than a regex
  3. Remove the -i option, if you don't need it
LC_ALL=C grep -F searchString largeFile

Thursday, January 01, 2015

fahd.blog in 2014

Happy 2015, everyone!
I'd like to wish everyone a great start to an even greater new year!

In keeping with tradition, here's one last look back at fahd.blog in 2014.

During 2014, I posted a measly 19 new entries on fahd.blog. That's not a lot (I blame work and stackoverflow!) but I promise to write more this year. Thanks for reading and especially for giving feedback.

Top 5 posts of 2014:

I'm going to be writing a lot more this year, so stay tuned for more great techie tips, tricks and hacks! :)

Related posts:

Saturday, December 27, 2014

A Bookmarklet to Tick All Checkboxes on a Webpage

Recently, I found myself on a website where I had to tick 100+ checkboxes and there was no "Select all" button on the page. Obviously, I couldn't do this manually, so I wrote the following bookmarklet.

javascript:(function(){for(i of document.getElementsByTagName('input')){if(i.type=='checkbox') i.checked=!i.checked;}})()

Save this as a bookmark in your browser and click on it to toggle all checkboxes on the page you are on.