Skip to content

Instantly share code, notes, and snippets.

View miko007's full-sized avatar

Michael Ochmann miko007

View GitHub Profile
@miko007
miko007 / cleanup.php
Created April 6, 2022 09:43
A cleanup script to remove orphaned pads from an Etherpad Lite installation
#!/usr/bin/env php
<?php declare(strict_types=1);
function msg(string $message) : void {
echo "$message\n";
}
function error(string $message, int $code = 1) : void {
msg("[ERROR] $message");
exit($code);
@miko007
miko007 / unsplash.php
Created October 23, 2024 12:36
Unsplash Random Photo replacement
<?php declare(strict_types=1);
###############################################################################
# #
# Maschinendeck Unsplash wrapper #
# #
###############################################################################
/**
* This script provides a replacement for the old
* `https://source.unsplash.com/random` endpoint, which is no longer available
@miko007
miko007 / CurrencyScale.js
Last active January 17, 2025 22:43
This is a simple "currency scale" to register with Charts.js
class CurrencyScale extends Chart.LinearScale {
static id = "currency";
static defaults = {
currency : "USD",
locale : "en-US"
};
getLabelForValue(value) {
return this.formatCurrency(value);
}