This file contains hidden or 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 characters
| #add 'node_modules' to .gitignore file | |
| git rm -r --cached node_modules | |
| git commit -m 'Remove the now ignored directory node_modules' | |
| git push origin master |
This file contains hidden or 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 characters
| var elements = [1, 5, 5, 3, 5, 2, 4]; | |
| for(var i = 0; i < elements.length; i++) { | |
| if (elements[i] == 5) { | |
| // delete item from array & decrement i | |
| elements.splice(i--, 1); | |
| } | |
| } |
This file contains hidden or 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 characters
| // LZW-compress a string | |
| function lzw_encode(s) { | |
| var dict = {}; | |
| var data = (s + "").split(""); | |
| var out = []; | |
| var currChar; | |
| var phrase = data[0]; | |
| var code = 256; | |
| for (var i=1; i<data.length; i++) { | |
| currChar=data[i]; |
This file contains hidden or 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 characters
| // @author http://stackoverflow.com/a/3437825/2337281 | |
| $(window).height(); // returns height of browser viewport | |
| $(document).height(); // returns height of HTML document (same as pageHeight in screenshot) | |
| $(window).width(); // returns width of browser viewport | |
| $(document).width(); // returns width of HTML document (same as pageWidth in screenshot) |
This file contains hidden or 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 characters
| // prevent zooming cross-browser with jquery | |
| // @author http://stackoverflow.com/a/31131948/2337281 | |
| $(document).keydown(function(event) { | |
| if (event.ctrlKey === true && (event.which == '61' || event.which == '107' || event.which == '173' || event.which == '109' || event.which == '187' || event.which == '189' ) ) { | |
| //alert('disabling zooming k'); | |
| event.preventDefault(); | |
| // 107 Num Key + | |
| // 109 Num Key - | |
| // 173 Min Key hyphen/underscor Hey |
This file contains hidden or 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 characters
| #!/bin/bash | |
| # | |
| # Watch current directory (recursively) for file changes, and execute | |
| # a command when a file or directory is created, modified or deleted. | |
| # | |
| # Written by: Senko Rasic <[email protected]> | |
| # | |
| # Requires Linux, bash and inotifywait (from inotify-tools package). | |
| # | |
| # To avoid executing the command multiple times when a sequence of |
This file contains hidden or 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 characters
| <?php | |
| /** | |
| * @version 0.1 | |
| * @author github.com/webolizzer | |
| * If you find it useful, you can buy me a coffee and a Kit-Kat @ paypal.me/webolizzer | |
| * Thank you! :) | |
| */ | |
| class pdfGenerator { |
NewerOlder