This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Promise<T> { | |
typealias Fulfiller = (T) -> (Void) | |
typealias Rejecter = (Void) -> (Void) | |
typealias Resolver = (_ fulfill: @escaping Fulfiller, _ reject: @escaping Rejecter) -> (Void) | |
let resolver: Resolver | |
init(_ resolver: @escaping Resolver){ | |
self.resolver = resolver | |
} | |
func then<U>(_ execute: @escaping ((T) -> U)) -> Promise<U> { | |
return Promise<U>({(fulfill, reject) in |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# | |
# Mac fix 1 - Install the Nokogiri gem on Mac OS 10.9 Mavericks | |
# | |
# Usage: to configure and install using Bundler, pass in 'bundle' as an argument to the script. | |
# | |
# Nokogiri works at a very low level, so it has many issues on various platforms. | |
# As a result, the command `install gem nokogiri` often will fail. This fix is for | |
# errors involving 'libiconv', such as the following one I encountered: | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)goButtonPressed:(id)sender | |
{ | |
CALayer *layer = self.theRedSquare.layer; | |
CATransform3D initialTransform = self.theRedSquare.layer.transform; | |
initialTransform.m34 = 1.0 / -1000; | |
layer.transform = initialTransform; | |
layer.anchorPoint = CGPointMake(0.0, 0.5); | |
[UIView beginAnimations:@"com.jon.Scale" context:nil]; | |
[UIView setAnimationDuration:1]; |