This file contains 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
require 'net/http' | |
def post_xml url_string, xml_string | |
uri = URI.parse url_string | |
request = Net::HTTP::Post.new uri.path | |
request.body = xml_string | |
request.content_type = 'text/xml' | |
response = Net::HTTP.new(uri.host, uri.port).start { |http| http.request request } | |
response.body | |
end |
This file contains 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
# Usage: ./nvmrc-latest-lts.sh | |
# Load NVM | |
export NVM_DIR="$HOME/.nvm" | |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" | |
# Find latest Node LTS version | |
last_line=$(nvm ls-remote --lts --no-colors | tail -n 1) | |
# Match the version number |
This file contains 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
# Usage: ./run-gist.sh <GIST ID> <SCRIPT NAME> <SCRIPT ARGS> | |
# Extract args | |
gist_id="$1" | |
script_name="$2" | |
script_args="${@:3}" | |
# Clone gist | |
remote="https://gist.github.com/$gist_id.git" | |
gist_dir=".gist/$gist_id" |