This file contains hidden or 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
| diff ... TTR difference between players | |
| P(diff) ... winning probability in percent | |
| exact winning chance | |
| P = 1 / (1+10^(diff/150)) | |
| rule of thumb for winning chance | |
| if (diff =< 50) | |
| P = 50 + 4 × (diff ÷ 10) | |
| else |
This file contains hidden or 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
| function monitor(feedName, url, author, filter = null) { | |
| console.log(feedName); | |
| let startTime = Date.now(); | |
| let scriptProperties = PropertiesService.getScriptProperties(); | |
| let lastUpdate = scriptProperties.getProperty(`lastUpdate${feedName}`); | |
| let errorCount = parseInt(scriptProperties.getProperty(`errorCount${feedName}`) || "0"); | |
| let root; | |
| try { | |
| let res = UrlFetchApp.fetch(url); | |
| root = XmlService.parse(res.getContentText().replace(/content:encoded/g, "content").replace(/&#(\w.+?);/g, (_, p) => {return String.fromCharCode(p)})).getRootElement(); |
This file contains hidden or 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
| local function indent_auto_detect() | |
| for i = 0, editor.LineCount - 1 do | |
| local pos = editor:PositionFromLine(i) | |
| local indent = editor.LineIndentPosition[i] - pos | |
| if indent > 0 then | |
| if string.byte("\t") == editor.CharAt[pos] then | |
| print("Indentation: Tabs") | |
| editor.UseTabs = true | |
| return | |
| elseif indent == 2 or indent == 3 or indent == 4 or indent == 8 then |
This file contains hidden or 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
| #!/usr/bin/env -S bash -xeuo pipefail | |
| pkg update && pkg upgrade | |
| pkg install which time ldd tree | |
| set -xeuo pipefail | |
| pkg install pacman patchelf which time ldd tree | |
| echo | |
| pacman-key --init | |
| echo |
This file contains hidden or 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
| using System; | |
| using System.Diagnostics; | |
| using System.Text.RegularExpressions; | |
| partial class ZipExtractor | |
| { | |
| static void Main(string[] args) | |
| { | |
| // get the name of the zip file to extract | |
| string filename = args[0]; |
This file contains hidden or 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
| function convertCutlistToM3u(cutlist, starttime = null) { | |
| var obj = {}; | |
| var lastKey; | |
| cutlist.split(/\n\n?/).forEach(l => { | |
| var [, key] = l.match(/\[(.*)]/) || []; | |
| if (key) { | |
| obj[key] = {} | |
| lastKey = key; | |
| } else { | |
| var [prop, val] = l.split("="); |
This file contains hidden or 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
| javascript:document.addEventListener("keydown",function(e){if(e.ctrlKey&&e.altKey&&e.key=="d"){[...document.querySelectorAll(".editormenu>li:nth-child(3)>table>tr:nth-child(10)")].filter(i => i.closest('[name="tabview_contentmain"]').style.display != "none")[0].click();[...document.querySelectorAll(".editormenu>li:nth-child(3)>table")].filter(i => i.closest('[name="tabview_contentmain"]').style.display != "none")[0].classList.remove("visible");}}); |
This file contains hidden or 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
| m(x) ... minutes of the time x | |
| h(x) ... hours of the time x | |
| add time | |
| a+b=c | |
| if (m(c)>=60) || (h(a)+h(b)>h(c)) | |
| c=c+40 | |
| subtract time | |
| a-b=c |