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
| #!/usr/bin/env bash | |
| # @param string $1 | |
| # Input string. | |
| # @param int $2 | |
| # Cut an amount of characters from left side of string. | |
| # @param int [$3] | |
| # Leave an amount of characters in the truncated string. | |
| substr() | |
| { |
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
| if (!document.querySelectorAll) { | |
| document.querySelectorAll = function (selectors) { | |
| var style = document.createElement('style'), elements = [], element; | |
| document.documentElement.firstChild.appendChild(style); | |
| document._qsa = []; | |
| style.styleSheet.cssText = selectors + '{x-qsa:expression(document._qsa && document._qsa.push(this))}'; | |
| window.scrollBy(0, 0); | |
| style.parentNode.removeChild(style); |
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
| /** | |
| * __defineGetter__ - IE9+ | |
| * new Error - IE10+ | |
| */ | |
| window.__defineGetter__('__FILE__', function() { | |
| return (new Error).stack.split('/').slice(-1).join().split('.')[0]; | |
| }); | |
| console.log(__FILE__); // js_filename |
NewerOlder