This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
| // requestAnimationFrame implementation as a custom function to allow blacklisting | |
| // devices with broken implementation. Currently needs timer-based fallbacks for iOS 6.x for | |
| // code running inside <iframe> elements. | |
| // Uses polyfills based on http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| (function() { | |
| var blacklisted = /iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent), | |
| lastTime = 0, | |
| nativeRequest = window.requestAnimationFrame || null, | |
| nativeCancel = window.cancelAnimationFrame || null; |
| # MAC manipulators | |
| alias random_mac='sudo ifconfig en0 ether `openssl rand -hex 6 | sed "s/\(..\)/\1:/g; s/.$//"`' | |
| alias restore_mac='sudo ifconfig en0 ether YOUR_ORIGINAL_MAC_ADDRESS_GOES_HERE' |
| gifify() { | |
| if [[ -n "$1" ]]; then | |
| if [[ $2 == '--good' ]]; then | |
| ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
| time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
| rm out-static*.png | |
| else | |
| ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
| fi | |
| else |
| var evts = [], | |
| touchEvt, | |
| mouseEvt, | |
| msEvent; | |
| if (evt === 'up') { | |
| touchEvt = 'touchend'; | |
| mouseEvt = 'mouseup'; | |
| msEvent = 'MSPointerUp'; | |
| } else if (evt === 'move') { |
| function rightNow() { | |
| if (window['performance'] && window['performance']['now']) { | |
| return window['performance']['now'](); | |
| } else { | |
| return +(new Date()); | |
| } | |
| } |
| require './config/environment' | |
| require 'capybara/dsl' | |
| require 'terminus' | |
| Capybara.app = Blarg::Application | |
| Capybara.current_driver = :terminus | |
| Terminus.start_phantomjs |
| package main | |
| import ( | |
| "database/sql" | |
| "errors" | |
| "fmt" | |
| _ "github.com/bmizerany/pq" | |
| "os" | |
| "regexp" | |
| "strings" |
| require 'rubygems' | |
| require 'plist' | |
| class ITunes | |
| attr_reader :library, :parse_time | |
| def initialize (path=nil) | |
| @path = path.nil? \ | |
| ? (Dir::home + '/Music/iTunes/iTunes Music Library.xml') \ | |
| : path |