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 filenameFull = "tm_icons.png"; | |
| //Regex to remove | |
| var filenameText = filenameFull.replace(/\.[^/.]+$/, ""); |
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 | |
| define('__SELF__', getcwd()); | |
| if (preg_match('/\.(?:png|jpg|jpeg|gif|js|css|html)$/', $_SERVER["REQUEST_URI"])) { | |
| $ext = pathinfo($_SERVER["REQUEST_URI"])['extension']; | |
| $extensions = [ | |
| 'js' => 'text/javascript', | |
| 'css' => 'text/css', |
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 | |
| $prefLocales = array_reduce( | |
| explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']), | |
| function ($res, $el) { | |
| list($l, $q) = array_merge(explode(';q=', $el), [1]); | |
| $res[$l] = (float) $q; | |
| return $res; | |
| }, []); | |
| arsort($prefLocales); |
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 ('serviceWorker' in navigator) { | |
| caches.keys().then(function(cacheNames) { | |
| cacheNames.forEach(function(cacheName) { | |
| caches.delete(cacheName); | |
| }); | |
| }); | |
| } |
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 | |
| /** | |
| * Generate a sequence of numbers for use in a pagination system, the clever way. | |
| * @author Bramus Van Damme <bramus@bram.us> | |
| * | |
| * The algorithm always returns the same amount of items in the sequence, | |
| * indepdendent of the position of the current page. | |
| * | |
| * Example rows generated: |
OlderNewer