ffmpeg is fantastic. I'm an iOS dev and when I put something on Github, I first record the iOS simulator with QuickTime. Then I convert the resulting .mov file with ffmpeg:
ffmpeg -i example.mov -r 15 example.gif
Voilà, an animated gif. Quality is atrocious but it gets the message across, plus the filesize is not too big.