Skip to content

Instantly share code, notes, and snippets.

@DDoS
Last active October 21, 2017 16:49
Show Gist options
  • Save DDoS/5b32654662080c44f8081a12112bee81 to your computer and use it in GitHub Desktop.
Save DDoS/5b32654662080c44f8081a12112bee81 to your computer and use it in GitHub Desktop.
// Readable
fetch("https://raw.githubusercontent.com/DDoS/sprite-icons/master/output/icons.json")
.then(res => res.json())
.then((icons) => {
for (key in icons) {
localStorage[key.replace("id", "icon")] = icons[key].url;
}
});
// Compressed
fetch("https://raw.githubusercontent.com/DDoS/sprite-icons/master/output/icons.json").then(r=>r.json()).then((i)=>{for(k in i){localStorage[k.replace("id","icon")]=i[k].url;}});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment