Skip to content

Instantly share code, notes, and snippets.

function getOwnedCharacters() {
// in the bookmarklet:
// const chars = o.data.avatars.map(a => [a.name, a.actived_constellation_num]);
// const url = 'https://genshin.wife4.dev/teams#' + new URLSearchParams(chars);
// fallback to test data for node testing
const paramsString =
typeof window !== 'undefined'
? window.location.hash.substring(1)
: 'Jean=1&Kaedehara+Kazuha=0&Raiden+Shogun=0&Yelan=0&Tighnari=0&Nahida=0&Furina=0&Kirara=1&Manekin=0&Manekina=0&Neuvillette=0&Arlecchino=0&Bennett=4&Sucrose=0&Kuki+Shinobu=1&Chevreuse=6&Skirk=0&Lauma=0&Xianyun=0&Lisa=1&Xiangling=6&Xingqiu=6&Fischl=4&Traveler=6&Zhongli=0&Hu+Tao=1&Navia=0&Citlali=0&Rosaria=4&Gaming=5&Escoffier=0&Ororon=6&Iansan=0&Diluc=3&Mona=0&Clorinde=0&Beidou=2&Layla=6&Yaoyao=6&Lan+Yan=5&Keqing=1&Diona=5&Kujou+Sara=0&Yun+Jin=3&Collei=4&Lynette=0&Sethos=3&Kachina=2&Aino=0&Ifa=2&Noelle=6&Barbara=6&Shikanoin+Heizou=5&Faruzan=3&Kaeya=0&Amber=1&Ningguang=0&Dehya=0&Razor=2&Chongyun=0&Xinyan=1&Yanfei=3&Thoma=5&Sayu=0&Gorou=2&Dori=0&C
import json
import re
import sys
import os
from urllib import request
from tabulate import tabulate
API_URL = "https://api.yshelper.com/ys/getAbyssRank.php?star=all&role=all&lang=en"
! based on https://www.squabbled.net/paste/fandomfixeduBlockOrigin.txt
! comments restored
! -
! fix the entire layout, remove sidebar, ads, spam, etc
fandom.com##.global-navigation
fandom.com##.anon.global-navigation
fandom.com##.a-list-feed
fandom.com##.search-box-bottom-wrapper
fandom.com##div.wds-global-footer__column:nth-of-type(4)
fandom.com##.wds-is-follow-us.wds-global-footer__section
from collections import defaultdict
import numpy as np
item = 'cauldron', 1 # edit to set which item will be modelled
collect_immediately = True # whether drops will be collected asap or later at max lvl
num_simulations = 10000
equivalents = {
'coins': [1, 3, 8, 20, 50, 120],
'gemstone': [1, 3, 8, 20],
#!/bin/bash
set -e -o pipefail -x
chown -R root:root $LFS/{usr,lib,var,etc,bin,sbin,tools}
case $(uname -m) in
x86_64) chown -R root:root $LFS/lib64 ;;
esac
mkdir -pv $LFS/{dev,proc,sys,run}
mount -v --bind /dev $LFS/dev
mount -v --bind /dev/pts $LFS/dev/pts
#!/bin/bash
set -e -o pipefail -x
cd $LFS/sources
tar --extract --file binutils-2.39.tar.xz
cd binutils-2.39
mkdir -v build
cd build
time { ../configure --prefix=$LFS/tools \
@escalonn
escalonn / lfs1.sh
Last active September 29, 2022 09:09
#!/bin/bash
set -e -o pipefail -x
export DEBIAN_FRONTEND=noninteractive
echo 'deb http://deb.debian.org/debian/ bullseye contrib non-free' | sudo tee /etc/apt/sources.list.d/other.list
sudo apt update
sudo apt full-upgrade
sudo apt autoremove
sudo apt install \
bash \
bash-completion \
// run with dotnet run
using System.Reflection;
using P0;
Console.WriteLine("Running P0 tests...");
int passed = 0, failed = 0;
IEnumerable<MethodInfo> testMethods = typeof(UnitTests).GetMethods()
.Where(m => m.GetCustomAttributes(typeof(UnitTestAttribute)).Any());
foreach (MethodInfo method in testMethods)
import re
words = {}
for i in range(int(input())):
word = input().lower()
words[re.sub('[a-z]', lambda m: 'z' if m.group() in 'aeiou' else 's', word)] = word
print(re.sub(r'\w+',
lambda m: ''.join(c2.upper() if c1.isupper() else c2
for c1, c2 in zip(m.group(), words[m.group().lower()])),
// example: dotnet run -- words_alpha.txt cat"
string dictionary = args[0];
string tiles = args[1];
Dictionary<string, List<string>> groups = File.ReadLines(path: dictionary)
.GroupBy(Alphabetize)
.ToDictionary(g => g.Key, g => g.ToList());