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
"""generic exponential backoff retry decorator""" | |
import time | |
from collections.abc import Callable | |
from typing import Any | |
# from http://wiki.python.org/moin/PythonDecoratorLibrary#Retry | |
# Retry decorator with exponential backoff | |
def retry( | |
exception: type[BaseException] | tuple[type[BaseException], ...], |
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
import json | |
import google_auth_oauthlib.flow | |
from urllib.parse import urlparse, parse_qs | |
SCOPE = 'https://www.googleapis.com/auth/youtube' | |
# Use the client_secret.json file to identify the application requesting | |
# authorization. The client ID (from that file) and access scopes are required. | |
flow = google_auth_oauthlib.flow.Flow.from_client_secrets_file( | |
'client_secret.json', |
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
import os | |
from icalendar import Calendar | |
import datetime | |
directory = os.path.dirname(__file__) | |
with open(os.path.join(directory, 'calendar.ics'), 'rb') as fp: | |
data = fp.read() | |
cal = Calendar.from_ical(data) | |
for event in cal.walk('vevent'): |
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
REM Create a user command (Options > Configure TeXStudio > Build) and add the following | |
cmd /C "java -jar "path_to_textidote.jar" --output html --check en "?c:am.tex" > report.html" | cmd /C "report.html" | |
REM now pressing Alt-Shift-F1 will run a spellcheck, create a file report.html in your project folder and open the result in your favorite browser |