Skip to content

Instantly share code, notes, and snippets.

View kadiwa4's full-sized avatar

kadiwa kadiwa4

  • Hamburg, Germany
View GitHub Profile
#!/usr/bin/env python3
# Workaround for https://github.com/rust-lang/rust/issues/98769
# WebKit issue: https://bugs.webkit.org/show_bug.cgi?id=249887
#
# Modifies a lot of HTML files in <sysroot>/share/doc/rust/html
# to remove their <link rel="preload" as="font" ...> elements.
import os
from pathlib import Path
#!/usr/bin/env bash
cd "$(dirname -- "$0")"
mkdir mods 2> /dev/null
cd mods
echo Creating download URL list...
download_urls="$(paste -d \0 <(perl -n -e '/^.+?"projectID":\s*(\d+)/ && print "https://www.curseforge.com/api/v1/mods/$1\n"' < ../manifest.json) <(perl -n -e '/^.+?"fileID":\s*(\d+)/ && print "/files/$1/download\n"' < ../manifest.json))"
echo Created download URL list
@kadiwa4
kadiwa4 / speedrun.com.user.js
Last active August 11, 2022 22:48
may save you a few clicks
// ==UserScript==
// @name speedrun.com
// @namespace https://www.speedrun.com/
// @version 0.1.6
// @description may save you some time
// @match https://www.speedrun.com/*
// @icon https://www.speedrun.com/themeasset/68q1p7rp/1st
// @updateURL https://gist.github.com/KaDiWa4/709ee81fd1f681f64422cf7bafe7dec5/raw/speedrun.com.user.js
// @downloadURL https://gist.github.com/KaDiWa4/709ee81fd1f681f64422cf7bafe7dec5/raw/speedrun.com.user.js
// ==/UserScript==
@kadiwa4
kadiwa4 / average_loads.py
Last active February 19, 2021 10:26
calculates the average loading times for each person in a solo speedrun.com category
import datetime
import json
import urllib.request
import re
import statistics
import time
# either "realtime_noloads_t" or "ingame_t"
OTHER_TIMING_METHOD = "realtime_noloads_t"