Skip to content

Instantly share code, notes, and snippets.

@shinespark
Created November 10, 2021 21:02
Show Gist options
  • Save shinespark/987510f00070718cd2b6b7dc48115c16 to your computer and use it in GitHub Desktop.
Save shinespark/987510f00070718cd2b6b7dc48115c16 to your computer and use it in GitHub Desktop.
Lean Coffee用に ✅ が多い行をソートしてクリップボードにコピーするやつ。
javascript: !(t => {const a = document.createElement("textarea"), s = document.getSelection();(a.textContent = t), document.body.appendChild(a), s.removeAllRanges(), a.select(), document.execCommand("copy"), s.removeAllRanges(), document.body.removeChild(a);})("- " + [...document.querySelectorAll("[class^=edit__PreviewWrapper] li")].filter(l => l.innerText.includes("✅")).map(l => l.innerText).map(l => l.replace("\n", " ")).sort((a, b) => {return b.match(/✅/g).length - a.match(/✅/g).length;}).join("\n- "));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment