Skip to content

Instantly share code, notes, and snippets.

@hungerburg
hungerburg / DIN2grades.py
Created February 17, 2023 11:38
Walking speed modifiers depending on incline
#!/usr/bin/env python3
# make a table of speed modifiers depending on slope
# based on the DIN 33466 formula
# output reverse value, for use in a router costing function
# estimates are quite high, an interesting tweak would be setting
# ascent=400 and descent=600 thereby adapting to fitter persons
@hungerburg
hungerburg / twt.php
Last active July 23, 2022 14:07
Analyse TrackWorkTime Report
<?php
/*
* The fine app https://github.com/mathisdt/trackworktime can save reports to CSV.
* Below script transforms the raw all data export for printing from a spreadsheet e.g.
*/
// Wrap library call
function my_getcsv($line) {
return str_getcsv($line, ';');
@hungerburg
hungerburg / GnuCash.md
Last active February 10, 2020 21:00
GnuCash bulk operations

Gnu Cash Bulk Operations

This can be used from the sqlite backend.

List placeholder accounts with transactions in them

SELECT accounts.name AS Ledger, transactions.description AS Record,
	CAST(splits.value_num AS FLOAT)/splits.value_denom AS Amount
FROM accounts

Random Musings

Drupal access daily top hits statistics in SQL

SELECT node_field_data.title AS Title,
      node_field_data.type AS Type,
      node_counter.daycount AS Today,
      node_counter.totalcount AS Alltime,
 DATE_FORMAT(FROM_UNIXTIME(node_counter.timestamp), '%y-%m-%d %T') AS Latest,
@hungerburg
hungerburg / qdriver.pl
Created December 13, 2019 12:57
Quorion Registrierkasse fernsteuern
#!/usr/bin/perl
# Quorion Registrierkasse fernsteuern
# - Berichte holen
# - Uhr stellen
# und vielleicht auch anderes
#
# Braucht ein POSIX System
# Konfiguration wie Windows QDriver
@hungerburg
hungerburg / solrmail.html
Last active December 20, 2021 02:56
Quick'n'Dirty Intranet Mail Search with Dovecot and SOLR
<!DOCTYPE html>
<!--
# Quick'n'Dirty Intranet Mail Search
1) Have dovecot index mails in SOLR
2) Configure the doveadm HTTP API
3) Create proxies for SOLR and DOVEADM
4) Search and find!