Skip to content

Instantly share code, notes, and snippets.

@moimikey
Last active October 26, 2023 15:24
Show Gist options
  • Save moimikey/1e9498d58e316bc28d02a0a2a5313fc8 to your computer and use it in GitHub Desktop.
Save moimikey/1e9498d58e316bc28d02a0a2a5313fc8 to your computer and use it in GitHub Desktop.

Revisions

  1. moimikey revised this gist Oct 26, 2023. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions rick-roll.js
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ music = function() {
    var audio, formula;
    formula = '(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0][[0xd2d2c8,0xce4088,0xca32c8,0x8e4009][t>>14&3]>>(0x3dbe4688>>((t>>10&15)>9?18:t>>10&15)*3&7)*3&7]&255';
    audio = new Audio("data:audio/wav;base64," + (btoa(musicParse(formula))));
    return audio;
    return audio.play();
    };

    music.play();
    music();
  2. moimikey revised this gist Oct 26, 2023. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion rick-roll.js
    Original file line number Diff line number Diff line change
    @@ -8,7 +8,7 @@ music = function() {
    var audio, formula;
    formula = '(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0][[0xd2d2c8,0xce4088,0xca32c8,0x8e4009][t>>14&3]>>(0x3dbe4688>>((t>>10&15)>9?18:t>>10&15)*3&7)*3&7]&255';
    audio = new Audio("data:audio/wav;base64," + (btoa(musicParse(formula))));
    return audio.play();
    return audio;
    };

    music.play();
  3. Michael Scott Hertzberg created this gist Sep 25, 2019.
    14 changes: 14 additions & 0 deletions rick-roll.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    var music, musicParse;

    musicParse = function(f) {
    return eval("for(var t=0,S='RIFF_oO_WAVEfmt " + atob('EAAAAAEAAQBAHwAAQB8AAAEACAA') + "data';++t<3e5;)S+=String.fromCharCode(" + f + ")");
    };

    music = function() {
    var audio, formula;
    formula = '(t<<3)*[8/9,1,9/8,6/5,4/3,3/2,0][[0xd2d2c8,0xce4088,0xca32c8,0x8e4009][t>>14&3]>>(0x3dbe4688>>((t>>10&15)>9?18:t>>10&15)*3&7)*3&7]&255';
    audio = new Audio("data:audio/wav;base64," + (btoa(musicParse(formula))));
    return audio.play();
    };

    music.play();