Skip to content

Instantly share code, notes, and snippets.

@jaredyam
Last active November 5, 2020 13:45
Show Gist options
  • Save jaredyam/4a0f0b0b4e6a1304ea82edfd8399e5e0 to your computer and use it in GitHub Desktop.
Save jaredyam/4a0f0b0b4e6a1304ea82edfd8399e5e0 to your computer and use it in GitHub Desktop.
# Instantly create a gist and save it as a local repo.
# Prerequisites: brew install hub
# Usage: gist [file-to-share]
function gist() {
hub gist create --public -o -c "$1"
__url=$(pbpaste)
git clone "$__url" && mv "${__url##*/}" "${1%.*}" && rm "$1" && cd "${1%.*}"
}
# Move files to the system trash.
function trash() {
mv -fv "$@" ~/.Trash
}
# Activate the conda environment with fuzzy search.
function condaf() {
conda activate $(conda info --env | fzf | awk '{print $NF}')
}
# Send out iMessage from the command line or bash scripts.
function iMessage() {
osascript -e "tell application \"Messages\" to send \"$1\" to buddy \"[e-mail|phone-number|$2]\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment