Skip to content

Instantly share code, notes, and snippets.

View jhoolmans's full-sized avatar

Jeroen Hoolmans jhoolmans

View GitHub Profile
@mlsteele
mlsteele / ngrok-copy
Created January 15, 2016 16:49
Copy the url of the active ngrok connection to the clipboard.
#!/usr/bin/env bash
# Copy the url of the active ngrok connection to the clipboard.
# Usage:
# ngrok-copy # copies e.g. https://3cd67858.ngrok.io to clipboard.
# ngrok-copy -u # copies e.g. http://3cd67858.ngrok.io to clipboard.
if [[ "$1" == "-u" ]]; then
NGROK_URL=`curl -s http://127.0.0.1:4040/status | grep -P "http://.*?ngrok.io" -oh`
else
NGROK_URL=`curl -s http://127.0.0.1:4040/status | grep -P "https://.*?ngrok.io" -oh`