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 urllib.request | |
import os, json, random, time, re | |
# adult games are part of the hub "Theme - Mature", | |
# but I can't get the data over the API, so I manually scraped it from the website. | |
# use this expression in the browser dev console on the mature hub: | |
# Array.from(document.querySelectorAll("table td.py-2 a")).map(x => x.href.split("/")[4] + ", # " + x.parentElement.outerText.split("\n")[0]).join("\n") | |
# scrape date: 2024-03-06 | |
_mature_games = set([ | |
420, # Mario is a Drug Addict |
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
# takes a csv export of the google sheet as input and tries to download pastebins | |
# | |
# usage: | |
# download_pastebins.py <prefix> <name column> <url column> <csv file> | |
# | |
# example: | |
# download_pastebins.py mt18 1 5 "MT18 Draw List - Played Games.csv" | |
import sys, os, re, urllib.request, csv |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | |
<style> | |
/* local css here */ |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>SRL Races</title> | |
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-TX8t27EcRE3e/ihU7zmQxVncDAy5uIKz4rEkgIXeMed4M0jlfIDPvg6uqKI2xXr2" crossorigin="anonymous"> | |
<script src="https://code.jquery.com/jquery-3.5.1.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ho+j7jyWK8fNQe+A12Hb8AhRq26LrZ/JpcUGGOn+Y7RsweNrtN/tE3MoK7ZeZDyx" crossorigin="anonymous"></script> |
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
from bottle import * | |
from urllib.request import urlopen | |
import json | |
import re | |
DEFAULT_HOSTS = ['multitwitch.tv', 'multistre.am', 'kadgar.net/live'] | |
SRL_API = "https://api.speedrunslive.com/races/" | |
SANITY_RE = re.compile('[0-9a-z]+') | |
RACE_STATE_COMPLETE = 4 # from the SRL API |
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.path | |
import sqlite3 | |
import urllib.request | |
def main(): | |
db = sqlite3.connect(os.path.join('Data', 'flashpoint.sqlite')) | |
cur = db.execute("SELECT launchCommand FROM game WHERE launchCommand LIKE '%games2jolly%'") | |
urls = [s for (s,) in cur.fetchall()] | |
for index, url in enumerate(urls): | |
print('{}/{} {}'.format(index + 1, len(urls), url)) |
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
# A little script to extract old japanese zip files | |
# with the correct text encoding for filenames. | |
# Most applications assume a US text codepage for | |
# old zip formats, which is not always correct. | |
import os | |
import shutil | |
import sys | |
import zipfile | |
from datetime import datetime |
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 ctypes, ctypes.wintypes | |
advapi32 = ctypes.windll.advapi32 | |
# LSTATUS RegOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) | |
RegOpenKeyExA = advapi32.RegOpenKeyExA | |
RegOpenKeyExA.argtypes = (ctypes.wintypes.HKEY, ctypes.wintypes.LPCSTR, ctypes.wintypes.DWORD, ctypes.wintypes.DWORD, ctypes.wintypes.PHKEY) | |
# LSTATUS RegCloseKey(HKEY hKey) | |
RegCloseKey = advapi32.RegCloseKey |
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
// generate character-based static lookup tables | |
// that can be used for character classification, | |
// e.g. like in cctype functions (isdigit, isalpha ...) | |
struct CharLookupTable | |
{ | |
bool data[256]; | |
template <unsigned int N> | |
constexpr CharLookupTable(const char (&str)[N]) |
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
from gpiozero import LEDBoard | |
from time import sleep | |
import random | |
tree = LEDBoard(*range(2, 28), pwm=True) | |
# first led is the top one in the star | |
tree[0].value = 0.6 | |
leds = range(1, len(tree)) |
NewerOlder