News for hackers. Stuff that matters.
Re:jQuery "Genealogy" plugin by tzury on Tuesday June 28, 2011 @11:32PM (#2708311)
Nicely done aliasing

    jQuery.fn.extend({
        grandchildren: function() {return this.children().children();},
        greatGrandchildren: function() {return this.grandchildren().children();},
        grandparent: function() {return this.parent().parent();},
        greatGrandparent: function() {return this.grandparent().parent();},
        aunts: function() {return this.parent().siblings();},
        prevAunt: function() {return this.parent().prev();},
        prevAunts: function() {return this.parent().prevAll();},
        nextAunt: function() {return this.parent().next();},
        nextAunts: function() {return this.parent().nextAll();},
        cousins: function() {return this.aunts().children();},
        prevCousins: function() {return this.prevAunts().map( 
            function () {return jQuery( this ).children().get().reverse();});},
        nextCousins: function() {return this.nextAunts().children();},
        nieces: function() {return this.siblings().children();},
        prevNieces: function() {return this.prevAll().map( function () {
                return jQuery( this ).children().get().reverse();} );},
        nextNieces: function() {return this.nextAll().children();}
    });

    jQuery.fn.uncles = jQuery.fn.aunts;
    jQuery.fn.prevUncle = jQuery.fn.prevAunt;
    jQuery.fn.prevUncles = jQuery.fn.prevAunts;
    jQuery.fn.nextUncle = jQuery.fn.nextAunt;
    jQuery.fn.nextUncles = jQuery.fn.nextAunts;

    jQuery.fn.nephews = jQuery.fn.nieces;
    jQuery.fn.prevNephews = jQuery.fn.prevNieces;
    jQuery.fn.nextNephews = jQuery.fn.nextNieces;
Re:jQuery "Genealogy" plugin by iaskwhy on Wednesday June 29, 2011 @05:20AM (#2708847)
Read this in a funny way but I really hope I never get one project done with this, I am so bad at understanding family relations, I struggle to remember what a niece or nephew is, what's the relation name of my brother's wife, etc.
Re:jQuery "Genealogy" plugin by syaz1 on Wednesday June 29, 2011 @05:24AM (#2708854)
Same here! I usually end up describing them all as relatives.
Re:jQuery "Genealogy" plugin by jeresig on Wednesday June 29, 2011 @01:48AM (#2708551)
Hilarious - nice job Ben! I was bemusing in the Khan Academy chat the other day that I always thought it'd be hilarious (although, useful) to have a .uncle() or .aunt() method (for getting .parent().siblings()). Quite amused that Ben put the effort into making this happen.
Re:jQuery "Genealogy" plugin by alnayyir on Wednesday June 29, 2011 @05:07AM (#2708830)
Bemused doesn't mean that, it means puzzled, bewildered, or confused.

Also, peruse means to pore over meticulously, not glance over.

Re:jQuery "Genealogy" plugin by lurker19 on Wednesday June 29, 2011 @10:45AM (#2709643)
And while webare here, "cursory"?
Re:jQuery "Genealogy" plugin by alnayyir on Wednesday June 29, 2011 @01:08PM (#2710228)
Cursory is what people mean when they mistakenly use peruse.

A cursory examination is not a thorough one.

Re:jQuery "Genealogy" plugin by jarin on Tuesday June 28, 2011 @11:35PM (#2708313)
While this definitely does make things more concise, does it make things clearer? I've never had to deal with overly complex hierarchies like that in JS, so I'm not sure.
Re:jQuery "Genealogy" plugin by spicyj on Wednesday June 29, 2011 @12:04AM (#2708357)
As the opening paragraph suggests (and my cough sibling cough comment says as well), I wrote this mostly just for fun but it could be used in an actual project as well.
Re:jQuery "Genealogy" plugin by jarin on Wednesday June 29, 2011 @12:24AM (#2708384)
Oh I missed that part :)

I don't think it's ready for production anyway until it has el.creepyUncle() and el.nieceWithInappropriateFacebookPhotos()

Re:jQuery "Genealogy" plugin by spicyj on Wednesday June 29, 2011 @12:28AM (#2708393)
Submit a pull request. ;)
Re:jQuery "Genealogy" plugin by repos on Tuesday June 28, 2011 @11:48PM (#2708335)
Just seems like a fun plugin
Re:jQuery "Genealogy" plugin by LogicHoleFlaw on Wednesday June 29, 2011 @07:18AM (#2709061)
Ah yes, but how do I keep track of my firstCousinsTwiceRemoved() ?

(Maybe if I saw the code, I could actually keep straight how those more distant relations work...)

Re:jQuery "Genealogy" plugin by BillSaysThis on Wednesday June 29, 2011 @11:57AM (#2709947)
Fine nerd humor!