Skip to content

Instantly share code, notes, and snippets.

View TypeA2's full-sized avatar
🍡

TypeA2

🍡
View GitHub Profile
// ==UserScript==
// @name Check everyhing really
// @namespace https://docs.scriptcat.org/
// @version 1.0.1
// @description A real check-all
// @author TypeA2
// @downloadURL https://gist.github.com/TypeA2/d8df8b02f59281d6f8e145b59d6cdf8b/raw/el-check-all.js
// @updateURL https://gist.github.com/TypeA2/d8df8b02f59281d6f8e145b59d6cdf8b/raw/el-check-all.js
// @match *://*.donmai.us/*
// @grant none
@TypeA2
TypeA2 / dan2sixel.py
Created November 3, 2025 10:16
Convert Danbooru posts (by ID) to Sixel format
#!/usr/bin/env python3
import sys
import math
import io
import requests as re
from itertools import groupby
from PIL import Image
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <post ID>")
#!/usr/bin/env python3
BDS = 3
ALBUMS = 6
CDS = 9
options: list[dict] = []
for bds in range(BDS + 1):
for albums in range(ALBUMS + 1):
for cds in range(CDS + 1):
total = (bds * 9900) + (albums * 3850) + (cds * 1540)
// ==UserScript==
// @name Post score and fav
// @namespace Violentmonkey Scripts
// @match *://*.donmai.us/posts
// @match *://*.donmai.us/
// @grant none
// @version 1.0
// @author user #480070
// @description 7/4/2025, 1:14:55 PM
// ==/UserScript==
#!/usr/bin/env python3
import sys
import zlib
from pathlib import Path
if len(sys.argv) > 1:
p = Path(sys.argv[1])
assert p.exists()
instream = p.open("rb")
else:
// ==UserScript==
// @name Anti-tab
// @namespace Violentmonkey Scripts
// @match *://*.donmai.us/uploads/*
// @grant none
// @version 1.0
// @author TypeA2
// @description 3/13/2025, 11:46:28 AM
// @downloadURL https://gist.github.com/TypeA2/72bdde255f33dc05d2264d1a51a9abee/raw/anti-tab.user.js
// @updateURL https://gist.github.com/TypeA2/72bdde255f33dc05d2264d1a51a9abee/raw/anti-tab.user.js
/* Initial version: 2024-09-06
* Current version: 2024-09-06
*/
javascript:void(async () => {
let text = "";
for (const e of document.querySelector("h2 + div > h1").childNodes) {
console.log(e.nodeName)
switch (e.nodeName) {
case "A": {
@TypeA2
TypeA2 / bookmarklet.js
Last active January 25, 2025 15:05
Profile URLs bookmarklet
/* Initial version: 2024-08-26
* Current version: 2024-09-15 (rev: 3)
*
* Changelog:
* Rev 1: fixed Twitter, Pixiv, add misskey
* Rev 2: firefox detection, fix bluesky
* Rev 3: fix Bluesky, limited Youtube support
*/
javascript:void(async () => {
var profile_url;
// ==UserScript==
// @name Easier 1up
// @namespace https://github.com/TypeA2/booru-scripts
// @match *://*.donmai.us/uploads/*
// @grant none
// @version 1.0.3
// @author TypeA2
// @description 2024-06-18 (initial), 2024-06-19 (current)
// @downloadURL https://github.com/TypeA2/booru-scripts/raw/refs/heads/master/Easier_1up.user.js
// @updateURL https://github.com/TypeA2/booru-scripts/raw/refs/heads/master/Easier_1up.user.js
@TypeA2
TypeA2 / pixel_hash.py
Last active October 2, 2025 18:32
Danbooru Pixel Hash
#!/usr/bin/env python3
from pyvips import Image
from tempfile import TemporaryFile
from pathlib import Path
from typing import cast
from zipfile import ZipFile
import hashlib
import sys
import json