diff options
Diffstat (limited to '.functions')
-rw-r--r-- | .functions | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3,6 +3,11 @@ function md() { mkdir -p "$@" && cd "$@" } +# Create a data URL from an image (works for other file types too, if you tweak the Content-Type afterwards) +dataurl() { + echo "data:image/${1##*.};base64,$(openssl base64 -in "$1")" | tr -d '\n' +} + # Start an HTTP server from a directory, optionally specifying the port function server() { local port="${1:-8000}" |