- Create a file to store our credentials:
sudo vim /etc/postfix/sasl_passwd
// I dont want my table jumping/animation when appending new rows | |
// for an infinite scroll feel | |
// | |
// Some of this might not be needed but it works | |
// | |
// TODO: Possibly garbage | |
extension UITableView { | |
func reloadDataSmoothly() { | |
UIView.setAnimationsEnabled(false) |
#!/bin/bash | |
set -o pipefail | |
set -e | |
find . -name "*.swiftinterface" -exec sed -i -e 's/Realm\.//g' {} \; | |
find . -name "*.swiftinterface" -exec sed -i -e 's/import Private/import Realm.Private/g' {} \; | |
find . -name "*.swiftinterface" -exec sed -i -e 's/RealmSwift.Configuration/RealmSwift.Realm.Configuration/g' {} \; | |
find . -name "*.swiftinterface" -exec sed -i -e 's/extension Configuration/extension Realm.Configuration/g' {} \; | |
find . -name "*.swiftinterface" -exec sed -i -e 's/RealmSwift.Error/RealmSwift.Realm.Error/g' {} \; | |
find . -name "*.swiftinterface" -exec sed -i -e 's/extension Error/extension Realm.Error/g' {} \; |
sudo vim /etc/postfix/sasl_passwd
kCFURLErrorUnknown = -998, | |
kCFURLErrorCancelled = -999, | |
kCFURLErrorBadURL = -1000, | |
kCFURLErrorTimedOut = -1001, | |
kCFURLErrorUnsupportedURL = -1002, | |
kCFURLErrorCannotFindHost = -1003, | |
kCFURLErrorCannotConnectToHost = -1004, | |
kCFURLErrorNetworkConnectionLost = -1005, | |
kCFURLErrorDNSLookupFailed = -1006, | |
kCFURLErrorHTTPTooManyRedirects = -1007, |
// orogin swift protocol and calling | |
protocol aProtocol { | |
func testFunc() | |
} | |
class aStruct: aProtocol { | |
func testFunc() {} // override defualt implementation | |
} | |
class bStruct: aProtocol { | |
func testFunc() {} // override defualt implementation | |
} |
import Foundation | |
protocol StateType: Hashable {} | |
protocol EventType: Hashable {} | |
struct Transition<S: StateType, E: EventType> { | |
let event: E | |
let fromState: S | |
let toState: S |
- (UIViewController *)topViewController{ | |
return [self topViewController:[UIApplication sharedApplication].keyWindow.rootViewController]; | |
} | |
- (UIViewController *)topViewController:(UIViewController *)rootViewController | |
{ | |
if (rootViewController.presentedViewController == nil) { | |
return rootViewController; | |
} | |
We'll share session notes in QQ group 367375164 2 PM on weekdays.
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |