Skip to content

Instantly share code, notes, and snippets.

@bachya
Last active August 29, 2015 14:06
aText snippet that takes a gist ID or URL from the clipboard and creates a Wordpress shortcode/link pair
GIST_ID=$(echo "【clipboard】" | sed -Ee 's/https?:\/\/gist\.github\.com\/[^\/]+\///')
echo "[gist ${GIST_ID} /]" \
"<div class=\"no_js\">" \
"<a name=\"${GIST_ID}\"></a>" \
"<a href=\"#${GIST_ID}\">Click here to see the Gist.</a>" \
"</div>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment