Skip to content

Instantly share code, notes, and snippets.

@daniellowtw
Created July 18, 2019 10:16
Show Gist options
  • Save daniellowtw/5b8613d2f6bcee44af9fb6727c5c33df to your computer and use it in GitHub Desktop.
Save daniellowtw/5b8613d2f6bcee44af9fb6727c5c33df to your computer and use it in GitHub Desktop.
Encoding url
#Python3
urlencode() {
python -c "import urllib.parse as ul; print(ul.quote_plus('$1'));"
}
#Python2
urlencode() {
python -c "import urllib as ul; print(ul.quote_plus('$1'));"
}
#Node
urlencode() {
node -e "console.log(encodeURI('$1'))"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment