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
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"io" | |
"sync" | |
) |
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
#!/usr/bin/env python3 | |
from __future__ import annotations | |
import argparse | |
import json | |
import sys | |
def main(): |
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
let main = async (account, units) => { | |
const scrapeAccount = (accountWidget) => { | |
const accountId = accountWidget.id; | |
const accountName = accountWidget | |
.querySelector("span.c11n-accordion__heading") | |
.innerText.trim(); | |
const holdingsLinks = [ | |
...accountWidget.querySelectorAll( | |
`app-holdings tr[app-holdings-row] div.holdings-link` | |
), |
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
let main = () => { | |
const datePattern = new RegExp(`(\\d{2})/(\\d{2})/(\\d{4})`); | |
const extractDate = (s) => { | |
const m = s.match(datePattern); | |
const month = m[1]; | |
const day = m[2]; | |
const year = m[3]; | |
return `${year}-${month}-${day}`; | |
}; | |
const extractLot = (row) => { |
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
#!/usr/bin/env python3 | |
# NOTE: This is intended to be used with dump-links.py: | |
# https://gist.github.com/bsidhom/c5c83a8d38f500db4be397926cae8d02 | |
import argparse | |
import base64 | |
import json | |
import os | |
import os.path |
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
#!/usr/bin/env python3 | |
# Dump all symlinks and their targets under a given direcory in a | |
# newline-separated JSON format. This JSON data includes both the raw path data | |
# encoded as base64 as well as human-readable strings. The strings should not be | |
# used for automated FS operations, as they may have lost information in | |
# encoding. Instead, these should be used as approximate representations for | |
# hand inspection. | |
# This script does _not_ follow any symlinks when searching for links themselves |
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
// Extract level metadata from https://gemcraft.fandom.com/wiki/GemCraft_Chapter_2:_Chasing_Shadow_Fields | |
let extractLevels = () => { | |
const extractGemTypes = (cell) => { | |
const anchors = [...cell.querySelectorAll("a")]; | |
return anchors.map((a) => a.title); | |
}; | |
const extractText = (cell) => { | |
const s = cell.innerText.trim(); | |
if (s.length == 0) { |
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
#!/usr/bin/env python3 | |
def main(): | |
print("partitions of 5:") | |
for p in partitions(5): | |
print(p) | |
print() | |
print("compositions of 5:") | |
for c in compositions(5): |
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
#!/usr/bin/env python3 | |
# Baby names zip can be downloaded from https://www.ssa.gov/oact/babynames/names.zip | |
import argparse | |
import csv | |
import io | |
import re | |
import sys | |
import zipfile |
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
#!/usr/bin/env python3 | |
# Solves the stolen rubies riddle: https://www.youtube.com/watch?v=2QJ2L2ip32w | |
import itertools | |
def main(): | |
configs = unique_configs(gen_chests()) | |
# For each "reasonable" strategy (possibly assigning a different number to |
NewerOlder