git reset HEAD^ --hard
git push origin -f
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 Foundation | |
public class AuthenticationService { | |
public init() { | |
} | |
public func login(_ username: String, _ password: String) -> String { | |
return UUID().uuidString | |
} |
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 | |
import Networking // 1 | |
class ViewController: UIViewController { | |
let authService = AuthenticationService() // 2 | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let token = authService.login("user", "S7eo#0-2K&b") // 3 | |
print("token: \(token)") // 4 | |
} |
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
#!/usr/bin/swift | |
import Foundation | |
func basicAuth(_ username: String, _ password: String) -> String { | |
let auth = username + ":" + password | |
let authData = auth.data(using: .utf8)! | |
return authData.base64EncodedString() | |
} |
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
#!/bin/bash | |
set -e | |
defaults write com.apple.dt.Xcode DVTTextEditorTrimTrailingWhitespace -bool YES | |
defaults write com.apple.dt.Xcode DVTTextEditorTrimWhitespaceOnlyLines -bool YES | |
defaults write com.apple.dt.Xcode DVTTextIndentTabWidth -int 4 | |
defaults write com.apple.dt.Xcode DVTTextIndentWidth -int 4 |
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
# Created by: Rostyslav Druzhchenko | |
# | |
# 1: Declare variables | |
RESULT_DIR="libUniversal" | |
BUILD_DIR_SIMULATOR="Debug-iphonesimulator" | |
BUILD_DIR_DEVICE="Debug-iphoneos" | |
LIB_NAME="Networking" |
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
# Created by: Rostyslav Druzhchenko | |
# | |
# Get current time | |
# | |
START_DATE=$(date +"%s") | |
# Save Swiftlint full path to a local variable | |
# | |
SWIFT_LINT=/usr/local/bin/swiftlint |
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
#!/usr/bin/env swift | |
import Foundation | |
@discardableResult | |
func shell(_ args: String...) -> Int32 { | |
let task = Process() | |
task.launchPath = "/usr/bin/env" | |
task.arguments = args | |
task.launch() |
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 Foundation | |
func readVariable(_ name: String) -> String { | |
if let value = ProcessInfo.processInfo.environment[name] { | |
return value | |
} | |
return "" | |
} | |
let homePath = readVariable("HOME") |
OlderNewer