Skip to content

Instantly share code, notes, and snippets.

@zeratax
zeratax / sadfavs.py
Last active November 11, 2022 22:45
archive your sadpanda favs
# usage: sadfavs.py [-h] [-f FILE] -u USERNAME -p PASSWORD [-d] [--port PORT]
# [-a ADDRESS] [-n NUMBER]
# download sadpanda galleries with tags. archives all your favorites or all
# links (seperated by a newline) from a file. saves tags and general info for
# every gallery as a json file. to download galleries you need to run
# transmission with remote control enabled.
# optional arguments:
# -h, --help show this help message and exit
@zeratax
zeratax / crawler.py
Last active January 2, 2021 23:55
archive your bookmarks -- looks through exported html files (e.g. exported bookmarks) for specific websites and downloads them with youtube-dl
#####
# Installation:
# install python3 and install via pip "bs4" and "youtube_dl"
#
# Usage:
# python3 crawler.py -h
#
# Example:
# export your bookmarks with firefox and then crawl them for youtube and soundcloud by executing:
# python3 crawler.py -f bookmarks.html -w youtube.com -w youtu.be -w soundcloud.com
@zeratax
zeratax / twiblur.user.js
Last active October 16, 2018 21:08
blurs twitter media by default unless you hover over it, for a more sfw twitter
// ==UserScript==
// @name twiblur
// @namespace mail@zera.tax
// @version 0.2
// @description blur twitter images
// @author ZerataX
// @license Unlicense
// @match https://twitter.com/*
// @grant GM_addStyle
// @run-at document-start
@zeratax
zeratax / synapse-registration.py
Last active April 14, 2018 04:18
api endpoint for token protected registration
from flask import Flask, request, abort, jsonify, request
import hashlib
import hmac
import requests
SERVER_LOCATION = 'https://homeserver.tld/'
SHARED_SECRET = b'registration_shared_secret see homeserver.yaml'
app = Flask(__name__)
@zeratax
zeratax / bot.py
Last active March 18, 2018 02:25
fancy discord nicks
import discord
import asyncio
import cool_names
client = discord.Client()
invite = "https://discordapp.com/api/oauth2/authorize"
permissions = "201326592"
@client.event
@zeratax
zeratax / cantor.pdf
Last active June 19, 2018 14:35
Cantor's diagonal argument
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zeratax
zeratax / repeat_messages.py
Created September 24, 2017 20:43
resends deleted discord messages cos some people really over do it...
import discord
import asyncio
from datetime import datetime
import time
client = discord.Client()
@zeratax
zeratax / gimages.py
Last active December 30, 2022 09:53
get first result from google image search
from bs4 import BeautifulSoup
import requests
def get_google_img(query):
"""
gets a link to the first google image search result
:param query: search query string
:result: url string to first result
"""
@zeratax
zeratax / bitmap2coordinates.py
Last active May 3, 2017 17:49
Converts a line in a bitmap to 2d coordinates
from PIL import Image
from matplotlib import pyplot as plt
import numpy as np
# Edit these values
file = "quecksilber_graphonly.BMP"
line_color = np.array([0, 192, 192])
# colors in rgb
black = np.array([0, 0, 0])
white = np.array([255, 255, 255])
@zeratax
zeratax / index.html
Last active September 6, 2017 16:21
wallpaper_generator
<div class="background"></div>
<div class="widget">
<div class="center">
<h1>漢字</h1>
<img id="object">
</div>
</div>
<div class="info">
<p>Source:
<a href="https://danbooru.donmai.us/posts/2735908" target="_blank">