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 | |
enum SteakerRegex { | |
case email | |
case password | |
case address(String) | |
case chineseCharacter | |
var rawRegex: String { | |
switch 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
var previous: LineChartDataSet? | |
let lineSets = [PE14, PE16, PE18, PE20, PE22, PE24] | |
let colors = [ | |
UIColor(displayP3Red: 18/255, green: 31/255, blue: 29/255, alpha: 0.5), | |
UIColor(displayP3Red: 41/255, green: 196/255, blue: 180/255, alpha: 1), | |
UIColor(displayP3Red: 162/255, green: 212/255, blue: 209/255, alpha: 1), | |
UIColor(displayP3Red: 231/255, green: 197/255, blue: 105/255, alpha: 1), | |
UIColor(displayP3Red: 242/255, green: 162/255, blue: 110/255, alpha: 1), | |
UIColor(displayP3Red: 241/255, green: 129/255, blue: 97/255, alpha: 1) | |
] |
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 String { | |
func match(regex pattern: String) -> [String] { | |
do { | |
let text = self | |
let regex = try NSRegularExpression(pattern: pattern) | |
let matches = regex.matches(in: text, | |
range: NSRange(text.startIndex..., in: text)) | |
return matches.flatMap { match in | |
(0..<match.numberOfRanges).map { |
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
// | |
// InteractiveLabel.swift | |
// Hahow2C | |
// | |
// Created by David on 2020/7/23. | |
// Copyright © 2020 Hahow. All rights reserved. | |
// | |
import UIKit | |
import Siatke |
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 protocol AnyOptional { | |
var isNil: Bool { get } | |
} | |
extension Optional: AnyOptional { | |
public var isNil: Bool { self == nil } | |
} | |
@propertyWrapper | |
public struct DefaultsStorage<T> where T: Codable { |
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 | |
import KeychainAccess | |
//https://www.swiftbysundell.com/articles/property-wrappers-in-swift/ | |
public protocol AnyOptional { | |
var isNil: Bool { get } | |
} | |
extension Optional: AnyOptional { | |
public var isNil: Bool { self == nil } |
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
- cache-push: | |
inputs: | |
- cache_paths: |- | |
... | |
# 新增 | |
$MINT_PACKAGES |
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
- cache-push: | |
inputs: | |
- cache_paths: |- | |
$BITRISE_CACHE_DIR | |
... | |
# 新增以下 cache_path | |
$BREW_MINT | |
$BREW_OPT_MINT |
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
- script: | |
title: Brew install | |
inputs: | |
- content: |- | |
# 執行上述的 install 方法,沒有套件則先安裝,有的話直接 link cache 中的套件 | |
brew install mint | |
brew link mint |
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
- script: | |
title: Set Env Path | |
inputs: | |
- content: |- | |
# 增加我們要 cache 的 brew 套件環境變數,如果有使用到其他的套件,請再手動增加 | |
envman add --key BREW_MINT --value "$(brew --cellar)/mint" # 指定套件名稱位置 | |
envman add --key BREW_OPT_MINT --value "/usr/local/opt/mint" # 指定套件名稱位置,此為 file alias |