type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
type below:
brew update
brew install redis
To have launchd start redis now and restart at login:
brew services start redis
/* | |
The former will log out the time required for a given section of code, with the latter returning that as a float. | |
Read more : http://stackoverflow.com/questions/25006235/how-to-benchmark-swift-code-execution | |
*/ | |
func printTimeElapsedWhenRunningCode(title:String, operation:()->()) { | |
let startTime = CFAbsoluteTimeGetCurrent() | |
operation() |
# UPDATED 17 February 2019 | |
# Redirect all HTTP traffic to HTTPS | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name www.domain.com domain.com; | |
return 301 https://$host$request_uri; | |
} | |
# SSL configuration |
There is a function .retry() in Combine that helps to retry a request. Although it is not enough just to call retry() to achieve retring logic. The retry() function does not do another request but it re-subscribes only to a publisher. To make another request the tryCatch() might be used. In the code below if the first call fails there are three attempts to retry (retry(3)):
import UIKit
import Combine
import PlaygroundSupport
enum CustomNetworkingError: Error {
case invalidServerResponse
}
//First commit any outstanding code changes, and then, run this command: | |
git rm -r --cached . | |
//This removes any changed files from the index(staging area), then just run: | |
git add . | |
//Commit | |
git commit -m "Atualizando .gitignore para..." |
import UIKit | |
extension UIStoryboard { | |
/// Main storyboard | |
public var main: UIStoryboard { | |
return UIStoryboard(name: "Main", bundle: nil) | |
} | |
/// Instantiates and returns the view controller with the specified identifier. | |
/// | |
/// - Parameter identifier: uniquely identifies equals to Class name |
env > env.txt | |
instruments -s devices > devices.txt | |
#! /bin/sh -e | |
# This script demonstrates archive and create action on frameworks and libraries | |
# Based on script by @author Boris Bielik | |
# Release dir path | |
OUTPUT_DIR_PATH="${PROJECT_DIR}/XCFramework" | |
function archivePathSimulator { |
#!/bin/bash | |
# Generate list of arguments to pass to Sourcery | |
function sourceryArguments { | |
# Environment variables from BuildConfig to map into AppSecrets | |
local arguments=( | |
"CHAT_API_CLIENT_SECRET" "ANALYTICS_WRITE_KEY" | |
) | |
local combinedArgs |