Skip to content

Instantly share code, notes, and snippets.

@dhoko
Last active August 29, 2015 14:05
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhoko/c810679812d0585ef08c to your computer and use it in GitHub Desktop.
Save dhoko/c810679812d0585ef08c to your computer and use it in GitHub Desktop.
Github Emoji emoticons
javascript:(function(){function doRequest(url,cb){cb=cb||function(){};var xhr=new XMLHttpRequest;var requestUrl=url;xhr.open("GET",requestUrl,true);xhr.onreadystatechange=function(){var status;var data;if(xhr.readyState==4){status=xhr.status;if(status==200){cb(JSON.parse(xhr.responseText))}}};xhr.send()}var body=["<style>ul {margin:0; padding:0; text-align:center} li { display: inline-block; vertical-align: top; list-style: none; background: #eee; margin: 2em; border: 1px solid rgb(217, 217, 217); width: 15%;}</style><ul><!--"];var figure='--><li><figure><img src="%img%" alt=""><figcaption><b>:%txt%:</b></figcaption></figure></li><!--';doRequest("https://api.github.com/emojis",function(data){for(var key in data){body.push(figure.replace("%txt%",key).replace("%img%",data[key]))}body.push("--></ul>");document.body.innerHTML=body.join("")});})();
@dhoko
Copy link
Author

dhoko commented Aug 26, 2014

@RomainMarecat
Copy link

😄 cool !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment