Skip to content

Instantly share code, notes, and snippets.

import requests
import xlsxwriter
from argparse import ArgumentParser
from collections import defaultdict
from copy import copy
from datetime import datetime
from itertools import zip_longest
from time import sleep
from urllib.parse import urlencode
@szarroug3
szarroug3 / analyze_dota_matches.py
Last active August 21, 2020 01:23
analyze_dota_matches.py
import json
import os
import requests
from argparse import ArgumentParser
from collections import defaultdict
from time import sleep
OPENDOTA_BASE_URL = 'https://api.opendota.com/api/{func_name}/{params}'
@szarroug3
szarroug3 / ffxiv.py
Last active April 16, 2019 02:24
FFXIV Craft Leveling Calculator
import json
import math
import os
from collections import defaultdict
xp_chart = [300, 600, 1100, 1700, 2300, 4200, 6000, 7350, 9930, 11800,
15600, 19600, 23700, 26400, 30500, 35400, 40500, 45700, 51000, 56600,
63900, 71400, 79100, 87100, 95200, 109800, 124800, 140200, 155900, 162500,
175900, 189600, 203500, 217900, 232320, 249900, 267800, 286200, 304900, 324000,
@szarroug3
szarroug3 / customize_vivaldi.py
Last active September 18, 2018 00:33
Adds window_group_move.css to vivaldi and updates browser.html to use it; meant to be used with https://gist.github.com/szarroug3/2aaf6c129f4da7d288f00d6bb333c21c
import os
from shutil import copyfile
def copy_file(dest):
copyfile('window_group_move.css', dest)
def edit_browser_html(filename):
@szarroug3
szarroug3 / split_audiobook_chapters.py
Last active August 15, 2018 22:50
Split audiobook into chapters
#!/usr/bin/env python
"""
Script to split audiobook chapters into separate files using metadata
"""
from __future__ import print_function
import os
import re
@szarroug3
szarroug3 / window_group_move.css
Created November 21, 2017 16:21
Moves vivaldi's window button group to the same line as the address bar -- found here: https://www.reddit.com/r/vivaldibrowser/comments/6yaxc5/refinement_move_the_vivaldi_button_to_the/dmn0ma9/
/* Remove header */
:-webkit-any(.native, .maximized)#browser #header {
min-height: 0 !important;
}
/* Keep Vivaldi button */
:-webkit-any(.native, .maximized)#browser .vivaldi {
z-index: 1;
top: 5px !important;
}
@szarroug3
szarroug3 / utils.py
Last active September 26, 2017 22:59
General utilities
#!/usr/bin/env python
"""
Script including useful commands
Includes:
Flatten folders -- flattens folders into a single folder (can be called recursively)
Compare -- compares two strings/files and prints out results
"""