Skip to content

Instantly share code, notes, and snippets.

@jezhou
Last active April 4, 2021 02:41
Show Gist options
  • Save jezhou/97632b65ee152192ff64b13b631d8947 to your computer and use it in GitHub Desktop.
Save jezhou/97632b65ee152192ff64b13b631d8947 to your computer and use it in GitHub Desktop.
FZF Scripts
# Allows you to view your reviews checks on Github via FZF
# Dependencies: github cli
gh pr list -S "review-requested:jezhou" |\
fzf --preview 'echo {} | head -n1 | cut -f1 | xargs gh pr view | fold -w 80 -s' --height=50% --reverse --bind 'ctrl-r:refresh-preview' --header '(ctrl-r) Refresh status' |\
head -n1 |\
cut -f1 |\
xargs gh pr view -w
# Allows you to view your status checks on Github via FZF
# Dependencies: github cli
gh pr list -A jezhou |\
fzf --preview 'echo {} | head -n1 | cut -f1 | xargs gh pr checks' --height=50% --reverse --bind 'ctrl-r:refresh-preview' --header '(ctrl-r) Refresh status' |\
head -n1 |\
cut -f1 |\
xargs gh pr view -w
# Copies the first gif off a search query from Giphy into a markdown image format `![](GIPHY_URL)`
# Requires you to set GIPHY_API_KEY in your .bashrc / .zshrc
#
# Dependencies: jq
function giphy() {
WEIRDNESS=$((1 + $RANDOM % 10))
QUERY=`echo "$@" | tr ' ' '+'`
curl -s "http://api.giphy.com/v1/gifs/translate?s=$QUERY&weirdness=$WEIRDNESS&api_key=$GIPHY_API_KEY&limit=1" | jq -r '.data .images .downsized .url' | xargs -I {} echo "\![]({})" | pbcopy && echo "Copied gif\!"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment