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 | |
| function compressJS($rawjs) { | |
| $replace = [ | |
| "/\/\*[\s\S]*?\*\//" => '', //remove nultile line comment | |
| "/\/\/.*$/" => '', //remove single line comment | |
| '#[\r\n]+#' => "\n", // remove blank lines and \r's | |
| '#\n([ \t]*//.*?\n)*#s' => "\n", // strip line comments (whole line only) | |
| '#([^\\])//([^\'"\n]*)\n#s' => "\\1\n", | |
| '#\n\s+#' => "\n", // strip excess whitespace |
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 | |
| # | |
| # Script to create MySQL db + user | |
| # | |
| # @author Raj KB <magepsycho@gmail.com> | |
| # @website http://www.magepsycho.com | |
| # @version 0.1.0 | |
| ################################################################################ |
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
| /** | |
| * Получение минимальной цены товара в категории | |
| * | |
| * @file catalog/models/product.php | |
| * @param $category_id | |
| * @return int | |
| */ | |
| public function getMinPriceFromCategory($category_id) | |
| { | |
| $sql = 'SELECT MIN(' . DB_PREFIX . 'product.price) FROM ' . DB_PREFIX . 'product LEFT JOIN ' . |
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 | |
| include 'config.php'; | |
| $mysqli = new mysqli('DB_HOSTNAME', 'DB_USERNAME', 'DB_PASSWORD', 'DB_DATABASE'); | |
| $sqlChar = 'utf8'; | |
| if ($mysqli->connect_errno) { | |
| echo "Извините, возникла проблема на сайте"; | |
| exit; | |
| } |
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
| <div id="google-tr"> | |
| <div id="google_translate_element"></div> | |
| <script> | |
| function googleTranslateElementInit() { | |
| new google.translate.TranslateElement({ | |
| pageLanguage: 'cs' | |
| }, 'google_translate_element'); | |
| } | |
| </script> | |
| <script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> |
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
| (function($) { | |
| $.fn.invisible = function() { | |
| return this.each(function() { | |
| $(this).css("visibility", "hidden"); | |
| }); | |
| }; | |
| $.fn.visible = function() { | |
| return this.each(function() { | |
| $(this).css("visibility", "visible"); | |
| }); |
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
| @function mapReverse ($map) { | |
| $result: null; | |
| @if type-of($map) == "map" { | |
| $keys: map-keys($map); | |
| $map-reversed: (); | |
| @for $i from length($keys) through 1 { | |
| $map-reversed: map-merge( | |
| $map-reversed, |
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
| /** | |
| * Calculate a 32 bit FNV-1a hash | |
| * Found here: https://gist.github.com/vaiorabbit/5657561 | |
| * Ref.: http://isthe.com/chongo/tech/comp/fnv/ | |
| * | |
| * @param {string} str the input value | |
| * @param {boolean} [asString=false] set to true to return the hash value as | |
| * 8-digit hex string instead of an integer | |
| * @param {integer} [seed] optionally pass the hash of the previous chunk | |
| * @returns {integer | string} |
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 | |
| # bash generate random alphanumeric string | |
| # | |
| # bash generate random 32 character alphanumeric string (upper and lowercase) and | |
| NEW_UUID=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1) | |
| # bash generate random 32 character alphanumeric string (lowercase only) | |
| cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | head -n 1 |