Worth a read for some more context.
Create the file in the root of the project (where your Package.swift
file lives as well), and use the following contents:
/// Package.xcconfig
1. Install oh my zsh | |
http://ohmyz.sh/ | |
$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
1. Install powerline fonts | |
https://github.com/powerline/fonts | |
1. download agnoster theme | |
https://github.com/mbadolato/iTerm2-Color-Schemes/zipball/master |
Worth a read for some more context.
Create the file in the root of the project (where your Package.swift
file lives as well), and use the following contents:
/// Package.xcconfig
Thank you everybody, Your comments makes it better
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
import UIKit | |
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
@IBOutlet weak var tableView: UITableView! | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
NSLayoutConstraint.activate([ | |
tableView.topAnchor.constraint(equalTo: view.topAnchor), |
# Commit with scope / message shortcuts | |
# Remember to quote $2 if it contains spaces | |
# | |
# Usage: | |
# git <alias> <scope> "<Commit Message>" | |
# | |
# Example: | |
# git chore docs "Update README.md" | |
chore = "!f() { git commit -m \"chore($1): $2\"; }; f" | |
fix = "!f() { git commit -m \"fix($1): $2\"; }; f" |
// Swift 3 | |
extension DateFormatter { | |
public static var iso8601: DateFormatter { | |
return DateFormatter.iso8601DateFormatter | |
} | |
private static let iso8601DateFormatter: DateFormatter = { | |
let formatter = DateFormatter() | |
formatter.locale = Locale(identifier: "en_US_POSIX") |
^3[47][0-9]{13}$
^(6541|6556)[0-9]{12}$
^389[0-9]{11}$
^3(?:0[0-5]|[68][0-9])[0-9]{11}$
^65[4-9][0-9]{13}|64[4-9][0-9]{13}|6011[0-9]{12}|(622(?:12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|9[01][0-9]|92[0-5])[0-9]{10})$
^63[7-9][0-9]{13}$
^(?:2131|1800|35\d{3})\d{11}$
^9[0-9]{15}$
Centralize the support libraries dependencies in gradle
Working with multi-modules project, it is very useful to centralize the dependencies, especially the support libraries.
A very good way is to separate gradle build files, defining something like:
root
--gradleScript
----dependencies.gradle
// lets define Applicative Functor for (->)r type (function of function) | |
// tip: similar to Reader monad. | |
infix operator <*> { associativity left precedence 150 } | |
func <*> <A, B, C> (f : A -> B -> C, g : A -> B)(x : A) -> C { | |
return f (x) (g(x)) | |
} | |
infix operator <|> { associativity left precedence 150 } | |
func <|> <A, B, C> (f : A -> B -> C, g : C -> A) -> C -> B -> C { | |
return pure(f) <*> g |
import Foundation | |
import UIKit | |
extension UIColor { | |
convenience init(hexString:String) { | |
let hexString:NSString = hexString.stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceAndNewlineCharacterSet()) | |
let scanner = NSScanner(string: hexString) | |
if (hexString.hasPrefix("#")) { | |
scanner.scanLocation = 1 |