Last active
August 29, 2015 13:56
Revisions
-
lakenen revised this gist
Feb 5, 2014 . 1 changed file with 4 additions and 2 deletions.There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,13 @@ function dkc(fn) { var k1 = 28978765259, k2 = 132455748307, kys = [], chk = function (event) { kys.push(event.keyCode); if (kys.length > 11) { kys.shift(); } if (k1 *k2 === parseInt(kys.join(''), 10)) { fn(); } }; -
lakenen created this gist
Feb 5, 2014 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ function dkc(fn) { var kys = [], chk = function (event) { kys.push(event.keyCode); if (kys.length > 11) { kys.shift(); } if (3.8384040373937394e+21 === parseInt(kys.join(''), 10)) { fn(); } }; window.addEventListener('keydown', chk); return { stop: function () { window.removeEventListener('keydown', chk); } }; }