Skip to content

Instantly share code, notes, and snippets.

@Greenscreener
Greenscreener / average-calculator.py
Last active December 2, 2024 16:03
Just paste the JS file into your console while having your "exam results" window open and then run the python script on the resulting JSON
import json
subjects = json.load(open("znamky.json"))
subjects = [subject for subject in subjects if subject["finished"]]
subjects = [
{**subject, "marked_attempts": [attempt for attempt in subject["attempts"] if attempt["outcome"].isnumeric()]}
for subject in subjects
]
subjects = [
@Greenscreener
Greenscreener / ENOWARS let there be light.js
Created July 22, 2023 10:36
ENOWARS let there be light Tampermonkey script
// ==UserScript==
// @name ENOWARS let there be light
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://7.enowars.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=enowars.com
// @grant none
// ==/UserScript==
// ==UserScript==
// @name Turn off flicker for ECSC Bootcamp
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Stoopid
// @author Me
// @match https://ctf.ecsc2023.eu/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=ecsc2023.eu
// @grant none
// ==/UserScript==
@Greenscreener
Greenscreener / 12to24.user.js
Last active March 7, 2025 19:42
Convert all elements with 12-hour time to 24-hour automatically (for WhatsApp Web, but could be adapted easily)
// ==UserScript==
// @name WAWeb 24-hourifier
// @version 0.10
// @description Convert all elements with 12-hour time to 24-hour automatically (for WhatsApp Web, but could be adapted easily)
// @author Greenscreener
// @homepage https://grsc.cz/
// @match https://web.whatsapp.com/*
// @grant none
// @downloadURL https://gist.githubusercontent.com/Greenscreener/4422f5be36752bc720cbc7222fb73cdc/raw/12to24.user.js
// @updateURL https://gist.githubusercontent.com/Greenscreener/4422f5be36752bc720cbc7222fb73cdc/raw/12to24.user.js
# Each time you put something into your clipboard, it gets appended to a file
wat2=$(xclip -o); while true; do wat=$(xclip -o); if [ "$wat" != "$wat2" ]; then echo $wat >> wat.txt; echo $wat; fi; wat2=$(xclip -o); sleep 0.2; done

Keybase proof

I hereby claim:

  • I am greenscreener on github.
  • I am greenscreener (https://keybase.io/greenscreener) on keybase.
  • I have a public key ASBYeLl4VLpWHkqhZrk4H8M5sUkdV3I9isPxE1-LUy9kJAo To claim this, I am signing this object:
{
    "body":{
        "key":{
data:text/html, <html contenteditable><title> Notepad </title> <meta charset="utf-8"> <style> body {font-family: 'Fira Code'; margin: 1rem; line-height: 44px; background-image: url("data:image/gif;base64,R0lGODlhFgAsAJEAAP////n8/ePv9gAAACH5BAAHAP8ALAAAAAAWACwAAAInhI+py+0Po5y02ouz3rz7D4biSJbmiabqyrZuFsTyTNeBgOf6zgsFADs="); margin-left: 5rem; margin-top: 2.8em; } body::before { height: 100%; content: ""; width: 2px; background-color: %23ff9893; position: absolute; left: 3.5rem; top: 0; } </style>
import random;
class Dice:
number = 0;
def roll(self):
self.number = random.randrange(1,7);
stash = [];
cup = [];
7:05-7:50 7:55-8:40 8:50-9:35 9:55-10:40 10:50-11:35 11:45-12:30 12:35-13:20 13:25-14:10 14:15-15:00 15:05-15:50 15:55-16:40
0 1 1 1 1 1 0 1 1 1 0
1 1 1 1 1 0 1 1 0 0 0
0 1 1 1 1 1 1 0 0 0 0
0 1 1 1 1 1 1 0 1 1 1
0 1 1 1 1 1 1 0 0 0 0