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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
Filter out unwanted tags passed on the command line. | |
https://stackoverflow.com/a/2641719/209184 | |
Usage: xslt3 -xsl:filter.xsl -s:share/instruments/instruments.xml filter="Channel|drumset|genre" | |
--> |
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
<?php | |
/** | |
* Retrieve session entry for given cookie. | |
* https://drupal.stackexchange.com/a/231726/767 | |
* | |
* Usage: drush scr scripts/export_sessions.php -- --cookie=<URL-decoded value of SESSxxxx cookie> | |
* | |
* [ | |
* { |
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
<?php | |
// Uses my fork of PhpSpreadsheet to add custom functions | |
// https://github.com/infojunkie/PhpSpreadsheet | |
// | |
// Usage: | |
// - Place spreadsheet "10-1. Quizzes - Algo Check - Shared.xlsx" in sheets/ subfolder | |
// - Run `php abilities.php` | |
// - Observe output: | |
/** |
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
#! /bin/bash | |
# | |
# Requirements: curl, jq, metaflac | |
# | |
# Assumes that the files are already sorted by track number. | |
# | |
curl -s https://api.discogs.com/releases/$1 --user-agent "discogs-tag/1.0" | jq -r '.tracklist[].artists | map(.name) | join(", ") | gsub(" \\(\\d+\\)"; "")' > artists | |
IFS=$'\n' artists=($(<artists)) i=0; for f in *.flac; do metaflac "$f" --remove-tag=ARTIST --set-tag="ARTIST=${artists[$i]}"; ((i=i+1)); done |
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
/** | |
* Fetch wrapper to throw an error if the response is not ok. | |
* Why indeed? https://github.com/whatwg/fetch/issues/18 | |
*/ | |
export async function fetish(input: RequestInfo | URL, init?: RequestInit | undefined): Promise<Response> { | |
const response = await fetch(input, init); | |
if (!response.ok) throw new Error(response.statusText); | |
return response; | |
} |
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 php | |
<?php | |
/** | |
* Convert ffprobe chapters to cuesheet. | |
* | |
* This is typically used in a video-to-audio transcoding job: | |
* | |
* - ffprobe -show_chapters -print_format json -loglevel -8 video.file > chapters.json | |
* - ffmpeg -i video.file audio.file |
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
alias git-update='find . -mindepth 1 -maxdepth 3 -type d -name ".git" -print -exec git -C {}/.. pull --recurse-submodule \; -exec git -C {}/.. remote prune origin \;' |
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
#! /bin/bash | |
set -e | |
die () { | |
echo >&2 "$@" | |
exit 1 | |
} | |
[ "$#" -eq 2 ] || die "Usage: $(basename -- "$0") /path/to/original.tar.gz /path/to/modified.tar.gz" | |
[ -f "$1" ] || die "File $1 does not exist" | |
[ -f "$2" ] || die "File $2 does not exist" |
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
#!/bin/bash | |
find "$@" -name '*.pdf' | while read f; do pdftotext "$f" - | wc -w; done | paste -sd+ | bc |
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
service: labyrinth-service | |
provider: | |
name: aws | |
iamManagedPolicies: | |
- "arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole" | |
iamRoleStatements: | |
- Effect: Allow | |
Action: | |
- lambda:InvokeFunction |
NewerOlder