Skip to content

Instantly share code, notes, and snippets.

View milothiesen's full-sized avatar
💓

Milo Thiesen milothiesen

💓
View GitHub Profile
@milothiesen
milothiesen / BnUf-1.rb
Created February 16, 2016 21:27 — forked from anonymous/BnUf-1.rb
https://repl.it/BnUf/1 created by anonymous
names = ["Jill Bauerle", "Iris Lee", "Gregory Raml", "Maile Thiesen", "Jane Levenson", "Rebecca Morgan"]
sorted_names = names.sort_by{ |name| name.split(" ").reverse.join.upcase }
puts sorted_names
@milothiesen
milothiesen / export.sh
Created February 22, 2016 04:36 — forked from jeffrafter/export.sh
Exporting XML from Final Cut Pro using Apple Script
#!/bin/sh
# 'Enable access for assistive devices' must be selected in Universal Access preferences.
osascript -e "
try
tell application \"Final Cut Pro\" to activate
delay 0.5
tell application \"System Events\"
#Place this file in the root of the directories you'd like to change.
#It will look for all directories with underscores and replace them with a space.
Dir["*"].each do|f|
if File.directory?(f)
File.rename f, f.gsub(/_/, ' ')
end
end
@milothiesen
milothiesen / FCP7_XML_parser.rb
Created March 1, 2016 03:18
Final Cut Pro 7/ Premiere Pro CC XML Parser that allows you to automate media reconnecting/ relinking and removes Color Corrector 3-Way. Code can be modified to remove any individual video filter without effecting other video filters.
#CODE COMPILED BY MAILE THIESEN#
# vvv-----CODE AND IDEAS USED FROM THE FOLLOWING SOURCES-----vvv
# http://stackoverflow.com/questions/13825725/how-to-delete-an-xml-element-according-to-value-of-one-of-its-children
# Code derived from http://stackoverflow.com/questions/2096679/editing-text-in-a-nokogiri-element-or-using-regex
# http://stackoverflow.com/questions/1122115/how-to-parse-xml-files-with-nokogiri-and-put-the-results-in-a-new-file
# http://www.kenstone.net/fcp_homepage/xml_fcp_hodgetts.html
# PLACE THIS FILE IN THE DIRECTORY WHERE THE XML FILES EXIST. IT LOOKS FOR ALL FILES WITH THE .xml
# EXTENSION AND DOES TWO THINGS
# 1. IT CHANGES ALL PATHURLS, SO YOU CAN AUTOMATICALLY UPDATE THE PATHS FOR WHEN YOU MOVE MEDIA FROM ONE LOCATION TO ANOTHER.
@milothiesen
milothiesen / total_prores_size.rb
Last active June 29, 2016 15:41
A script to find the total size of all prores files in a given directory.
#developed by Sam Heinith and Maile Thiesen
#!/usr/bin/ruby
# in terminal, the path to check must be in quotes! EX. (mailethiesen$ ruby total_pro_res_size.rb "/Volumes/Drobo\ \#7\ 2014/AMNH\ Video/2014/2014-01-07\ Pterosaurs ")
library_path = ARGV[0]
files_list = %x[find #{library_path} -name "*.mov"].split("\n")
total_prores_size = 0
total_other_size = 0
class Card
attr_accessor :rank, :suit
def initialize(rank, suit)
@rank = rank
@suit = suit
end
def output_card
puts "#{self.rank} of #{self.suit}"
#developed by Maile Thiesen
#dependencies are homebrew and mediainfo, use brew install mediainfo.
#!/usr/bin/ruby
library_path = ARGV[0]
files_list = %x[find #{library_path} -name "*.mov"].split("\n")
files_list.each do |filename|
#enter the duration you want to match to here--vvv#
#developed by Maile Thiesen
#!/usr/bin/ruby
#help from http://stackoverflow.com/users/256970/cary-swoveland
#http://stackoverflow.com/questions/37571258/ruby-how-to-copy-files-to-a-specific-directory-if-the-file-does-not-exist/37681206#37681206
require 'FileUtils'
library_path_1 = ARGV[0]
library_path_2 = ARGV[1]
library_path_3 = ARGV[2]
# Define the unique method that removes duplicates
#!/usr/bin/ruby
require 'digest/md5'
library_path = ARGV[0]
hash = {}
Dir.glob(library_path + "/**/*", File::FNM_DOTMATCH).each do |filename|
#!/usr/bin/env ruby
#from http://www.psteiner.com/2007/06/ruby-script-find-duplicate-files.html
require 'find'
library_path = ARGV[0]
dir = Dir.glob(library_path + "/**/*").select{ |x| File.file? x }
files = {}