Skip to content

Instantly share code, notes, and snippets.

View olbartek's full-sized avatar

Bartosz Olszanowski olbartek

View GitHub Profile
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
lane :distribute_to_zander do |options|
UI.user_error!("`changelog` param is missing") if options[:changelog].nil?
UI.message("`app_identifier` param is missing, using identifier from env variable...") if options[:app_identifier].nil?
app_id = options[:app_identifier] ||= ENV["BUNDLE_IDENTIFIER"]
UI.message("`version` param is missing, using version from the project...") if options[:version].nil?
version = options[:version] ||= get_version_number
UI.message("`build_number` param is missing, using build number from the project...") if options[:build_number].nil?
@olbartek
olbartek / zander.rb
Last active October 10, 2019 08:17
Fastlane action for uploading builds to Zander API
module Fastlane
module Actions
module SharedValues
ZANDER_DOWNLOAD_LINK = :ZANDER_DOWNLOAD_LINK
ZANDER_BUILD_INFORMATION = :ZANDER_BUILD_INFORMATION # contains all keys/values from the Zander API, like :buildNumber, :releaseNotes
end
class ZanderAction < Action
def self.connection(options)
require 'faraday'
@olbartek
olbartek / number-of-lines
Created July 2, 2018 13:54
Count Xcode project number of lines exluding Pods directories
find . -path ./Pods -prune -o -name "*.swift" -print0 | xargs -0 wc -l
@olbartek
olbartek / TextValidators.swift
Last active November 16, 2017 10:54
Text validation proposal
protocol TextValidating {
func validateText(_ text: String) throws
}
class PasswordValidator: TextValidating {
let minimumAllowedCharacters = 6
enum Error: Swift.Error, CustomStringConvertible {
case passwordTooShort
import UIKit
// TASK:
var array: [Int] = [1, 2, 3]
for currentIndex in 0..<array.count {
let randomIndex = Int(arc4random_uniform(UInt32(array.count)))
let tmp = array[currentIndex]
@olbartek
olbartek / git_reflog_simple_usage.txt
Created July 6, 2017 20:34
GIt reflog simple usage
Have you accidentially made a hard reset to some of your commits?
git reset --hard HEAD~1
You can simply check git reflog,
because Every time the current HEAD gets updated a new entry will be added to the reflog.
git reflog
Find the desired commit and make a hard reset to it.
git reset --hard <commit>