Skip to content

Instantly share code, notes, and snippets.

View incodemode's full-sized avatar

Luis Deleon incodemode

View GitHub Profile
@incodemode
incodemode / flags-sprites.bash
Last active September 15, 2019 22:18
transform flags from https://github.com/lipis/flag-icon-css to a sprite of 20x13 with class fl-{countrycode} this is the size used by wikipedia
#download and unzip https://github.com/lipis/flag-icon-css
cd flags/4x3
mkdir result
convert *.svg -resize '20x13' -set filename:base "%[basename]" "%[filename:base].png"
glue-sprite -s ./ -o result/ --sprite-namespace "fl" --namespace ""
convert result/4x3.png -quality 50 result/4x3.jpg
sed "s|4x3.png|4x3.jpg|g" result/4x3.css
#img=$( base64 -w 0 result/4x3.jpg )
# result css and png are in flags/4x3/result
@incodemode
incodemode / faopt.js
Last active September 15, 2019 22:22
font awesome optimizer
/* Instrutions
1.- Download fontawesom js separate files (solid, regular, brands...)
2.- Edit the variables accordingly
3.- Run the script to get the stripped js (repeat when needed) */
/* USES FIND-IN-FILE */
var fif = require('find-in-files');
var fs = require('fs');
/* CONFIG VARS */