Thank you everybody, Your comments makes it better
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
Thank you everybody, Your comments makes it better
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
^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}$
Perl and PHP Regular Expressions | |
PHP regexes are based on the PCRE (Perl-Compatible Regular Expressions), so any regexp that works for one should be compatible with the other or any other language that makes use of the PCRE format. Here are some commonly needed regular expressions for both PHP and Perl. Each regex will be in string format and will include delimiters. | |
All Major Credit Cards | |
This regular expression will validate all major credit cards: American Express (Amex), Discover, Mastercard, and Visa. | |
//All major credit cards regex | |
'/^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|6011[0-9]{12}|622((12[6-9]|1[3-9][0-9])|([2-8][0-9][0-9])|(9(([0-1][0-9])|(2[0-5]))))[0-9]{10}|64[4-9][0-9]{13}|65[0-9]{14}|3(?:0[0-5]|[68][0-9])[0-9]{11}|3[47][0-9]{13})*$/' |
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
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 |
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), |
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
// 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") |
// 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 |
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 |