Skip to content

Instantly share code, notes, and snippets.

@loxaxs
loxaxs / derpibooruScoreSort.user.js
Created December 16, 2019 03:25
Allow to quickly sort posts by score on Derpibooru
// ==UserScript==
// @name Derpibooru Score Sort
// @namespace oxie.cc
// @include /http[s]*:\/\/(www\.|philomena\.|)(trixie|derpi)booru.org\/.*/
// @exclude /http[s]*:\/\/(www\.|philomena\.|)(trixie|derpi)booru.org\/(adverts\/|.*\.json).*/
// @version 0.1
// @description Allow to quickly sort posts by score on Derpibooru
// @author loxaxs
var f = (b) => {
f.st = setTimeout(() => {
(
$("body > .modal:last-child") ||
{scrollTo: () => (console.log(".modal not found. stopping"), true)}
).scrollTo(0, 13726 * !!b) ||
f(!b)
}, 3000)
}
#!/usr/bin/env python3
# (Advice: use IPython)
# Dependencies:
# sudo -H pip3 install plumbum art
from plumbum import cmd as c
from art import text2art
ponyList = (c.ponysay["+A"] | c.sed["s/\x1b\[[0-9;]*m//g;s/(.*)//g"] | c.grep["-v", "located"])().split()
@loxaxs
loxaxs / applejack.ascii.txt
Created February 6, 2019 20:52
Applejack
____
__/ \__
/| `◕ \
_——————/// ___|
/// ó // /
////ó ó __ / /
///\ /\ \ /\
\| / / | | / /\ \
/ /_//_/ /_/ /_/
@loxaxs
loxaxs / run.sh
Created February 6, 2019 06:51
Multiple arguments in shebang
#!/bin/bash
#
# /usr/local/bin/run
#
# Split the first argument on IFS and replace bash by running the resulting command.
# Shebang to this script to be able to use multiple arguments in your shebang.
# Usage (at the beginning of a file):
# #!/usr/local/bin/run python3 -O -i
# print("__debug__ :: {}".format(__debug__))
@loxaxs
loxaxs / derpibooru-sort-tag-by-count.js
Created November 6, 2018 17:12
A JS script for Derpibooru which orders any tag list of the page by tag count. It's supposed to be used in the developer console (F12 or Ctrl+Shift+I/J).
/* A function to change the page display */
function appendCss(css) {
var styleElem = document.createElement('style');
styleElem.textContent = css;
document.head.appendChild(styleElem);
}
/* A function to extract the tag-count of a tag element */
function extractCount(tagElem) {
return parseInt(tagElem.innerText.replace(/^.* \((\d+)\) \+$/, "$1"));
@loxaxs
loxaxs / derpi-tag-crawler.js
Created September 15, 2018 23:53
Derpibooru category tag crawler
// /\ CUSTOMIZABLE CODE
// You can re-order the categories
var categories = ["other", "error", "rating", "content-official", "spoiler", "content-fanmade", "character", "oc", "origin", ""];
// You can choose not to fill certain categories. "", "origin" and "oc" are the three biggests.
var categoriesHide = {
"": true, // Contains all general tags
"origin": true, // Contains all artist tags as well as `screencap`, `edit`, `edited screencap`, `derpibooru exclusive`, `alternate version`, `color edit` and that should be all of them.
"oc": true // `oc`, `oc only`, and `oc:*` most notably, `oc:anon`.