Skip to content

Instantly share code, notes, and snippets.

Avatar

olgusirman olgusirman

View GitHub Profile
View OOP_Musician_Approach.swift
/**
* Copyright (c) 2017 Razeware LLC
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@olgusirman
olgusirman / FontProtocol.swift
Created Aug 28, 2020
Protocol Oriented approach for font usage
View FontProtocol.swift
protocol CustomFontsProtocol {
func size(size: CGFloat) -> UIFont?
}
extension CustomFontsProtocol where Self: RawRepresentable, Self.RawValue == String {
func size(size: CGFloat) -> UIFont? {
return UIFont(name: rawValue, size: size)
}
View RemoveDuplicates.swift
public extension Array where Element: Hashable {
func removeDuplicates() -> [Element] {
var items = Set<Element>
return self.filter { items.insert($0).inserted }
}
}
// [1,2,5,5,2,4,3].removeDuplicates()
@olgusirman
olgusirman / uploadFirebaseCrashlytics.sh
Created Aug 16, 2020
Use for manually upload dsym files to Firebase
View uploadFirebaseCrashlytics.sh
sudo {path/FirebaseCrashlytics/upload-symbols} -gsp {{path/GoogleService-Info.plist}} -p ios {dsym'sPath}
@olgusirman
olgusirman / sample.dart
Created Aug 15, 2020
Sample dart codes from RayWenderlich tutorial
View sample.dart
void main() {
var myAge = 35;
print(myAge); // 35
// This is a comment.
print(myAge); // This is also a comment.
/*
And so is this.
*/
int yourAge = 27;
View ContentView.swift
import SwiftUI
struct ContentView: View {
var body: some View {
VStack {
EventHeader()
ImagePlaceholder().layoutPriority(-1) // added
.frame( minHeight: 100)
Text(makeDescription())
//Text(makeDescription()).layoutPriority(1) // removed
View PracticalOSLogGuide.txt
// Documentation
https://developer.apple.com/documentation/os/logging
https://www.avanderlee.com/debugging/oslog-unified-logging/
// Don't forget the open console actions for info and debug
// Filter with subsystem and category
// subsystem: BundleId
// Category: static
// Handy extension
@olgusirman
olgusirman / helperGitCommandsForTags.sh
Created Apr 23, 2020
Helper git commands for Tags
View helperGitCommandsForTags.sh
# Show all tags with description
git show --tags |grep "^tag " -A4
View agvtoolUsage.txt
Notes about agvtool
1) Enable agvtool.
2) Set up your version and build numbers.
## sampleUsage:
agvtool new-marketing-version <your_specific_version>
xcrun agvtool new-marketing-version 2.0
—--Build--—
@olgusirman
olgusirman / updateVersionNumberAndPushTag.sh
Last active Apr 25, 2020
Gets latest tag, increment build number and version number, set a commit with this tag and push
View updateVersionNumberAndPushTag.sh
#!/bin/bash
# Get Tags Latest number, increment and set build and version number
echo "Please set an input your tag description, ticket number etc."
read TAG_DESCRIPTION
# get latest tag number
VERSION=`git describe --abbrev=0 --tags`
echo "CURRENT VERSION => $VERSION"
You can’t perform that action at this time.