- Download and unzip gist
- In the unzipped folder, run
sh install.sh
- Add the following line to your .zshrc/.bashrc file:
export PATH="$HOME/.git-commands:$PATH"
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
# Shortcuts to force execution in an Objective-C context instead of Swift (assuming current context is Swift) | |
command alias eobjc e -l objc | |
command alias pobjc e -l objc -- | |
command alias poobjc e -l objc -O -- | |
# Call while paused on closing } of a function to print return value | |
# TODO: Fix this, as $rax doesn't seem to be recognized anymore | |
# command alias retval p $rax | |
# Usage: let <variable-name> <memory-address> <type-name> |
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 | |
/// Thread-safe Swift dependency injector | |
/// | |
/// **Using Injector** | |
/// 1. Call `Injector.setup()` early in the application lifecycle. | |
/// 2. In dependency classes, conform to one of `Injectable`, `Singleton`, `WeakSingleton`, `EagerSingleton`. | |
/// 3. In application code, construct dependencies using property injection like: | |
/// ``` | |
/// private let logger: TTLogger = inject() |
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/sh | |
# To install, run: | |
# sudo install ddd /usr/local/bin | |
set -euo pipefail | |
print_usage() { | |
cat <<EOF | |
usage: ddd [<options>] [<project>] |
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
# Copy this function and paste into your `.zshrc`/`.bashrc` | |
function notify () { | |
if [ $# -ge 1 ] | |
then | |
osascript -e "display notification \"$1\" with title \"Terminal\"" | |
else | |
osascript -e "display notification \"Command finished.\" with title \"Terminal\"" | |
fi | |
} |