Skip to content

Instantly share code, notes, and snippets.

@avdyushin
Created July 11, 2016 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avdyushin/4604427bb70a6f20744af7039cd79fc0 to your computer and use it in GitHub Desktop.
Save avdyushin/4604427bb70a6f20744af7039cd79fc0 to your computer and use it in GitHub Desktop.
Covert paymentfont.css to Swift cases
#!/bin/sh
if [ -z $1 ]; then
echo "Usage: ${0} file"
exit -1
fi
cat $1 | \
grep .pf- | \
sed -e 's/.pf-//g' | \
sed -e 's/:before//g' | \
sed -e 's/-/_/g' | \
cat -n | \
awk '{printf("case %s = \"\\u{f\xf%03x}\"\n", $2, $1 - 1)}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment