Convert a quicktime movie to animated gif with ImageMagick on OS X

First install Imagemagick with Homebrew with

brew install imagemagick

Then:

$> mkdir frames
$> ffmpeg -i movie.mov -r 30 frames/$image%03d.jpg
$> convert frames/*.jpg anim.gif