- Install
brew
brew install ffmpeg
??brew install ffmpeg imagemagick gifsicle pkg-config
brew cask install xquartz
brew install gifsicle
This file contains hidden or 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 | |
// MARK: - Portable Game Notation (PGN). | |
/// Portable Game Notation (PGN). | |
/// https://en.wikipedia.org/wiki/Portable_Game_Notation | |
struct PGN { | |
typealias TurnNumber = UInt | |
let counterparts: [Counterpart] |
This file contains hidden or 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
/// USAGE /// | |
// Declarative endpoint description | |
// MARK: - Endpoints | |
struct LoginRequest: Request { | |
let endpoint = "api/v3/auth" | |
let method = HTTPMethod.get | |
let headers: [String : String] = [:] |
This file contains hidden or 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
git log --pretty=format: --name-only | sort | uniq -c | sort -rg | head -30 |
This file contains hidden or 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 | |
/// Gives your value thread protection | |
public final class AtomicValue<T> { | |
public var value: T { | |
get { | |
return lock.sync { | |
return self._value |
This file contains hidden or 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
set completion-ignore-case On | |
"\e[B": history-search-forward | |
"\e[A": history-search-backward |
- Make sure you have Homebrew installed, and then use it to install the package bash-completion (by typing the command
brew install bash-completion
). - Homebrew should now tell you what you need to do to complete the installation. In this case, you need to add these three lines to your
.bashrc
file (using either a command-line text editor like nano which we used above, or a graphical one):
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
- You should now have auto-completion in bash. Please note: for the changes to take effect in existing shells, .bashrc will need to be sourced. Alternatively, logout and login again, or just reboot.
This file contains hidden or 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
struct UserDidSelectItem { | |
let item: Item | |
} | |
let action = UserDidSelectItem(item: item) | |
core.dispatch(action) |
This file contains hidden or 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 Unicore | |
typealias ApplicationCore = Core<ApplicationState> | |
let core = ApplicationCore( | |
state: ApplicationState.initial, | |
mutate: mutate // pure function (ApplicationState, Action) -> ApplicationState | |
) |
This file contains hidden or 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
/// Action creator | |
func downloadProfile(state: ApplicationState) -> Action { | |
return Downloader.DownloadUserProfile( | |
baseURL: state.api.profile.baseURL | |
endpoint: state.api.profile.getProfile | |
profileID: state.profile.id | |
authToken: state.auth.token | |
retryCount: state.api.retryCount | |
) | |
} |