This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Das Gendersternchen funktioniert nicht gut zusammen mit Markdown. Folgender | |
Regexp liefert ein Preprocessing, was es ermöglicht, ohne einen anderen | |
Markdown-Dialekt zu wählen (Regulärer Ausdruck in Python): | |
> for x in ["Gender*nnen","foo *bar* baz", "foo *bar*baz", "Und *das* ist wirklich Mensch*nnen *und* toll."]: | |
> print(re.sub(r"(^|\s)(\w+)\*([^.\s]*\w+)($|\s)", r"\1\2\*\3\4", x)) | |
Gender\*nnen | |
foo *bar* baz | |
foo *bar*baz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* Allow for nicer print output *) | |
SetOptions[SelectedNotebook[], | |
PrintingStyleEnvironment -> "Printout", ShowSyntaxStyles -> True] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Scraping non-downloadable books/documents | |
# by downloading them as JPG files | |
# Public Domain. | |
import requests, json, sys | |
# Attention, token changes regularly... You should copy all ~10 minutes from Firebug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Enforce HTTPS | |
if($_SERVER["HTTPS"] != "on") { header("Location: https://" . $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"]); exit(); } | |
?> | |
<!doctype html> | |
<html> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<body style="padding:5%; font-family: sans-serif"> | |
<h1>Some secret</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<meta charset="utf-8"> | |
<title>Genie in a Bottle</title> | |
<meta author="SvenK"> | |
<meta date="31.12.2020"> | |
<?php | |
# First of all, this is supposed only to work for a specific | |
# room. Fix the room id here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os, re, sys | |
from os import path | |
from pathlib import Path | |
from datetime import datetime, timedelta | |
from prompt_toolkit import prompt # bundled with iPython | |
from prompt_toolkit.completion import WordCompleter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
base64 -d <<BASE | gunzip > blank.pdf | |
H4sICAEz+lIAA2JsYW5rLnBkZgCNVE1P20AQpa16WXEk970goCXsh712XCGkxB8RIgiU5ECbcjDO | |
AqHBRs66Cr32RvsTKvXSX1CpVZF6Kn+g6qWnnntHcO9snJCUILWW7PW+ed55b2bk+W0vKLIVE81f | |
fLj4evH54j3imOJk7witrpKajA/UITYAqZOg01UyJUE3VNKTUdKWa2uop1IZHqP+O+O70Vz8/ahJ | |
t+nMx1px8/rt3HJt9np57qx+/u3T3OWX+wVUuNr99Xqz8ONN4co9q809vyzcP58JH87+RDJuD0+C | |
N50cGUMVlnEDmWNhzdMTSXa29o5kpBBpZHtKA0GSHiNSqST9Fi462OQUW9TU6wrDu4hU0yQ7ga8b | |
pJmGce8kTGUcnRK3QTz5shPJerVCNrBKM+1sZL6E7nCOJq0/mIHr3h0exFiwW8Z0RSCMMYnCwSuc | |
MOLZN7xJtDT+OkhihTWrjkaudRFS8KZBrdbvq2pDgUAI+NWGwGIU2U6TqCFVi0CrSVP2FVk/Dg+k |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "The-GIMP-exported-file.h" | |
#include <stdio.h> | |
/* This code converts a GIMP C export back to a readable PNM Image. Such | |
header file looks like | |
static const struct { | |
unsigned int width; | |
unsigned int height; | |
unsigned int bytes_per_pixel; // 2:RGB16, 3:RGB, 4:RGBA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# A python3 script to read an mbox file (extension to Maildir is trivial thanks to | |
# mailbox module) and writes out certain headers as CSV file. | |
# On large mbox files (say 5GB) it is slow because... it's Python. | |
# The script deals with some cornercases (encoding, newlines, ...) which I found in | |
# 100K emails. Otherwise, the builtin python mail libraries provide robustness. | |
# | |
# It processes roughly 110K (5GB mbox) mails in 2:35mins on my laptop and produces | |
# a 19MB CSV file. |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.