Skip to content

Instantly share code, notes, and snippets.

@MaPePeR
MaPePeR / squardle_note_colorkeyboard.js
Last active March 27, 2022 16:24
Javascript snippet to color the keys on the note-keyboard based on previous guesses. See https://fubargames.se/squardle/
makeBlueNote = ((function (oldMakeBlueNote) {
const BLUE=0,BLACK=1, YELLOW=2, RED=3, ORANGE=4;
function getLetterColorFromHint(color, isHorizontal, isVertical) {
if (color == 'green') {
return BLUE;
}
if (color == 'blacker') {
return BLACK;
}
if (color == 'white') {
@MaPePeR
MaPePeR / inzidenz_per_person.py
Created February 24, 2021 17:51
Verwende die `full-data.csv` von pavelmayer.de/covid/risks/ um die Verteilung der Inzidenzen der Landkreise im zeitlichen Verlauf anhand ihrer Größe darzustellen. (Achtung, sehr schlechter Code...)
# -*- coding: utf-8 -*-
import pandas as pd
import numpy as np
import datetime
columns = [
'IdBundesland',
@MaPePeR
MaPePeR / covid_pavel_N_map_plot.py
Last active January 24, 2021 15:22
Script to show the N values from https://pavelmayer.de/covid/risks/ as a Map. Also attempts to scale the N value with the area of the districts. Also inspired by https://rstats-tips.net/2020/08/09/visualization-of-corona-incidence-in-germany-per-county/
# -*- coding: utf-8 -*-
import pandas as pd
import geopandas as gpd
import geoplot as gplt
import numpy as np
f = gpd.read_file('./gadm36_DEU_shp/gadm36_DEU_2.shp')
@MaPePeR
MaPePeR / ffmpeg_silencetrim_filter.patch
Created July 31, 2020 19:58
ffmpeg filter to trim silence from beginning and end of an audio file.
diff --git a/libavfilter/Makefile b/libavfilter/Makefile
index 0dc74f8b70..18ac1d989f 100644
--- a/libavfilter/Makefile
+++ b/libavfilter/Makefile
@@ -133,6 +133,7 @@ OBJS-$(CONFIG_SIDECHAINCOMPRESS_FILTER) += af_sidechaincompress.o
OBJS-$(CONFIG_SIDECHAINGATE_FILTER) += af_agate.o
OBJS-$(CONFIG_SILENCEDETECT_FILTER) += af_silencedetect.o
OBJS-$(CONFIG_SILENCEREMOVE_FILTER) += af_silenceremove.o
+OBJS-$(CONFIG_SILENCETRIM_FILTER) += af_silenceremove.o
OBJS-$(CONFIG_SOFALIZER_FILTER) += af_sofalizer.o
@MaPePeR
MaPePeR / manifest.json
Created June 1, 2019 15:48
Chrome extension/JavaScript Snippet um in der ZDF Mediathek Videos mit Leertaste zu Pausieren.
{
"name": "MediathekSpacePause",
"version": "1.0",
"description": "In der ZDF Mediathek Videos mit Leertaste pausieren",
"permissions": [],
"content_scripts" : [{
"matches" : [ "http://www.zdf.de/*", "https://www.zdf.de/*"],
"js" : ["mediathekSpacePause.js"]
}],
"manifest_version": 2
@MaPePeR
MaPePeR / install_printers_from_cups_server.sh
Created October 10, 2017 08:26
Generate a wget+lpadmin script that installs all printers from a cups server as local printers. Keeping Description and Location. Downloads a lot of .ppd Files that might need cleanup. Might not work with other versions of cups.
wget -O- http://$1/printers/ | sed -E 's@<TR><TD><A HREF="/printers/([[:alnum:]]+)">\1</A></TD><TD>([^<]+)</TD><TD>([^<]+)</TD>.+$@echo Installing printer "\1"\nwget http://'$1'/printers/\1.ppd\nlpadmin -p \1 -E -v ipp://'$1'/printers/\1 -D "\2" -L "\3" -P \1.ppd@;tx;d;:x'
@MaPePeR
MaPePeR / potions.json
Created September 21, 2015 20:58
Custom Conversion File for Vanilla Potions
{
"comment": "/neircollect collect codechicken.nei.recipe.BrewingRecipeHandler some\n/neircollect collect codechicken.nei.recipe.BrewingRecipeHandler s1=3 so=3\n/neircollect collect codechicken.nei.recipe.BrewingRecipeHandler s1=3 so=3 some",
"groups": {
"codechicken.nei.recipe.BrewingRecipeHandler": {
"comment": "Generated with /neircollect collect codechicken.nei.recipe.BrewingRecipeHandler s1=3 so=3 some",
"conversions": [
{
"count": 3,
"output": "minecraft:potion|8198",
"ingredients": {
@MaPePeR
MaPePeR / appeng2.json
Created September 21, 2015 20:53
Custom Conversion Config file for Applied Energistics 2
{
"comment": "/neircollect collect appeng.integration.modules.NEIHelpers.NEIAEShapedRecipeHandler si\u003d1 oredict\n/neircollect collect appeng.integration.modules.NEIHelpers.NEIAEShapelessRecipeHandler oredict si\u003d1\n/neircollect collect appeng.integration.modules.NEIHelpers.NEIInscriberRecipeHandler oredict si\u003d1",
"groups": {
"appeng.integration.modules.NEIHelpers.NEIInscriberRecipeHandler": {
"comment": "Generated with /neircollect collect appeng.integration.modules.NEIHelpers.NEIInscriberRecipeHandler oredict si\u003d1",
"conversions": [
{
"count": 1,
"output": "appliedenergistics2:item.ItemMultiMaterial|15",
"ingredients": {
@MaPePeR
MaPePeR / autocraft.lua
Last active August 29, 2015 13:58
Computercraft Crafting Turtle Program to craft 2x2 Items like Broken/Crushed/Pulverized Ore
-- Chest Setup:
-- Top = Output Chest. Crafted Items Go here
-- Front = Buffer Chest. Turtle will store items there, that it can not yet craft.
-- Below = Input Chest. Put 2x2 Craftable Stuff there.
-- Assumes that One Stack of Input will yield less than one stack.
bufferCell = 13
craftingCell = 16
-- Drop any items not yet crafted down.
for k,i in pairs({1,2,5,6,bufferCell, (bufferCell + 1)}) do
@MaPePeR
MaPePeR / TutorialCondom.cs
Created August 24, 2013 15:58
Mod to first ask before starting the Tutorial
using System;
using ScrollsModLoader.Interfaces;
using UnityEngine;
using Mono.Cecil;
namespace Template.mod
{
public class MyMod : BaseMod, IOkCancelCallback
{