Skip to content

Instantly share code, notes, and snippets.

View melmatsuoka's full-sized avatar

Mel Matsuoka melmatsuoka

View GitHub Profile
@melmatsuoka
melmatsuoka / rmdCopy.sh
Last active August 29, 2015 14:07
Takes RED .RMD files from source folder full of RMD files (i.e. flat folder containing nothing but .RMDs), and copies them to their associated .RDC folders located in a different location. This is an annoying workaround to DaVinci Resolve not copying .RMD files along with their associated .R3D files when doing a media consolidation.
#!/bin/bash
#
# takes RMD files from source folder full of RMD files (i.e. flat folder containing nothing but .RMDs),
# and copies them to their associated .RDC folders located in a different location.
RMDFILES="/path/to/rmd_originals"
RDCFOLDER="/path/to/RDC_folder"
FOLDERS=$(ls -l $RDCFOLDER | awk '{print $9}')
for RDC in $FOLDERS
@melmatsuoka
melmatsuoka / qtSplitter.applescript
Last active August 29, 2015 14:07
Losslessly splits an input Quicktime .mov file into 5-minute chunks. -- Requires the "splitmovie" utility, from the QT_Coffee Quicktime utilities package: http://www.3am.pair.com/QTCoffee.html
-- This AppleScript will losslessly split an input Quicktime .mov file into 5-minute chunks.
-- Requires the "splitmovie" utility, from the QT_Coffee Quicktime utilities package: http://www.3am.pair.com/QTCoffee.html
--
-- Usage: Save this script as an Application, and drop the source QT files onto the .app to begin the splitting process.
-- Note: There is currently no visual feedback that the script is processing the file. I'm too lazy to add this at the moment.
property type_list : {"MOV"}
property extension_list : {"mov"}
@melmatsuoka
melmatsuoka / pfGetPathFinderSelection.applescript
Last active August 29, 2015 14:09
Get selected files in active Path Finder window
tell application "Path Finder"
set theSelection to selection
set selectionList to theSelection as list -- list of fsItems (fsFiles and fsFolders)
set LF to character id 10
set AppleScript's text item delimiters to LF
if theSelection is not missing value then
set fileList to {}
repeat with aFile in selectionList
set end of fileList to POSIX path of aFile
end repeat
@melmatsuoka
melmatsuoka / getDroplrReceiptDate.sh
Last active August 29, 2015 14:09
Extract & convert date from Droplr Pro e-mail receipt Subject: line to YYYYMMDD format
echo "Droplr Pro Receipt - 15 Nov 2014" | egrep -o '[0-9]{2} [a-zA-Z]{3} [0-9]{4}' | xargs -I DATESTRING date -jf "%d %b %Y" DATESTRING +"%Y%m%d"
@melmatsuoka
melmatsuoka / pfRotateSelectedLeft.applescript
Last active August 29, 2015 14:09
Path Finder: Rotate selected images in active Path Finder window counterclockwise (change the -r argument to sips command to rotate in different directions)
tell application "Path Finder"
set theSelection to selection
set selectionList to theSelection as list -- list of fsItems (fsFiles and fsFolders)
set LF to character id 10
set AppleScript's text item delimiters to LF
if theSelection is not missing value then
set fileList to {}
repeat with aFile in selectionList
set end of fileList to POSIX path of aFile
end repeat
@melmatsuoka
melmatsuoka / getDropboxLocation.sh
Last active August 29, 2015 14:09
Get the location of your active Dropbox folder (Requires 'jq' to parse the JSON file)
jq -r '.personal.path' < ~/.dropbox/info.json
@melmatsuoka
melmatsuoka / convertDateISOformat.applescript
Created November 17, 2014 02:17
Converts native AppleScript 'current date’ output to YYYYMMMDD format.
on dateISOformat(dateString) set y to text -4 thru -1 of ("0000" & (year of dateString)) set m to text -2 thru -1 of ("00" & ((month of dateString) as integer)) set d to text -2 thru -1 of ("00" & (day of dateString)) return y & m & d end dateISOformat dateISOformat(current date)
@melmatsuoka
melmatsuoka / videoContactSheet.sh
Last active May 3, 2024 03:52
Generates thumbnail contact-sheets of all video files in the current working directory
#!/bin/bash
#
# Generates thumbnail contact sheets of all video files in current working directory.
#
# Script defaults to writing PNG contact sheets to the same folder, using the original
# video filename as the basename for the contact sheet
#
# More details: https://trac.ffmpeg.org/wiki/Create%20a%20thumbnail%20image%20every%20X%20seconds%20of%20the%20video
#
# NOTE: 'montage' requires that Ghostscript be installed, in order to be able to generate titles
@melmatsuoka
melmatsuoka / qt_AddFastStart.sh
Created November 29, 2014 04:28
Batch-add fast-start headers to all QuickTime .mov files in the current working directory.
#/bin/bash
#
# qt_AddFastStart.sh
#
# description: uses QTCoffee (http://www.3am.pair.com/QTCoffee.html) 'modmovie'
# command to add fast-start headers to all .mov files in the current working
# directory
#
# replace spaces in filenames with underscores
@melmatsuoka
melmatsuoka / diceware.sh
Last active August 29, 2015 14:18
Generates a Diceware passphrase, and copies it to the OSX system clipboard, ready for pasting into a password manager. Usage: diceware <wordcount (default: 8)> <delimiter (default:space)>
#!/bin/bash
#
# diceware(): Generate a Diceware passphrase
#
# note: This script has OSX-specific dependencies (pbcopy, pbpaste)
function diceware() {
# arg1: wordcount (default = 8)
# arg2: delimiter (default = space)