Skip to content

Instantly share code, notes, and snippets.

@enapupe
Last active December 14, 2015 16:58
Show Gist options
  • Select an option

  • Save enapupe/5118556 to your computer and use it in GitHub Desktop.

Select an option

Save enapupe/5118556 to your computer and use it in GitHub Desktop.
#! /bin/sh
if [ $# -ne 2 ]
then
echo "Usage - $0 file-name"
exit 1
fi
if [ -f "$1.$2" ]
then
echo ".$1 {background-image:url('data:image/$2;base64,`cat $1.$2 | base64 -w 0 $1.$2 `')}" | xclip -selection clipboard
else
echo "Sorry, $1.$2 file does not exist"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment