Skip to content

Instantly share code, notes, and snippets.

@frangio
Last active December 13, 2015 18:38
Show Gist options
  • Save frangio/4957031 to your computer and use it in GitHub Desktop.
Save frangio/4957031 to your computer and use it in GitHub Desktop.
Converts file passed as argument to Data URI representation.
#!/usr/bin/env sh
echo "data:$(file -b --mime-type "$1");base64,$(base64 "$1")"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment