- Run
sudo chmod 666 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources//IDETextKeyBindingSet.plist
sudo chmod 777 /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Versions/A/Resources/
On Mac OSX, the native SSH client can use the built-in keychain directly. | |
Open terminal. | |
Write: | |
mkdir ~/.ssh | |
cd ~/.ssh | |
Copy your private key "id_rsa" to /.ssh folder. | |
Write in terminal also: |
If you've got something like this: | |
file was built for arm64 which is not the architecture being linked (x86_64): | |
Than this gist is for you. | |
Let's say you have already developed the framework itself and just want to build the binary | |
and distribute it through the Cocoapods. | |
1. Make sure your framework "Deployment Target" is equal to all the dependencies from your podspec file. |
Basically just type the following in a shell: | |
$ irb | |
irb> require "spaceship" | |
irb> Spaceship::Tunes.login("iTunesConnect_username", "iTunesConnect_password") | |
irb> Spaceship::Tunes.select_team | |
You'll be presented with a list of teams your account belongs to, along with the numerical representation for that team. |
import Foundation | |
import AVFoundation | |
protocol VideoCompressorProtocol { | |
func compress(fileURL: URL, outputURL: URL, completion: @escaping (URL?, Error?) -> Void) | |
} | |
class VideoCompressor: VideoCompressorProtocol { | |
func compress(fileURL: URL, outputURL: URL, completion: @escaping (URL?, Error?) -> Void) { |
class ResumableTimer: NSObject { | |
private var timer: Timer? = Timer() | |
private var callback: () -> Void | |
private var startTime: TimeInterval? | |
private var elapsedTime: TimeInterval? | |
// MARK: Init |
/* | |
A closure is said to escape a function when the closure is passed as an argument to the function, | |
but is called after the function returns. When you declare a function that takes a closure as one of its parameters, | |
you can write @escaping before the parameter’s type to indicate that the closure is allowed to escape. | |
One way that a closure can escape is by being stored in a variable that is defined outside the function. | |
As an example, many functions that start an asynchronous operation take a closure argument as a completion handler. | |
The function returns after it starts the operation, but the closure isn’t called until the operation is completed — the closure | |
needs to escape, to be called later. For example: | |
*/ |
import Foundation | |
import Combine | |
import XCTest | |
class Sut { | |
private var bag = Set<AnyCancellable>() | |
var triggerSubject = PassthroughSubject<Void, Never>() |
Command line:
defaults write com.apple.screencapture location /Users/alex/Screenshots
https://docs.npmjs.com/downloading-and-installing-node-js-and-npm | |
Run nvm installation script. | |
https://github.com/nvm-sh/nvm#install--update-script | |
If you get nvm: `command not found` after running the install script, troubleshoot it. | |
https://github.com/nvm-sh/nvm#troubleshooting-on-macos | |
This worked in my case on zsh: | |
You might need to restart your terminal instance or run `. ~/.nvm/nvm.sh`. |