This file contains hidden or 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
* | |
INVERT | |
.jfk-bubble.gtx-bubble | |
.captcheck_answer_label > input + img | |
span#closed_text > img[src^="https://www.gstatic.com/images/branding/googlelogo"] | |
span[data-href^="https://www.hcaptcha.com/"] > #icon | |
#bit-notification-bar-iframe | |
::-webkit-calendar-picker-indicator |
This file contains hidden or 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/python3.10 | |
import subprocess | |
import humanfriendly | |
out = subprocess.run( | |
'docker images --format "{{.ID}}\t{{.Size}}\t{{.Tag}}\t\t\t{{.Repository}}"', | |
shell=True, | |
stdout=-1, | |
) | |
imgs = [img.split() for img in out.stdout.decode().split("\n") if img] |
This file contains hidden or 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 unicodedata | |
def unicode_character_name(i: int) -> str: | |
"""Tries to get the unicode name for a given character ordinal. | |
Useful for finding various quotation marks""" | |
try: | |
return unicodedata.name(chr(i)) | |
except ValueError: | |
return "" |
This file contains hidden or 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 asyncio | |
import re | |
import json | |
import os | |
import subprocess | |
from collections import defaultdict | |
import requests | |
import asyncpg | |
This file contains hidden or 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 asyncio | |
from typing import Generic, TypeVar | |
K = TypeVar("K") | |
V = TypeVar("V", str, list[str], dict[str, str], int, float) # some common simple JSON types | |
class SlowDict(Generic[K, V]): | |
def __init__(self) -> None: | |
self.d: dict[K, V] = {} |
This file contains hidden or 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
CREATE TABLE accounts( | |
id serial PRIMARY KEY, | |
name VARCHAR(256) NOT NULL | |
); | |
CREATE TABLE entries( | |
id serial PRIMARY KEY, | |
description VARCHAR(1024) NOT NULL, | |
amount NUMERIC(20, 2) NOT NULL CHECK (amount > 0.0), | |
-- Every entry is a credit to one account... |
This file contains hidden or 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 math | |
from moviepy.editor import concatenate, ImageClip | |
import os | |
import platform | |
import subprocess | |
import random | |
import torch | |
# pip install pytorch-pretrained-biggan | |
from pytorch_pretrained_biggan import (BigGAN, truncated_noise_sample, convert_to_images) | |
import numpy as np |
This file contains hidden or 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
def walk(obj, path): | |
last = obj | |
for key in path: | |
if isinstance(last, list): | |
last = last[key] | |
else: | |
last = last.get(key, {}) | |
def prune(obj, keys=["Name", "DisplayMessage", "Type", "Time"]): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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 time | |
from functools import reduce | |
from random import sample | |
from operator import itemgetter | |
from ps1_partition import get_partitions | |
# ================================ | |
# Part A: Transporting Space Cows | |
# ================================ |