Skip to content

Instantly share code, notes, and snippets.

@lainara6-zz
lainara6-zz / git-tag-delete-local-and-remote.sh
Created March 4, 2020 02:35 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@lainara6-zz
lainara6-zz / universal-framework.sh
Created March 3, 2020 09:34 — forked from atsepkov/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures). This version works with Cocoapods, merging simulator and device architectures for intermediate libraries as well. To use this script, go to Product > Scheme > Edit S…
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
export ALREADYINVOKED="true"
import Foundation
import UIKit
public enum ModelType: String {
case iPhone4
case iPhone4S
case iPhone5
case iPhone5C
case iPhone5S
case iPhone6
import Alamofire
import PromiseKit
public class BaseService {
var baseUrl: String
public init(baseUrl: ServiceUrl = .Base) {
self.baseUrl = baseUrl.value
}
import Foundation
struct CustomObject1 {
var value1: String
}
struct CustomObject2 {
var value2: String
}
var str = "uiiytrhhbggg"
let arr = str.compactMap({ return $0 }).sorted(by: { $0 < $1 })
print(arr.reduce("", {"\($0)\($1)"}))
import UIKit
struct People {
var id: String!
var name: String!
}
var objects: [People] = []
objects.append(People(id: "1", name: "A"))
var arrays = [1, 2, 3]
let values = arrays.reduce([:]) { (dictionary, object) -> [String: Int] in
var dic = dictionary
dic["\(object)"] = object
return dic
}
print(values)
var arrays1 = [1, 2, 3]
let values1 = arrays1.reduce([]) { (array, object) -> [[String: Int]] in
import Foundation
enum CustomError: Error {
case Negative
case Zero
var message: String {
switch self {
case .Negative:
import Foundation
enum CustomError: Error {
case Error1
case Error2
case Error3
case ErrorUnknown
}