Skip to content

Instantly share code, notes, and snippets.

View rebane2001's full-sized avatar
🦊

Lyra Rebane rebane2001

🦊
View GitHub Profile
@rebane2001
rebane2001 / subredditpurge-helper.user.js
Last active November 7, 2023 18:07
Edits the SubredditPurge mail to have links and an "Open all" button, autofills SubredditPurge info on the ban page if SubredditPurge hasn't been banned yet
// ==UserScript==
// @name SubredditPurge helper - reddit.com
// @namespace Rebane
// @match https://*.reddit.com/r/*/about/banned/
// @match https://*.reddit.com/message/messages/*
// @grant none
// @version 1.0.1
// @author Rebane
// @description Edits the SubredditPurge mail to have links and an "Open all" button, autofills SubredditPurge info on the ban page if SubredditPurge hasn't been banned yet (2023-11-07)
// ==/UserScript==
@rebane2001
rebane2001 / admin-pixel-notification.user.js
Last active July 23, 2023 17:23
Admin Pixel Notification
// ==UserScript==
// @name Admin Pixel Notification
// @namespace rebane
// @match https://garlic-bread.reddit.com/embed*
// @version 1.1
// @author Rebane
// ==/UserScript==
// Hook into the fetch function
const origFetch = window.fetch;
@rebane2001
rebane2001 / jsonl_benchmark.py
Created July 10, 2023 15:05
Testing various ways of reading YouTube API json from a jsonl file
import time
import json
import orjson
import msgspec
class Snippet(msgspec.Struct):
title: str
class Video(msgspec.Struct):
id: str
@rebane2001
rebane2001 / pdubhelper4.html
Last active May 29, 2023 20:42
For making ponydubs
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<script crossorigin="anonymous"
src="https://cdn.jsdelivr.net/npm/@ffmpeg/ffmpeg@0.10.1/dist/ffmpeg.min.js"></script>
<title>Pdubhelper4</title>
@rebane2001
rebane2001 / omniva_autodeclare.js
Created May 29, 2023 15:58
Userscript that adds a button to Omniva's interface to immediately take you to eMTA and fill in the right fields. Use at your own discretion.
// ==UserScript==
// @name Omniva auto-declare
// @namespace rebane
// @match https://maasikas.emta.ee/smartdecl/wicket/page
// @match https://maasikas.emta.ee/smartdecl/parcel
// @match https://minu.omniva.ee/s/*
// @grant none
// @version 1.0
// @author rebane
// @description Userscript that adds a button to Omniva's interface to immediately take you to eMTA and fill in the right fields. Use at your own discretion.
@rebane2001
rebane2001 / rabool-js.html
Last active March 20, 2023 15:37 — forked from petskratt/xkcd_pwd_gen.php
Generate xkcd style password using most common 1000 Estonian words (Ansip and Savisaar excluded)
<!doctype html>
<html lang="et">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Salasõna-pulpulaator | rabool-js</title>
<style>
html {
background-color: #fafafa
}
@rebane2001
rebane2001 / run_pane.sh
Last active March 4, 2023 14:15
Run a command in a new tmux pane in the same window (not sure about multiple sessions)
TMUX_WINDOW="$(tmux display-message -p '#I')"
function run_pane {
tmux split-window -h -t "${TMUX_WINDOW}" "$1"
# Wait for exit version:
# waitid="$(openssl rand -hex 16)"
# tmux split-window -h -t "${TMUX_WINDOW}" "$1; tmux wait -S ${waitid}"
# tmux wait "${waitid}"
}
# run_pane 'python3 verbose_script.py'
@rebane2001
rebane2001 / search_hobune_for_all.js
Created September 26, 2022 13:51
Old version, still works but has some glitches
// ==UserScript==
// @name Search Hobune for all videos on page
// @namespace hobune.stream
// @match https://www.youtube.com/*
// @grant GM_xmlhttpRequest
// @connect hobune.stream
// @version 1.0
// @author Rebane
// @description 1/8/2021, 12:02:22 PM
// ==/UserScript==
@rebane2001
rebane2001 / dropbox-folder-batch-download.js
Last active June 8, 2022 16:40
Automatically downloads every Dropbox subfolder (and file) as a zip file.
/*
Sometimes, Dropbox folders are too huge and attempting to download them as zip results in the "The zip file is too large." error.
This script automatically downloads every subfolder (and file) as a zip file to work around this issue.
To use it, just open the Console (F12) on the Dropbox page, paste this script in, and run it.
*/
document.querySelectorAll("a").forEach(e => {
if (e.href.includes("dl=0")){
window.open(e.href.replace("dl=0","dl=1"));
}
})
#!/usr/bin/env python3
import requests
import re
import os
import time
import json
from datetime import datetime, timezone
import random