Skip to content

Instantly share code, notes, and snippets.

View paddy74's full-sized avatar

Patrick Young paddy74

View GitHub Profile
@paddy74
paddy74 / urlencode.sh
Last active October 22, 2024 18:37 — forked from sergeiwaigant/url_encode_string_with_linux_tools.md
Simply URL encode string with Linux/Bash/Shell tools
# Reference https://stackoverflow.com/a/34407620/13287790
# Requires `jq`
# $ echo -n "encode this" | jq -sRj @uri
# encode%20this
# MY_VAR=$(urlencode "encode this")
echo -n "${1}" | jq -sRj @uri
@paddy74
paddy74 / azure_search_curl_query.sh
Last active March 29, 2019 18:05
Searching Documents from Azure Search using cUrl (with decoding & JSON Pretify)
#!/bin/sh
SERVICE_NAME='<Azure Search Service Name>'
API_VER='2017-11-11'
ADMIN_KEY='<API KEY>'
CONTENT_TYPE='application/json'
INDEX_NAME='Azure Search Service index name>'
URL="https://$SERVICE_NAME.search.windows.net/indexes/$INDEX_NAME/docs?api-version=$API_VER"
{