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:
| /* | |
| Tested on OS X 10.11 and Ubuntu 15.10 | |
| Exmaple: `$ drawRect 4 3` should output this: | |
| ┌──┐ | |
| │ │ | |
| └──┘ | |
| */ | |
| // MARK: - Data Structures |
| FROM ubuntu:15.10 | |
| # Latest Swift Development Snapshot | |
| ENV SWIFT_BRANCH development | |
| ENV SWIFT_VERSION swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a | |
| ENV SWIFT_PLATFORM ubuntu15.10 | |
| # Install Dependencies | |
| RUN apt-get update && \ | |
| apt-get install -y \ |
| // Trying to build a Rust version here | |
| extern crate rustc_serialize; | |
| use std::io; | |
| use std::env; | |
| use std::path::Path; | |
| use std::fs::File; | |
| use std::io::Read; | |
| use std::vec; |
| import Foundation | |
| import AVFoundation | |
| // AudioPlayer Class Definition | |
| class AudioPlayer: NSObject { | |
| private let runLoop: NSRunLoop = NSRunLoop.currentRunLoop() | |
| private let stdinHandle: NSFileHandle = NSFileHandle.fileHandleWithStandardInput() | |
| private let items: [AVPlayerItem]! | |
| private var queuePlayer: AVQueuePlayer! |
| CVReturn displayLinkOutputCallback( | |
| CVDisplayLinkRef displayLink, | |
| const CVTimeStamp *inNow, | |
| const CVTimeStamp *inOutputTime, | |
| CVOptionFlags flagsIn, | |
| CVOptionFlags *flagsOut, | |
| void *displayLinkContext) | |
| { | |
| @autoreleasepool { |
| class MYAttributedTextView <DTAttributedTextContentView | |
| def layoutFrame | |
| layout_frame = super | |
| rect = layout_frame.frame | |
| rect = UIEdgeInsetsInsetRect(self.bounds, edgeInsets) | |
| new_frame = DTCoreTextLayoutFrame.alloc.initWithFrame(rect, layouter:self.layouter) | |
| new_frame | |
| end | |
| end |