- Start with annotations here
@Entity
@Override
void mySuperMethod() { ... }
Here's my guide for getting started using Python with virtualenv and pip
- Navigate to directory
virtualenv env
source env/bin/activate
To end:
Here is a great article on UIStackView
The Promise Spec
Another great starting point
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
guard let googleURL = URL(string: "https://www.google.com") else { | |
fatalError("What went wrong?") | |
} | |
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { (_) in | |
let task = URLSession.shared.dataTask(with: googleURL) { (data, response, error) in | |
if error != nil { | |
// handle error | |
print(error.debugDescription); | |
} else { |
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
do { | |
try ErrorGenerator.generateAlertControllerError() | |
} catch let showError as ExampleAlertControllerError where showError == .show { | |
show(alertControllerError: showError) | |
} catch { | |
fatalError(error.localizedDescription) | |
} |
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
// http://stackoverflow.com/questions/26542035/create-uiimage-with-solid-color-in-swift | |
public extension UIImage { | |
public convenience init?(color: UIColor, size: CGSize = CGSize(width: 1, height: 1)) { | |
let rect = CGRect(origin: .zero, size: size) | |
UIGraphicsBeginImageContextWithOptions(rect.size, false, 0.0) | |
color.setFill() | |
UIRectFill(rect) | |
let image = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
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
import Foundation | |
class Foo: NSObject { | |
dynamic var bar: Int = 0 | |
private let bazKeyPath = #keyPath(Foo.baz) | |
private var _baz: Int = 0 { | |
set { | |
willChangeValue(forKey: bazKeyPath) | |
self._baz = newValue |
PubNub is real time, with less than 250 milliseconds latency anywhere in the world. However, even though PubNub is low latency, a device's actual physical connection to the Internet could be extremely high latency, with 50% packet loss or more. In these cases, there are a set of best practices to adopt to help mitigate user issues.
In this case, we initialize the client instance with a shorter subscribe timeout so that if a