Show HN: Atom package displays tooltip with git-blame info
atom.io2 pointsby wjg0 comments
// usage: highlight('react', 'node', 'graphql', '$')
// output: [57, 29, 4, 19]
function highlight(/* args */) {
return Array.prototype.slice.call(arguments).map(function(keyword) {
var matches = 0;
Array.prototype.forEach.call(document.querySelectorAll('tr.athing.comtr div.comment'), function(e) {
if (e.innerText.search(new RegExp(keyword === '$' ? '\\$' : keyword, 'i')) === -1) return;
++matches;
e.innerHTML = e.innerHTML.replace(new RegExp(keyword === '$' ? '\\$' : keyword, 'ig'), '<span style="background-color:#0095ff;color:#fff;">' + keyword.toUpperCase() + '</span>')
});
return matches;
})
}
Another somewhat interesting find is that on the nightstand next to the bed sits another book with a discernible title: Goodnight Moon.