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
import requests | |
from requests.auth import HTTPBasicAuth as Auth | |
url = 'https://ticktick.com/oauth/authorize?scope=tasks:write%20tasks:read&client_id={client_id}&state=state&redirect_uri=https://www.example.com/&response_type=code' | |
print('Welcome to the TickTick API OAuth2.0 setup.') | |
print('Before beginning, go to "https://developer.ticktick.com/manage" and create a new app.') | |
print('Under "OAuth redirect URL", add "https://www.example.com/"') | |
print() | |
client_id = input('What is your client ID?\n> ') |
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 parseENV(content) { | |
var contentArray = content.split('\n') | |
var contentDict = {} | |
for (var i = 0; i < contentArray.length; i++) { | |
if (contentArray[i] === '') { continue } | |
contentArray[i].replace('\r', '') | |
contentArray[i].trim() | |
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 eloRating(player, opponent, score, K = 20) { | |
// Score is 1 if player won, 0 if opponent won, and 0.5 if a draw | |
// Information: https://www.omnicalculator.com/sports/elo | |
let difference = K * (score - (1 / (1 + 10**((opponent - player)/400)))) | |
difference = Math.round(Math.abs(difference)) | |
if (score >= 1) { | |
player += difference | |
opponent -= difference | |
} else if (score <= 0) { |