Skip to content

Instantly share code, notes, and snippets.

@VSharapov
Last active June 6, 2025 19:19
Show Gist options
  • Select an option

  • Save VSharapov/8a61a72306f915c9b857416b9d2279c0 to your computer and use it in GitHub Desktop.

Select an option

Save VSharapov/8a61a72306f915c9b857416b9d2279c0 to your computer and use it in GitHub Desktop.
Pick a gist and run it
#!/bin/sh
set -eu
tmp_file=$(mktemp) && echo -e '#!/bin/sh\nexit 0' > "$tmp_file" && chmod +x "$tmp_file" && "$tmp_file" || tmp_file=$(mktemp -p "$HOME") || exit 1
gists=$(curl -s https://api.github.com/users/VSharapov/gists | jq -r '.[].files[].raw_url')
[ -z "$gists" ] && exit 1
selected_gist=$(echo "$gists" | fzf) || select selected_gist in $gists; do break; done
curl -s "$selected_gist" -o "$tmp_file" && chmod +x "$tmp_file" && "$tmp_file" "@"
rm -i "$tmp_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment