This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "bundler/setup" | |
require "ffmpeg" #=> https://github.com/brettbuddin/ffmpeg | |
include FFMpeg | |
Presets.define(:mp4_240x180_400k_aac, "mp4") do | |
resolution "240x180" | |
audio_codec "libfaac" | |
video_bitrate "400k" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "ffmpeg" | |
include FFMpeg | |
PRESETS = { | |
:mp4_240x180_400k_aac => { | |
:block => lambda { | |
resolution "240x180" | |
audio_codec "libfaac" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Started POST "/jobs.xml?type=dynamic¬ify_email=brett%40intraspirit.net&sid=9e7425eb91585a8ded7f18933ff27534f87235a741674621a28a18b9a084fb88&inputs[magnitude]=50.0&inputs[source]=http%3A%2F%2Fs3.amazonaws.com%2Fhowdydudeyouareawesome%2Fvideos%2Fuploads%2F146%2Foriginal.mov%3F1302815574&destination=http%3A%2F%2FREDACTED%3A%2FREDACTED%40howdydudeyouareawesome.s3.amazonaws.com%2Fdownloads%2F%3Auuid" for REDACTED 2 at 2011-04-14 21:13:06 +0000 | |
Processing by JobsController#create as XML | |
Parameters: {"type"=>"dynamic", "notify_email"=>"[email protected]", "sid"=>"9e7425eb91585a8ded7f18933ff27534f87235a741674621a28a18b9a084fb88", "inputs"=>{"magnitude"=>"50.0", "source"=>"http://s3.amazonaws.com/howdydudeyouareawesome/videos/uploads/146/original.mov?1302815574"}, "destination"=>"http://REDACTED:[email protected]/downloads/:uuid"} | |
Completed 201 Created in 869ms (Views: 4.1ms | ActiveRecord: 9.5ms) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'curb' | |
require 'cgi' | |
def youtube_url(video_id) | |
c = Curl::Easy.new("http://www.youtube.com/watch?v=#{video_id}") | |
c.cookies = 'PREF: f2=40000000;' | |
c.perform | |
content = c.body_str | |
matches = content.match(/"fmt_url_map":\s"([^"]*)"/) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Starts an HTTP server in the current directory" | |
task :server do | |
config = {:Port => 3000, :DocumentRoot => '.'} | |
server = WEBrick::HTTPServer.new config | |
['INT', 'TERM'].each do |signal| | |
trap(signal) { server.shutdown } | |
end | |
server.start | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Switch() | |
if expand('%:e') == 'h' | |
try | find %:t:r.m | |
catch | |
try | find %:t:r.c | |
catch | |
try | find %:t:r.cc | |
catch | |
try | find %:t:r.cpp | catch | endtry | |
endtry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! DockSend() | |
let filePath = expand("%:p") | |
let appleScript = "-e \"on run argv\r | |
\ignoring application responses\r | |
\tell app \\\"Transmit\\\" to open POSIX file item 1 of argv\r | |
\end ignoring\r | |
\end run\"" | |
silent exec "!osascript " . appleScript . " \"". filePath . "\"" | |
echo filePath." sent to Transmit." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: bash < <(curl -s https://gist.github.com/raw/965142/install.sh) | |
if [ ! -d "/Developer/Applications/Xcode.app" ]; then | |
echo "Please install Xcode first. Exiting." | |
exit 1 | |
fi | |
# Have sudo ask us for our password before we kick everything off so we can walk away. | |
sudo echo "Here we go..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<virb load="title" /> | |
<virb load="meta" /> | |
<virb load="css" /> | |
<virb load="icon" /> | |
<!--[if lt IE 8]> | |
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script> | |
<![endif]--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ git checkout topic | |
$ git cherry master | |
- 31e27cc5bf02c7b145340a13c9874f729e5bec01 | |
+ 9cf4af52e76adec45a5d63317bce344609406e89 |