Skip to content

Instantly share code, notes, and snippets.

View kuyazee's full-sized avatar
:octocat:
Learning every day

Zonily Jame kuyazee

:octocat:
Learning every day
View GitHub Profile
@kuyazee
kuyazee / ExportOptions.plist
Created September 6, 2021 12:02
ExportOptions.plist for creating iOS builds via cli
<?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>
@kuyazee
kuyazee / .gitlab-ci.yml
Created September 6, 2021 10:52
Flutter, Firebase, and Gitlab CI Yaml Settings
stages:
- generate
- test
- build ios
- build android
- deploy
- clean
flutter_generate:
stage: generate
extension Result where Value == Void {
static func success() -> Result {
return .success(())
}
}
enum Result<Value> {
case success(Value)
case failure(Error)
}
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(())
enum FooBar {
case foo(Void)
case bar(Void)
}
@kuyazee
kuyazee / google-sheets-colour-preview.js
Created September 20, 2018 07:38 — forked from Pathoschild/google-sheets-color-preview.js
A Google Sheets script which adds colour preview to cells. 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.
/*
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";
@kuyazee
kuyazee / UIDevice+DeviceModel.swift
Last active June 16, 2021 13:35
This will help identify what kind of device a user is using.
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))
}
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}/"
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"