Skip to content

Instantly share code, notes, and snippets.

View Dreyer's full-sized avatar

Matthew Dreyer Dreyer

View GitHub Profile
@Dreyer
Dreyer / mkv_fixer.sh
Last active January 5, 2017 17:49
Batch edit the properties of Matroska files.
#!/bin/bash
#
# Iterate through every .MKV file in the current directory and use the
# filename base as the title while assigning the second subtitle track
# as the default and the second audio track as the default.
#
# Requires mkvpropedit from MKVToolNix:
# https://github.com/mbunkus/mkvtoolnix
#
for file in *.mkv; do base=${file%.*}; mkvpropedit "${file}" --edit info --set "title=${base}" --edit track:s1 --set flag-default=0 --edit track:s2 --set flag-default=1 --edit track:a1 --set flag-default=0 --edit track:a2 --set flag-default=1; done
@Dreyer
Dreyer / AI_MultiPagePDFLoader.jsx
Created October 27, 2016 18:38
Import multi-page documents as artboards in Adobe Illustrator CS6.
// source: http://graphicdesign.stackexchange.com/a/46923
// forked from animalia, translated to English by arnaudin
var w = new Window("dialog { text: 'PDF Loader', frameLocation:[400, 200], alignChildren:['fill', 'top'], filePnl: Panel { text: 'PDF file', orientation:'row', alignChildren:['left', 'center'], loadBtn: Button { text:'Select file...', helpTip :'Browse for a file, or paste the file path into the text box to the right.'}, et: EditText { text:'' , preferredSize: [220, 20]}, }, rangePnl: Panel { text: 'Pages', orientation:'column', alignChildren:['fill', 'top'], range: Group {allRb: RadioButton { text:'All pages', value:true, helpTip: 'Import all pages in the PDF file.'}, rangeRb: RadioButton { text:'Page range:', helpTip: 'Select a range of pages to import. For example: 1-5 or 1, 2, 3 or 1, 2-4, 5, 7-8.'} et: EditText { text: '', characters:25, properties:{multiline:true} }}, caGrp: Group{artboardsCb: Checkbox { text:'Create Artboards', preferredSize: [84, 20], helpTip: 'Create Artboards in Illust