Short animated GIFs suitable for posting on Twitter are simple and free to create on OS X. I use the free OS X App Screen Record Pro-Lite to capture a QuickTime (MOV) format video of a screen region and then convert the MOV to GIF online at http://www.online-convert.com/. To produce an MP4 video instead, I could convert the MOV online or using iMovie.
I haven't been able to post animated GIF files to Twitter via their web interface, but the (also free) official Twitter app for OS X allows posting them by dragging the GIF into a new tweet window.
Morgan McGuire is a professor of Computer Science at Williams College and a professional game developer. He is the author of The Graphics Codex, an essential reference for computer graphics that runs on iPhone, iPad, and iPod Touch.
I'm Morgan McGuire (