Created
March 6, 2017 08:35
-
-
Save alexey-detr/9006ed8a39721daef22467fb3e8fe26e to your computer and use it in GitHub Desktop.
Fish function to get CSS background-url compatible base64 encoded file data, where filename specified as argument
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
# You have to install mime package | |
# npm install -g mime | |
function base64urldata | |
set filename $argv[1] | |
echo "data:"(mime $filename)";base64,"(cat $filename | openssl enc -base64 | tr -d '\n') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment