A simple CSS specificity calculator
Call specify() with your css selectors, you'll receive an object with both the specificity number & the details.
specify('h1#title');
// returns {specificity: [1,0,1],
details: [['#title'],[],['h1']]};
Here is the official project page.