git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
import XCTest | |
import UIKit | |
@testable import DismissTest | |
class TopLevelUIUtilities { | |
private var rootWindow: UIWindow! | |
func setupTopLevelUI(withViewController viewController: UIViewController) { |
[ | |
{ | |
"name": "Four key metrics", | |
"ring": "Adopt", | |
"quadrant": "Techniques", | |
"isNew": false, | |
"description": "asd" | |
} | |
] |
rm -rf ~/Library/Developer/Xcode/DerivedData | |
rm -rf ~/Library/Developer/Xcode/Archives | |
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode | |
xcrun simctl delete unavailable |
https://stackoverflow.com/questions/41953300/how-to-delete-the-old-git-history | |
git checkout --orphan temp <f> # checkout to the status of the git repo at commit f; creating a branch named "temp" | |
git commit -m "new root commit" # create a new commit that is to be the new root commit | |
git rebase --onto temp <f> master # now rebase the part of history from <f> to master onthe temp branch | |
git branch -D temp # we don't need the temp branch anymore |
public typealias PasswordManagementService = ForgottenPasswordServiceProtocol & ResetPasswordServiceProtocol | |
public typealias AuthenticationService = LoginServiceProtocol & SignUpServiceProtocol & PasswordManagementService & RecaptchaServiceProtocol | |
public typealias UserAccountService = AccountInfoServiceProtocol & ChangePasswordServiceProtocol & ForgottenPasswordServiceProtocol & AccountCreditServiceProtocol | |
public class AccountModule { | |
public init(settings: Settings, | |
authenticationService: AuthenticationService, | |
userAccountService: UserAccountService, | |
socialLoginServices: [SocialLoginService], | |
userInfoProvider: UserInfoProvider) |
func base64String(_ input: String) -> String { | |
var base64 = input | |
.replacingOccurrences(of: "-", with: "+") | |
.replacingOccurrences(of: "_", with: "/") | |
switch base64.count % 4 { | |
case 2: | |
base64 = base64.appending("==") | |
case 3: |
private func getValidUserAuthorizationInMutualExclusion(completion: @escaping (Result<AuthorizationValue, Error>) -> Void) { | |
semaphore.wait() | |
guard let authenticationInfo = authenticationInfoStore.userAuthenticationInfo else { | |
semaphore.signal() | |
let error = // forge an error for 'missing authorization' | |
completion(.failure(error)) | |
return | |
} | |
class AuthorizationValueProvider { | |
private let authenticationInfoStore: AuthenticationInfoStorage | |
private let tokenRefreshAPI: TokenRefreshing | |
private let queue = DispatchQueue(label: <#label#>, qos: .userInteractive) | |
private let semaphore = DispatchSemaphore(value: 1) | |
init(tokenRefreshAPI: TokenRefreshing, | |
authenticationInfoStore: AuthenticationInfoStorage) { |
typealias Token = String | |
typealias AuthorizationValue = String | |
struct UserAuthenticationInfo { | |
let bearerToken: Token // the JWT | |
let refreshToken: Token | |
let expiryDate: Date // computed on creation from 'exp' claim | |
var isValid: Bool { | |
return expiryDate.compare(Date()) == .orderedDescending | |
} |