-
Create a
ssh
key:ssh-keygen -t rsa -b 4096 -C "<email>"
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
protocol NibLoadableView: class { | |
static var nibName: String { get } | |
} | |
extension NibLoadableView where Self: UIView { | |
static var nibName: String { | |
return String(describing: self) | |
} | |
} |
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 | |
public enum APIError: Error { | |
case service(message: String) | |
} | |
extension APIError: CustomStringConvertible { | |
public var description: String { | |
switch self { | |
case .service(let message): |
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 enum Regex: String { | |
case email = "^[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}$" | |
} | |
extension Regex: RegexProvider { | |
public var regex: String { | |
return rawValue | |
} | |
static func validate(expression: String, forRegex regex: Regex) -> Bool { |
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
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})*$/' |
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
extension Encodable { | |
func encode(with encoder: JSONEncoder = JSONEncoder()) throws -> Data { | |
return try encoder.encode(self) | |
} | |
} | |
extension Decodable { | |
static func decode(with decoder: JSONDecoder = JSONDecoder(), from data: Data) throws -> Self { | |
return try decoder.decode(Self.self, from: data) | |
} |
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
@echo off | |
title Flash Memory | |
color 1E | |
@echo ---------------------------------------------- | |
@echo ------------- Memory Flash Fixer ------------- | |
@echo ---------------------------------------------- | |
@echo Changing Folder Attributes... | |
Attrib /d /s -r -h -s *.* | |
@echo ---------------------------------------------- | |
@echo Deleting Links |
OlderNewer