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:
Here's an example of how to embed a Gist on GitHub Pages:
{% gist 5555251 %}
All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.
| 301 https://github.com/zxdrive/imouto.host |
| import Foundation | |
| var token: dispatch_once_t = 0 | |
| func test() { | |
| dispatch_once(&token) { | |
| println("This is printed only on the first call to test()") | |
| } | |
| println("This is printed for each call to test()") | |
| } |
| #!/usr/bin/env python3 | |
| """Simple HTTP Server With Upload. | |
| This module builds on BaseHTTPServer by implementing the standard GET | |
| and HEAD requests in a fairly straightforward manner. | |
| see: https://gist.github.com/UniIsland/3346170 | |
| """ | |
I've moved this gist to https://github.com/phynet/iOS-Schemes please check it there ;)
| // Objective-C | |
| UIImage *image = [UIImage imageNamed:<#(NSString *)#>]; | |
| NSData *imageData = UIImagePNGRepresentation(image); | |
| NSInteger len = imageData.length; | |
| Byte *bytes = (Byte *)[imageData bytes]; | |
| NSMutableString *result = [NSMutableString stringWithCapacity:len * 5]; | |
| [result appendString:@"{"]; | |
| for (NSUInteger i = 0; i < len; i++) { | |
| if (i) { | |
| [result appendString:@","]; |
| // swift | |
| var image = xxx | |
| var rect = NSRect(x: 0, y: 0, width: image.size.width, height: image.size.height) | |
| let cgImage = image.CGImageForProposedRect(&rect, context: nil, hints: nil)!.takeUnretainedValue() | |
| let bitmapRep = NSBitmapImageRep(CGImage: cgImage) | |
| if let imageData = bitmapRep.representationUsingType(NSBitmapImageFileType.NSPNGFileType, properties: [:]) { | |
| let len = imageData.length | |
| var bytes = [UInt8](count: len, repeatedValue: 0) |