Skip to content

Instantly share code, notes, and snippets.

View willsthompson's full-sized avatar

Will Thompson willsthompson

View GitHub Profile
from os import listdir
from os.path import join, isfile
from shlex import quote
import argparse
import subprocess
SH_BREAK = ' \\\n\t'
parser = argparse.ArgumentParser(description='Merge/chapterize discrete MKV files')
parser.add_argument('source_path')
@willsthompson
willsthompson / sacd_ripping_guide.md
Last active April 27, 2024 21:55
SACD Ripping Guide
@willsthompson
willsthompson / multichannel_audio_scripts.md
Last active January 3, 2021 20:25
Scripts for processing multichannel audio for playback on Apple TV

Multichannel audio-processing scripts for Apple TV

Prerequisites

Apple TV

  1. Infuse can play back FLAC and ALAC-encoded multichannel audio wrapped in an MKV container.
  2. VLC might play multichannel FLAC without a container. But that stopped working for me when I changed my audio setup to use ARC, so YMMV.
@willsthompson
willsthompson / xslt2-to-xslt1.xsl
Created March 22, 2017 19:12
Transform XSLT 2 stylesheet into XSLT 1 stylesheet. Only supports a couple XSLT 2 features, partially.
<?xml version="1.0" encoding="UTF-8"?>
<!-- TODO
- Tunnel params
- distinct-values()
- tokenize()
- group-by
- handle namespaced modes and param names
- Handle space delimited list of template modes?
-->
<xsl:stylesheet version="2.0"
@willsthompson
willsthompson / delete-orphaned-permissions.xqy
Created December 9, 2016 20:20
Checks documents and deletes any permissions to missing roles
xquery version "1.0-ml";
let $uris := cts:uris((), 'limit=30000')
let $permissions-map := map:new((
$uris ! map:entry(., xdmp:document-get-permissions(.))
))
let $orphaned-map :=
xdmp:eval('
xquery version "1.0-ml";
import module namespace sec="http://marklogic.com/xdmp/security" at
#
# OSX: Flush all the gunk out of your routing tables and DNS.
#
networksetup -setairportpower airport off;
for i in {1..10}
do
dscacheutil -flushcache;
killall -HUP mDNSResponder;