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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>compileBitcode</key> | |
<false/> | |
<key>signingCertificate</key> | |
<string>INSERT_NAME_OF_YOUR_DISTRIBUTION_CERT_HERE</string> |
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
stages: | |
- generate | |
- test | |
- build ios | |
- build android | |
- deploy | |
- clean | |
flutter_generate: | |
stage: generate |
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 Result where Value == Void { | |
static func success() -> Result { | |
return .success(()) | |
} | |
} |
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
enum Result<Value> { | |
case success(Value) | |
case failure(Error) | |
} |
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 FooBar { | |
// Use this if you don't want to refactor your code. | |
static func bar() -> FooBar { | |
return .bar(()) | |
} | |
// Use this if you want your code to be shorter. | |
// It's all about your personal preferences. | |
static var foo: FooBar { | |
return .foo(()) |
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
enum FooBar { | |
case foo(Void) | |
case bar(Void) | |
} |
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
/* | |
This script is meant to be used with a Google Sheets spreadsheet. When you edit a cell containing a | |
valid CSS hexadecimal colour code (like #000 or #000000), the background colour will be changed to | |
that colour and the font colour will be changed to the inverse colour for readability. | |
To use this script in a Google Sheets spreadsheet: | |
1. go to Tools » Script Editor » Spreadsheet; | |
2. erase everything in the text editor; | |
3. change the title to "Set colour preview on edit"; |
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 UIKit | |
public extension UIDevice { | |
public static var modelCode: String { | |
if let simulatorModelIdentifier = ProcessInfo().environment["SIMULATOR_MODEL_IDENTIFIER"] { return simulatorModelIdentifier } | |
var systemInfo = utsname() | |
uname(&systemInfo) | |
return withUnsafeMutablePointer(to: &systemInfo.machine) { | |
ptr in String(cString: UnsafeRawPointer(ptr).assumingMemoryBound(to: CChar.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
RESOURCE_PATH=${SRCROOT}/GoogleService-Info/${CONFIGURATION} | |
BUILD_APP_DIR=${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}.app | |
echo "Copying all files under ${RESOURCE_PATH} to ${BUILD_APP_DIR}" | |
cp -v "${RESOURCE_PATH}/"* "${BUILD_APP_DIR}/" |
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 AnalyticsEvent: AnalyticsEventProtocol { | |
case userLoggedIn | |
case userLoggedOut | |
case productSelected(productId: Int) | |
var name: String { | |
switch self { | |
case .userLoggedIn: return "User Logged In" | |
case .userLoggedOut: return "User Logged Out" | |
case .productSelected: return "Product Selected" |
NewerOlder