Whatever it is that you choose to do, follow these two simple rules:
- Be friendly.
- Have fun.
#!/usr/bin/env ruby | |
# dependencies: | |
# - ffmpeg (`brew install ffmpeg`) | |
puts "Usage: plopp DIR" and exit unless dir = ARGV[0] | |
Dir["#{dir}/*.mov"].each do |input| | |
output = File.basename(input, '.mov') | |
system "ffmpeg -i '#{input}' -map 0:0 -vn -acodec copy #{output}-1.m4a -map 0:1 -vn -acodec copy #{output}-2.m4a" |
# poor mans debugger | |
# | |
# if you want to know whats the value of an object just add .why? | |
# and you will see what it is and why your program behaves like it does. | |
# | |
Object.class_eval {def why?; raise "Because it is #{inspect}" ; end} |
require 'net/http' | |
require 'uri' | |
# /api/v1/:format/new | |
# /api/v1/:format/gists/:user | |
# /api/v1/:format/:gist_id | |
res = Net::HTTP.post_form(URI.parse('http://gist.github.com/api/v1/xml/new'), | |
{ 'files[file1.ab]' => 'CONTNETS', | |
'files[file2.ab]' => 'contents' }) |