Skip to content

Instantly share code, notes, and snippets.

View alyti's full-sized avatar
🏳️‍⚧️

Aly alyti

🏳️‍⚧️
View GitHub Profile
#!/usr/bin/python3
# Solution to the challenge at https://gist.github.com/ehmo/7f515ac6461c1c4d3e5a74f12e6eb5ea
#
# Given an input base image, computes two derivative images that have different
# perceptual hashes, yet differ by only one pixel.
#
# Usage: hash_bisector.py <input.png> <output_a.png> <output_b.png>
import sys, imagehash
from PIL import Image, ImageEnhance
@alyti
alyti / bookmarklet
Last active April 3, 2024 20:44
Download mods from ageofempires.com
javascript:(function() {
let id = parseInt(location.pathname.match("([0-9]{1,5})")[0], 10); if (id === NaN) {return};
fetch("https://api.ageofempires.com/api/v1/mods/Download", {"credentials": "include", "headers": { "Content-Type": "application/json" }, "body": JSON.stringify({id, boolValue: true}), "method": "POST", "mode": "cors"}).then(r => r.json()).then(r => {location.href = r.value.downloadUrl}).catch(e => console.log(e));
})()
[package]
name = "vroid-hair-merger"
version = "0.1.0"
authors = ["Aleks <me@zeta.pm>"]
edition = "2018"
[dependencies]
serde = { version = "1.0", features = ["derive"] }
uuid = { version = "0.7", features = ["serde", "v4"] }
serde_json = "1.0"
@alyti
alyti / DiscordSwitchPiratesHelper.user.js
Last active March 5, 2019 09:33
A little helper userscript to make downloading NSPs from Switch Pirates a bit more tolerable
// ==UserScript==
// @name Discord Switch Pirates Helper
// @namespace http://tampermonkey.net/
// @version 2.1.1
// @description Arr!!
// @author AltiCodes
// @match *://discordapp.com/channels/*
// @grant GM_setClipboard
// @inject-into auto
// @downloadURL https://gist.github.com/AltiCodes/3b94a627f797baf03f0e25e6b2d221d3/raw/DiscordSwitchPiratesHelper.user.js