Skip to content

Instantly share code, notes, and snippets.

View TypeA2's full-sized avatar
🍡

TypeA2

🍡
View GitHub Profile
@TypeA2
TypeA2 / danbooru_download.py
Last active January 2, 2024 03:40
Download all images on danbooru by tag
import sys, os, requests, json, time, math
if len(sys.argv) < 2:
print("Tags not specified")
sys.exit(1)
elif sys.argv[1].count(" ") > 1:
print("Maximum of 2 arguments")
sys.exit(1)
tags = sys.argv[1]
@TypeA2
TypeA2 / transparent_png.py
Last active May 8, 2021 01:13
Adds a null byte to the IEND chunk of a png file, so that Steam doesn't generate it's own preview of it
#!/usr/bin/env python3
"""
Copyright (c) 2021 TypeA2
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@TypeA2
TypeA2 / transcode.py
Last active May 8, 2021 19:39
transcode.py
#!/usr/bin/env python3
"""
Copyright (c) 2021 TypeA2
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@TypeA2
TypeA2 / imgur_download.py
Last active May 15, 2023 23:41
Download imgur images with imgur's ajax format as a source
#!/usr/bin/env python3
import sys
import json
import asyncio
import aiohttp
from tqdm import tqdm
from itertools import islice
from pathlib import Path
PARALLEL = 12
@TypeA2
TypeA2 / theme.css
Created May 22, 2023 18:32
Custom dark Danbooru
.ai-tags-related-tags-column.hidden {
display: initial !important;
}
body.dark, body[data-current-user-theme="dark"] {
--grey-0: #f6f6f6;
--grey-1: #e8e8e8;
--grey-2: #d1d1d1;
--grey-3: #ababab;
--grey-4: #919191;
@TypeA2
TypeA2 / shorts_redirect.user.js
Last active July 3, 2023 12:49
Redirect YouTube shorts to their /watch equivalent
// ==UserScript==
// @name Redirect YouTube shorts to normal video pages
// @namespace http://tampermonkey.net/
// @version 1.0
// @author TypeA2
// @match https://*.youtube.com/shorts/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant none
// ==/UserScript==
@TypeA2
TypeA2 / copy-dtext.user.js
Last active September 18, 2024 01:49
Copy Tweet content as DText
// ==UserScript==
// @name Copy Tweet text as DText
// @namespace Violentmonkey Scripts
// @match *://twitter.com/*/status/*
// @match *://x.com/*/status/*
// @grant none
// @version 1.1
// @author TypeA2
// @description 7/3/2023, 2:22:48 PM
// @updateURL https://gist.github.com/TypeA2/7e9298641dec292a39cc83143e8a51f2/raw/copy-dtext.user.js
@TypeA2
TypeA2 / twitter_embed_proxy_upload.user.js
Created October 8, 2023 10:24
Allows uploading by directly inputting the fxtwitter/vxtwitter link on the upload page.
// ==UserScript==
// @name fxtwitter/vxtwitter uploader - danbooru.donmai.us
// @namespace Violentmonkey Scripts
// @match https://*.donmai.us/uploads/new
// @grant none
// @version 1.0
// @author TypeA2
// @description 10/8/2023, 12:27:51 AM
// ==/UserScript==
@TypeA2
TypeA2 / bluesky_replacement.py
Created February 9, 2024 23:39
bluesky_replacement.py
#!/usr/bin/env python3
import os
import json
import re
import time
import hashlib
import mimetypes
import io
from PIL import Image
from pathlib import Path
@TypeA2
TypeA2 / TypoFixer.user.js
Last active September 23, 2024 05:53
Because I can't type, apparently.
// ==UserScript==
// @name TypoFixer
// @namespace Violentmonkey Scripts
// @match *://*.donmai.us/posts*
// @match *://*.donmai.us/uploads/*
// @grant none
// @version 1.0.28
// @author TypeA2
// @description 2024-05-02 (initial), 2024-09-23 (current)
// @downloadURL https://gist.github.com/TypeA2/2bd32138b4b9eb640e4eee1f48f584ee/raw/TypoFixer.user.js