Skip to content

Instantly share code, notes, and snippets.

View mjepronk's full-sized avatar

Matthias Pronk mjepronk

View GitHub Profile
@mjepronk
mjepronk / kanna.txt
Created July 25, 2023 17:28
Kanna (japanese planes)
Kanna 鉋 (plane)
----------------
Hira-Kanna 平鉋 (common/flat plane)
Naga-Dai-Kanna 長台鉋 (jack plane)
Tachi-Ba-Kanna 立鉋 (standing plane)
Sori-Dai-Kanna 反り台鉋 (compass plane)
Kiwa-Kanna 際鉋 (corner cutting plane)
Wakitori-Kanna 脇取り鉋 (side-shaving plane)
Hifukura-Kanna 比不倉鉋 (pointed side-shaving plane)
@mjepronk
mjepronk / suspend-system.py
Created November 20, 2022 14:19
Save energy by suspending your Linux machine during off-hours.
#!/usr/bin/env python
"""
Suspend the system from cron on a specified time, and wake-up the
system at another specified time. This script allows the user to
interrupt the shutdown by showing a GTK dialog.
COPYRIGHT AND LICENSE
=====================
@mjepronk
mjepronk / form.js
Last active November 12, 2022 23:09
Serialize an HTML form to JSON
var form = document.querySelector('form');
form.addEventListener('submit', function(event) {
event.preventDefault();
submitForm();
}
function submitForm(form) {
var data = serializeForm(form);
var json = JSON.stringify(data);
var xhr = requestPost(url, json);
@mjepronk
mjepronk / index.html
Created January 6, 2022 12:38
Leaflet met BRT-Achtergrond kaart via PDOK
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#map { height: 500px; }
@mjepronk
mjepronk / copydb.py
Created April 7, 2020 15:15
Dump PostgreSQL database to a file, import a database from a file, or copy from one database to another one.
#!/usr/bin/env python3
import os
import sys
import shutil
import argparse
import getpass
import datetime
import subprocess
PSQL_BIN = "/usr/bin/psql"
{-
Use like this:
runResourceT $ S.print $ (parsed myparser (decodeByteString decodeUtf8Pure (Q.readFile "my-utf8-encoded.txt")))
-}
module Data.Attoparsec.Text.Streaming
( parsed
, decodeByteString