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:
| NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:@"REST URL PATH"]]; | |
| NSData *imageData = UIImageJPEGRepresentation(image, 1.0); | |
| [request setCachePolicy:NSURLRequestReloadIgnoringLocalCacheData]; | |
| [request setHTTPShouldHandleCookies:NO]; | |
| [request setTimeoutInterval:60]; | |
| [request setHTTPMethod:@"POST"]; | |
| NSString *boundary = @"unique-consistent-string"; |
| @implementation UIImage (scale) | |
| /** | |
| * Scales an image to fit within a bounds with a size governed by | |
| * the passed size. Also keeps the aspect ratio. | |
| * | |
| * Switch MIN to MAX for aspect fill instead of fit. | |
| * | |
| * @param newSize the size of the bounds the image must fit within. | |
| * @return a new scaled image. |
Moved to my blog.
| #!/bin/bash | |
| # by Andy Maloney | |
| # http://asmaloney.com/2013/07/howto/packaging-a-mac-os-x-application-using-a-dmg/ | |
| # make sure we are in the correct dir when we double-click a .command file | |
| dir=${0%/*} | |
| if [ -d "$dir" ]; then | |
| cd "$dir" | |
| fi |
| import UIKit | |
| import CoreData | |
| public protocol FetchedResultsDelegate { | |
| func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath, object: AnyObject) -> UITableViewCell | |
| } | |
| public class FetchedResultsDataSource: NSObject, UITableViewDataSource, NSFetchedResultsControllerDelegate { | |
| public weak var tableView: UITableView? |
| import java.util.function.Function; | |
| // https://en.wikipedia.org/wiki/Result_type | |
| public sealed interface Result<LEFT, RIGHT> permits Result.Success, Result.Failure { | |
| // Both functions have a common result supertype | |
| // e.g. `T` can be a `Result<X,Y>` or a resolved type like a `String` / `Request` | |
| <T, L2 extends T, R2 extends T> T either(Function<LEFT, L2> left, Function<RIGHT, R2> right); | |
| default <T> T then(Function<Result<LEFT, RIGHT>, T> function) { |
Instructions on how to install the CMake tool on macOS.
First step should be to unsinstall any previous CMake installation. This step can be skipped if no CMake version was previously installed.
To uninstall any previous CMake installations use the following commands:
| ;; -*- lexical-binding: t; -*- | |
| ;;;; Package Manager Setup (Straight.el) | |
| (defvar bootstrap-version) | |
| (let ((bootstrap-file | |
| (expand-file-name "straight/repos/straight.el/bootstrap.el" | |
| (or (bound-and-true-p straight-base-dir) | |
| user-emacs-directory))) | |
| (bootstrap-version 7)) | |
| (unless (file-exists-p bootstrap-file) |