Skip to content

Instantly share code, notes, and snippets.

View krmax44's full-sized avatar

Max krmax44

View GitHub Profile
@krmax44
krmax44 / kahoot-to-anki.ipynb
Last active February 6, 2024 13:04
Export Kahoot quizes to Anki text file
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krmax44
krmax44 / lange-gesetze.ipynb
Last active November 27, 2022 12:48
Lange Gesetze
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@krmax44
krmax44 / export-ical.user.js
Last active May 30, 2022 11:57
re:publica 22 Schedule iCal export userscript
// ==UserScript==
// @name re:publica iCal Export
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Export sessions to iCal
// @author You
// @match https://re-publica.com/de/session/*
// @match https://re-publica.com/en/node/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=re-publica.com
// @grant none
@krmax44
krmax44 / vegan-stw.user.js
Last active May 31, 2022 10:59
Userscript to highlight vegan dishes on stw.berlin
// ==UserScript==
// @name stw.berlin veganize
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Highlight vegan dishes
// @author krmax44
// @match https://www.stw.berlin/mensen/einrichtungen/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=stw.berlin
// @grant none
// ==/UserScript==
@krmax44
krmax44 / monitor-backups.php
Created February 18, 2022 10:59
Simple cron job to check if a scheduled backup was uploaded
<?php
// usage: php -f monitor-backups.php -- "./myfolder" "[email protected]" "[email protected]"
$folder = $argv[1];
$email = $argv[2];
$from = $argv[3];
$delay = isset($argv[4]) ? $argv[4] : 2 * 24 * 60 * 60; // 48 hours by default
if (!is_dir($folder)) {
throw new Exception("Folder does not exist.");
@krmax44
krmax44 / silvercrest-rf-outlet-codes.md
Last active September 7, 2021 14:18
Silvercrest Remote Outlet 433 MHz Codes

Silvercrest Remote Outlet RF Codes

RF Codes for Silvercrest Remote Outlets. Raw codes recorded with ESP Home.

Outlet A	  on	  303, -2411, 293, -1256, 1069, -490, 288, -1259, 1067, -486, 1065, -512, 266, -1272, 279, -1276, 275, -1267, 1059, -504, 275, -1280, 271, -1268, 1061, -493, 1061, -495, 283, -1264, 288, -1260, 1066, -496, 283, -1279, 1044, -514, 264, -1279, 273, -1284, 268, -1289, 264, -1277, 276, -1288, 265, -1273, 288, -2426, 283, -1266, 1062, -503, 277, -1272, 1057, -507, 1047, -515, 265, -1297, 257, -1285, 269, -1300, 1029, -529, 252, -1292, 262, -1287, 1046, -515, 1041, -508, 272, -1279, 275, -1281, 1049, -505, 275, -1292, 1035, -516, 264, -1293, 260, -1286, 268, -1310, 245, -1301, 254, -1297, 258, -1299, 264, -2443, 273, -1281, 1051, -509, 272, -1295, 1036, -507, 1046, -524, 255, -1289, 264, -1295, 260, -1314, 1018, -536, 245, -1301, 255, -1293, 1043, -527, 1032, -533, 248, -1291, 266, -1287, 1046, -522, 2
@krmax44
krmax44 / _r2c3.md
Last active December 28, 2020 12:27

Real Remote Chaos Experience (r2c3)

Remote, as in, from the couch. Allows the rc3 world to be navigated using a gamepad. Install Greasemonkey, then click on the Raw button of the r2c3.user.js file below. An installation window should open. If not, just create an empty script and paste the code below.

Controls

  • axis 0/1: mapped to up, down, left, right (movement).
  • button 5 (right top shoulder button): mapped to shift (running)
  • button 0 (A button): mapped to Enter
  • button 1 (X button): mapped to Mic Mute toggle
@krmax44
krmax44 / Code.gs
Created November 9, 2020 08:47
JS Array functions in Google Spreadsheets
function JSMAP(data, fn) {
return data.map(eval(fn));
}
function JSFILTER(data, fn) {
return data.filter(eval(fn));
}
function JSREDUCE(data, fn, start) {
return data.reduce(eval(fn), eval(start));
@krmax44
krmax44 / _README.md
Created August 13, 2020 19:50
Continous deployment with Gitlab and PHP

Continous deployment with Gitlab and PHP

Use this script to auto-deploy Gitlab artifacts to your PHP server.

Usage

Set up a Gitlab CI pipeline that creates an artifact zip file, a webhook that is triggered by pipeline events set to index.php. The token should be a secure, random string and needs to be also set in config.php.

This project follows hack-driven development guidelines - please read the code thoroughly before deploying on production. No warranty provided, it might just rm -rf your life server 🤷

/*
I stumbled upon the Python-syntax for creating a RegEx, and decided to spend a minute trying to replicate
it in JavaScript with Template String Functions. I certainly have no use for it but there you go.
*/
function combine(...args) {
const parts = args.shift();
const inserts = [...args, ''];
return parts.reduce((a, b, i) => (a += b + inserts[i]), '')