Skip to content

Instantly share code, notes, and snippets.

@Rajeshr34
Last active November 30, 2016 08:08
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 Rajeshr34/eddc27ef6ff89adb6aa07326f4d5ca81 to your computer and use it in GitHub Desktop.
Save Rajeshr34/eddc27ef6ff89adb6aa07326f4d5ca81 to your computer and use it in GitHub Desktop.
FontAwesome To Android XML Array String CheatSheet
// Vist "http://fontawesome.io/cheatsheet/" then Run this in Console
var container = $('.container .page-header').parents('.container');
var ix = "";
container.find('.row > div').each(function(i, e) {
$(e).find('i').remove();
$(e).find('.text-muted.pull-right').remove();
let result = $.trim($(e).text()).replace(/(\s|\(alias\))+/g, " ");
ix += "," + result;
})
var output = "";
var ixSplit = ix.split(",");
for (ii = 0; ii <= ixSplit.length; ii++) {
var ixx = ixSplit[ii];
if (ixx) {
var ixxSplit = ixx.split(" ");
var result__ = ixxSplit[1].replace(/^\[/g, "");
result__ = result__.replace(/]$/g, "");
output += '<string name="'+ixxSplit[0].replace(/-/g, "_")+'">'+result__+'</string>'+"\n";
}
}
console.log(output);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment