Sort HN who's hiring jobs by language in console
Trying to share this code Hu3 shared with me a while back.
See it in action: https://i.imgur.com/8XLKE4o.jpg
Code in comment below to be more clean
See it in action: https://i.imgur.com/8XLKE4o.jpg
Code in comment below to be more clean
1 comment
[ 365 ms ] story [ 229 ms ] threadThis is from Hu3 again not written by me
function hideAllExcept(searchRegex) { var allComments = Array.from(document.querySelectorAll('.comment-tree .comtr')) .map(function(e){e.style.display='none';return e}); var topLevelComments = allComments.filter(e=> e.querySelector('img[width="0"]')); var matchedComments = topLevelComments.filter(e=> (e.style.display = searchRegex.test(e.querySelector('.comment').innerText) ? 'table-row' : 'none')=='table-row'); return 'Showing '+(matchedComments.length+'').padStart(3, ' ')+' out of '+topLevelComments.length+' jobs for '+searchRegex; }