This file contains hidden or 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
| #!/usr/bin/env ruby | |
| require 'optparse' | |
| require 'ostruct' | |
| require 'plist' | |
| require 'pp' | |
| class Archive | |
| ARCHIVES_ROOT = File.join(File.expand_path('~'), "Library/Developer/Xcode/Archives") |
This file contains hidden or 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
| #!/usr/bin/env bash | |
| diff Podfile.lock Pods/Manifest.lock > /dev/null | |
| if [[ $? != 0 ]]; then | |
| echo "*** Podfile changed ***" | |
| pod install | |
| fi | |
This file contains hidden or 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
| // | |
| // String+EmailValidation.swift | |
| // Created by: Jader Feijo | |
| // | |
| import Foundation | |
| extension String { | |
| var isValidEmail: Bool { | |
| do { |
This file contains hidden or 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
| // | |
| // String+MD5.swift | |
| // Created by: Jader Feijo | |
| // | |
| import Foundation | |
| extension String { | |
| var md5: String { | |
| var digest = [UInt8](repeating: 0, count: Int(CC_MD5_DIGEST_LENGTH)) |
This file contains hidden or 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
| // | |
| // String+Dates.swift | |
| // Created by Jader Feijo on 14/10/2016. | |
| // | |
| import Foundation | |
| extension String { | |
| func asDate(withFormat format: String) -> Date? { | |
| let formatter = DateFormatter() |
This file contains hidden or 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
| // | |
| // Date+TimeOfDay.swift | |
| // Created by: Jader Feijo | |
| // | |
| import Foundation | |
| extension Date { | |
| enum TimeOfDay { | |
| case morning |
This file contains hidden or 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
| // | |
| // Date+Components.swift | |
| // Created by: Jader Feijo | |
| // | |
| import Foundation | |
| extension Date { | |
| var hour: Int { | |
| return (Calendar.current as NSCalendar).component(.hour, from: self) |
This file contains hidden or 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
| // | |
| // Array+NaturalLanguageJoin.swift | |
| // Created by: Jader Feijo | |
| // | |
| import Foundation | |
| extension Array { | |
| var joinedAsNaturalLanguageSequence: String { | |
| var naturalLanguageSequence = "" |
This file contains hidden or 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
| // | |
| // NumberFormatter+Currency.swift | |
| // Created by: Jader Feijo | |
| // | |
| import Foundation | |
| extension NumberFormatter { | |
| public static func formatter(forCurrencyCode currencyCode: String) -> NumberFormatter { | |
| return NumberFormatter().with { f in |
This file contains hidden or 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 | |
| extension URL { | |
| var hasQueryStringParameters: Bool { | |
| return query != nil | |
| } | |
| var queryStringParameters: [String: String] { | |
| var results = [String: String]() | |
| if let keyValues = query?.components(separatedBy: "&"), keyValues.count > 0 { |