This file contains hidden or 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 node | |
import fs from 'fs'; | |
/** | |
* Copy GitHub ProjectV2 items and custom fields from one project to another, dump or load them from a file. | |
* | |
* The project configuration isn't modified and fields are mapped by *exact* name. | |
* | |
* Usage: |
This file contains hidden or 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
/** Convert HTML to Markdown in a single pass. | |
* | |
* @param html The HTML document as a string. | |
* @param headingOffset The heading level offset (0-6). | |
* @return {string} The converted Markdown document. | |
*/ | |
function htmlToMarkdown(html, headingOffset = 0) { | |
const isSpace = c => c === ' ' || c === '\n' || c === '\r' || c === '\t' || c === '\f' | |
const STATE_TEXT_UNINDENT = 0 |
This file contains hidden or 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
// Prepare a CSV file with Google Drive file information for analysis of externally accessible files | |
// | |
// Requires Node.js 22 or later | |
// | |
// USAGE: | |
// gam all users print filelist allfields formatjson | node analyze-drive-files.mjs 'EMAIL_DOMAIN_1|EMAIL_DOMAIN_n' > external-drivefiles.csv | |
// | |
// EMAIL_DOMAIN are own domain names of the organization (e.g. example.com), with matching records filtered out. | |
// | |
// The CSV file can then be uploaded to Google Drive. |
This file contains hidden or 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
/** Script to clear all messages from the Personio UI's inbox | |
* | |
* USAGE: | |
* 1. Open Personio Inbox | |
* 2. (optionally) Select filters (to only clear certain messages) | |
* 3. Open the browser's console (F12) | |
* 4. Paste this script and run it | |
*/ | |
let count = 0; | |
let lastClickMillies = 0 |
This file contains hidden or 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
/** | |
* From https://github.com/MattMorgis/async-stream-generator | |
*/ | |
async function* nodeStreamToIterator(stream) { | |
for await (const chunk of stream) { | |
yield chunk; | |
} | |
} | |
/** |
This file contains hidden or 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 | |
""" | |
main.py: Convert PlantUML diagram source code to Mermaid source. | |
Based on this StackOverflow answer: https://stackoverflow.com/a/76625003 | |
""" | |
import sys | |
import re |
This file contains hidden or 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 | |
# | |
# Instant alarming script for monitoring current CPM/CPS value in GeigerLog DB | |
# author: Jonas Zeiger <jonas.zeiger@talpidae.net> | |
# | |
# The variables ALARM_CPM and ALARM_CPS are going to be set in the shell executing ACTION_COMMAND. | |
# | |
# Examples: | |
# | |
# $ ./alarm.py data/gmc300e.logdb 4 50 /bin/bash -c 'echo $ALARM_CPS $ALARM_CPM' |
This file contains hidden or 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
# btrfs fi usage / | |
Overall: | |
Device size: 953.88GiB | |
Device allocated: 436.08GiB | |
Device unallocated: 517.80GiB | |
Device missing: 0.00B | |
Used: 250.72GiB | |
Free (estimated): 345.39GiB (min: 345.39GiB) | |
Free (statfs, df): 345.39GiB |
This file contains hidden or 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
function dunzip() | |
{ | |
path="$(dirname "$1")" | |
if [ -n "$path" ] && [[ "$path" != */ ]] | |
then | |
path="$path/" | |
fi | |
new_name="$(basename -s ".gz" "$1")" | |
gunzip -d -c "$1" | gunzip -d -c > "$new_name" |
This file contains hidden or 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
'use strict'; | |
/* Implement basic wrappers around crypto.subtle API. | |
* see: https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API | |
*/ | |
const getDigest = () => | |
{ | |
if (crypto) | |
{ |
NewerOlder