Skip to content

Instantly share code, notes, and snippets.

@brianarn
Last active October 24, 2018 16:11
Show Gist options
  • Select an option

  • Save brianarn/8a15cdd7a6b26c55fb499aa1507bf476 to your computer and use it in GitHub Desktop.

Select an option

Save brianarn/8a15cdd7a6b26c55fb499aa1507bf476 to your computer and use it in GitHub Desktop.

Revisions

  1. brianarn revised this gist Oct 24, 2018. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -4,4 +4,6 @@ A colleague took a Shrek image, sliced it into 100 emojis, and put it in our Sla

    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.
    Here is that gross bit of art.

    If you'd like to see an example, look at the screenshot in [this tweet](https://twitter.com/brianarn/status/1055129491821879296).
  2. brianarn created this gist Oct 24, 2018.
    7 changes: 7 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    # 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.
    10 changes: 10 additions & 0 deletions this-is-gross.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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;
    }, ''));