Sort HN who's hiring jobs by language in console

1 points by ge96 ↗ HN
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

1 comment

[ 365 ms ] story [ 229 ms ] thread
This is the code you paste into your dev tools as seen in screenshot

This 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; }

    [
    /\b(Rust)\b/i,
    /\b(Java)\b/i,
    /\b(Scala)\b/i,
    /\b(Kotlin)\b/i,
    /\b(Swift)\b/i,
    /\b(Ruby)\b/i,
    /\b(Python)\b/i,
    /\b(PHP|PHP5|PHP7)\b/i,
    /\b(JS|JavaScript)\b/i,
    /\b(React|ReactJS)\b/i,
    /\b(Angular|Angular5|Angular6)\b/i,
    /\b(Vue|VueJS)\b/i,
    /\b(Node|NodeJS)\b/i,
    /\b(Go|GO|Golang|golang|GOLANG)\b/,
    /C#/i,
    /\bC\b|C\+\+/i,
    /\bHaskell\b/i,
    /\bErlang\b/i,
    ].map(hideAllExcept).sort().reverse().join('\n');