This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Paste in console or create a javascript: bookmark | |
//Dual number cells are sorted by the first number (e.g. absolute value rather than percentage). | |
//Every refresh of the table disables the sort functionility and needs to be reapplied. | |
//To sort by a column click its header. | |
(() => { | |
const tbl = document.querySelector("#portfolioDiv table.datatable"); | |
const header = tbl.querySelector("#portfolioHeader"); | |
const totals = tbl.querySelector("tr.totalsRow"); | |
const dataRows = Array.from(tbl.querySelectorAll("tr.data")); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Updated to support when "This Weekend" option doesn't exist. | |
Put the following link in a bookmark in your bookmark bar and when selecting snooze duration | |
(after clikcing the snooze icon) you may click this bookmark to modify the first snooze option to be the "Someday" option. | |
You need to click the bookmark everytime you want to snooze Someday (after clicking the snooze icon to show the menu). | |
*/ | |
javascript:(function() { const l = document.querySelector("[data-jsaction*='global.snooze_']"); l.dataset.jsaction = 'global.snooze_someday'; l.querySelector('span.do').innerText = 'Someday';})(); void 0; | |
//Unfortunately this no longer works as the "snooze_someday" action has been removed internally from the JS API (rather than just from the UI) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Runs electSingle until at least *wanted* winners are elected, returns the first *wanted* winners. | |
* @param candidates see electSingle | |
* @param getScore see electSingle | |
* @param ballots see electSingle | |
* @param wanted the number of wanted winners | |
* @returns [candidate] Array of candidates of size *wanted* (given that there are enough candidates) | |
*/ | |
function elect(candidates, getScore, ballots, wanted) { | |
if(typeof wanted !== "number") { |