Skip to content

Instantly share code, notes, and snippets.

View TypeA2's full-sized avatar
🍡

TypeA2

🍡
View GitHub Profile
/* 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 September 15, 2024 16:46
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 Violentmonkey Scripts
// @match *://*.donmai.us/uploads/*
// @grant none
// @version 1.0.2
// @author TypeA2
// @description 2024-06-18 (initial), 2024-06-19 (current)
// @downloadURL https://gist.github.com/TypeA2/bff1474c0f4ca2188cf21897d4e4b2dd/raw/Easier_1up.user.js
// @updateURL https://gist.github.com/TypeA2/bff1474c0f4ca2188cf21897d4e4b2dd/raw/Easier_1up.user.js
@TypeA2
TypeA2 / pixel_hash.py
Created June 17, 2024 05:53
Danbooru Pixel Hash
#!/usr/bin/env python3
# Calculates an image's pixel hash as per the algorithm used by Danbooru
from pyvips import Image
from tempfile import TemporaryFile
from pathlib import Path
from typing import cast
import hashlib
import sys
@TypeA2
TypeA2 / TypoFixer.user.js
Last active September 2, 2024 12:37
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.26
// @author TypeA2
// @description 2024-05-02 (initial), 2024-09-02 (current)
// @downloadURL https://gist.github.com/TypeA2/2bd32138b4b9eb640e4eee1f48f584ee/raw/TypoFixer.user.js
@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 / 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 / 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 / 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 / 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;