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:
| - (UIImage *)compressImage:(UIImage *)image{ | |
| float actualHeight = image.size.height; | |
| float actualWidth = image.size.width; | |
| float maxHeight = 600.0; | |
| float maxWidth = 800.0; | |
| float imgRatio = actualWidth/actualHeight; | |
| float maxRatio = maxWidth/maxHeight; | |
| float compressionQuality = 0.5;//50 percent compression | |
| if (actualHeight > maxHeight || actualWidth > maxWidth) { |
| wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1 | |
| # --no-check-cerftificate was necessary for me to have wget not puke about https | |
| curl -LJO https://github.com/joyent/node/tarball/v0.7.1 |
| kCFURLErrorUnknown = -998, | |
| kCFURLErrorCancelled = -999, | |
| kCFURLErrorBadURL = -1000, | |
| kCFURLErrorTimedOut = -1001, | |
| kCFURLErrorUnsupportedURL = -1002, | |
| kCFURLErrorCannotFindHost = -1003, | |
| kCFURLErrorCannotConnectToHost = -1004, | |
| kCFURLErrorNetworkConnectionLost = -1005, | |
| kCFURLErrorDNSLookupFailed = -1006, | |
| kCFURLErrorHTTPTooManyRedirects = -1007, |
Please create an Issue in the transport-apis repo instead. 🙏
| /* bookmarks are stored in “/data/data/org.mozilla.firefox/files/mozilla/…….default/browser.db” */ | |
| SELECT url, created | |
| FROM bookmarks | |
| WHERE COALESCE(url, '') <> '' | |
| ORDER BY created ASC |
| extension UITextView { | |
| // Note: This will trigger a text rendering! | |
| func calculateViewHeightWithCurrentWidth() -> CGFloat { | |
| let textWidth = self.frame.width - | |
| self.textContainerInset.left - | |
| self.textContainerInset.right - | |
| self.textContainer.lineFragmentPadding * 2.0 - | |
| self.contentInset.left - | |
| self.contentInset.right | |
| /// This is a list of Hypertext Transfer Protocol (HTTP) response status codes. | |
| /// It includes codes from IETF internet standards, other IETF RFCs, other specifications, and some additional commonly used codes. | |
| /// The first digit of the status code specifies one of five classes of response; an HTTP client must recognise these five classes at a minimum. | |
| enum HTTPStatusCode: Int, Error { | |
| /// The response class representation of status codes, these get grouped by their first digit. | |
| enum ResponseType { | |
| /// - informational: This class of status code indicates a provisional response, consisting only of the Status-Line and optional headers, and is terminated by an empty line. | |
| case informational |
| // | |
| // GrowingTextView.swift | |
| // https://gist.github.com/Bogidon/cc0c9ae6f041413c39fb0ff146ad1b18 | |
| // | |
| // Created by Bogdan Vitoc on 02/22/2017. | |
| // Distributed under the MIT License: https://gist.github.com/Bogidon/cc0c9ae6f041413c39fb0ff146ad1b18#file-license | |
| // | |
| import UIKit |
| import UIKit | |
| /// An image view that computes its intrinsic height from its width while preserving aspect ratio | |
| /// Source: https://stackoverflow.com/a/48476446 | |
| class ScaledHeightImageView: UIImageView { | |
| // Track the width that the intrinsic size was computed for, | |
| // to invalidate the intrinsic size when needed | |
| private var layoutedWidth: CGFloat = 0 |