This file contains 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
license: gpl-3.0 | |
height: 300 |
This file contains 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
"scripts": { | |
"test": "mocha --grep /${TEST:-'.*'}/i", | |
}, |
This file contains 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 |
This file contains 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 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 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 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 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 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 |
OlderNewer