Skip to content

Instantly share code, notes, and snippets.

@ngryman
Created June 24, 2018 14:02
Show Gist options
  • Select an option

  • Save ngryman/3ae53313e0667e9307586d105d1d257f to your computer and use it in GitHub Desktop.

Select an option

Save ngryman/3ae53313e0667e9307586d105d1d257f to your computer and use it in GitHub Desktop.

Revisions

  1. ngryman created this gist Jun 24, 2018.
    11 changes: 11 additions & 0 deletions create-gif.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    function createGif(width, height) {
    const b64wh = btoa(
    String.fromCharCode(width & 0xFF) +
    String.fromCharCode(width >> 8 & 0xFF) +
    String.fromCharCode(height & 0xFF) +
    String.fromCharCode(height >> 8 & 0xFF) +
    String.fromCharCode(0) +
    String.fromCharCode(0)
    )
    return `R0lGODlh${b64wh}ACwAAAAAAQABAAAC`
    }