Skip to content

Instantly share code, notes, and snippets.

@VlatkoStojkoski
Created November 17, 2022 18:06
Show Gist options
  • Save VlatkoStojkoski/1e2c89397b6178af7b08b5d21cea1e33 to your computer and use it in GitHub Desktop.
Save VlatkoStojkoski/1e2c89397b6178af7b08b5d21cea1e33 to your computer and use it in GitHub Desktop.
Sort mendo.mk tasks from easiest to hardest
document.querySelector('body > div.page-container > div.main > div.main-content > div:nth-child(3) > div > table > tbody').innerHTML = [...document.querySelectorAll('body > div.page-container > div.main > div.main-content > div:nth-child(3) > div > table > tbody > tr > td:nth-child(5) > a')].sort((a, b) => +a.innerText.match(/(?<= \()\d+/)[0] > +b.innerText.match(/(?<= \()\d+/)[0] ? -1 : +a.innerText.match(/(?<= \()\d+/)[0] < +b.innerText.match(/(?<= \()\d+/)[0] ? 1 : 0 ).map((a) => a.parentElement.parentElement.outerHTML).join('');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment