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
#!/usr/bin/env bash | |
# Adapted from https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity | |
# example code within which appears to be CC0 public domain. Likewise for this work: | |
# CC0: This work has been marked as dedicated to the public domain. | |
url=${1:-https://code.jquery.com/jquery-3.6.0.slim.min.js} | |
algo=${2:-sha384} | |
hash=$(curl -s "$url" | openssl dgst -"$algo" -binary | openssl base64 -A) | |
if grep -q css <<<"$url" >/dev/null 2>&1; then | |
out='<link rel="stylesheet" href="%s" integrity="%s-%s" crossorigin="anonymous">\n' | |
else |
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
# protect-conda-base.sh | |
# | |
# If you use Anaconda, it is really easy to accidentally install packages | |
# into the base environment. Head that off at the pass. | |
# However, allow installs in a pip virtual environment. | |
# | |
# Allow for an override if you run these commands with a CONDA_PROMPT_OVERRIDE variable set, | |
# as in: | |
# | |
# CONDA_PROMPT_OVERRIDE pip install powerline-shell |
OlderNewer