Last active
June 6, 2025 19:19
-
-
Save VSharapov/8a61a72306f915c9b857416b9d2279c0 to your computer and use it in GitHub Desktop.
Pick a gist and run it
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
| #!/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