Skip to content

Instantly share code, notes, and snippets.

@brianarn
Last active October 24, 2018 16:11
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 brianarn/8a15cdd7a6b26c55fb499aa1507bf476 to your computer and use it in GitHub Desktop.
Save brianarn/8a15cdd7a6b26c55fb499aa1507bf476 to your computer and use it in GitHub Desktop.
Generative Shrek Art in Slack

Generative Shrek Art in Slack

A colleague took a Shrek image, sliced it into 100 emojis, and put it in our Slack. You can easily tile it.

So, I wrote a super gross terse piece of JS to generate new ... images ... of Shrek using this random art.

Here is that gross bit of art.

If you'd like to see an example, look at the screenshot in this tweet.

counts = [];
for (var i = 1; i <= 100; i++) { counts.push(i); }
counts.sort((a,b)=> Math.floor(Math.random() * 3) - 1);
copy(counts
.map(num => num.toString().padStart(3, 0))
.map(pos => `:tiled_shrek${pos}:`)
.reduce((accum, curr, i) => {
if (i % 10 === 0) { curr = `\n${curr}`; }
return accum + curr;
}, ''));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment