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 json | |
from pathlib import Path | |
import requests | |
VERSION = '1.19.3' | |
URL = f'https://mcassets.matdoes.dev/versions/{VERSION}/downloads/client/assets/minecraft/textures/%s/%s.png' | |
TRY = ['item', 'block'] | |
RESULT_FILE = 'results.json' |
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 io import BytesIO | |
from pathlib import Path | |
from cairosvg import svg2png | |
from PIL import Image, ImageChops | |
# This likely only works with the old style of flags (flag-spriteXX.svg) | |
FLAG_SHEET = 'flags.svg' | |
OUTPUT_DIR = 'flags' | |
TARGET_FLAG_SIZE = 512 |
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
std::byte scaled[scaledWidth * scaledHeight * 4]; | |
int pixelSize = scaledWidth / width; | |
for (int realRow = 0; realRow < height; ++realRow) { | |
for (int realColumn = 0; realColumn < width; ++realColumn) { | |
int realIndex = (realRow * width) + realColumn; | |
std::byte *realRed = &image[realIndex * 5]; | |
for (int pixelRow = 0; pixelRow < pixelSize; ++pixelRow) { | |
for (int pixelColumn = 0; pixelColumn < pixelSize; ++pixelColumn) { |
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
// ==UserScript== | |
// @name NWS Old Icons | |
// @namespace http://lpx.sh/ | |
// @version 0.6.2 | |
// @description Changes the icons on National Weather Service's forecast pages to the old set of icons. | |
// @author Luke | |
// @match *://forecast.weather.gov/MapClick.php* | |
// @grant none | |
// ==/UserScript== |
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 | |
# Start config | |
ATTEMPT_SECONDS = 1.694 | |
COMBINATIONS = 56800235584 | |
# End config | |
threads = float(input("Threads: ")) | |
tests_per_second = threads / ATTEMPT_SECONDS |