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
| // "Подсвечиваем" выбранный метод доставки (добавляем класс .shipping-method--active) | |
| // #simplecheckout_shipping - ближайщий статический элемент, который не изменяется при выполнение aJax | |
| var activeInputShippingMethod = $('.shipping-method').find('input:checked'); | |
| var activeShippingMethod = activeInputShippingMethod.parents('.shipping-method'); | |
| activeShippingMethod.toggleClass('shipping-method--active'); | |
| $('#simplecheckout_shipping').on('change', '.shipping-method', function () { | |
| function lazySelectActiveItem_ShippingMethod(){ | |
| var activeInputShippingMethod = $('.shipping-method').find('input:checked'); | |
| var activeShippingMethod = activeInputShippingMethod.parents('.shipping-method'); |
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 | |
| private function exists($newEmployee) | |
| { | |
| foreach ($this->products as $product) { | |
| if ($product === $newEmployee) { // сравниваем через === | |
| return true; | |
| } | |
| } | |
| return false; | |
| } |
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
| Шаг 1: Переименовываем файл | |
| Нужно переименовать server.php в index.php в корневой директории laravel. | |
| Шаг 2: Обновляем .htaccess | |
| Просто скопируете файл .htaccess из папки public в корневую директорию проекта, и обновите его как показано ниже: | |
| Options -MultiViews -Indexes | |
| RewriteEngine On | |
| # Handle Authorization Header |
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
| найти все input, кроме inpit с #submit и отчистить значения. | |
| $('.email-layout').find('input:not(#submit)).val(''); |
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
| <button>button</button> | |
| <div>content</div> | |
| $(function(){ | |
| $("button").on("click", function(){ | |
| var _style = "<style>div { background: red;}</style>"; | |
| $("body").html($("body").html() + _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
| RewriteEngine on | |
| RewriteRule ^(.*)\.html $1\.php |
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
| # Original content | |
| # Path /ect/modules | |
| # *modules - file | |
| # systemctl status systemd-modules-load.service | |
| # /etc/modules: kernel modules to load at boot time. | |
| # | |
| # This file contains the names of kernel modules that should be loaded | |
| # at boot time, one per line. Lines beginning with "#" are ignored. |
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 | |
| $count = 5; // количество полей для загрузки файлов | |
| $i = 0; | |
| $path = './dir/'; // путь до папки куда сохранять, ./ считать от расположениея скрипта | |
| if (!is_dir($path)) { | |
| mkdir($path, 0777, true); | |
| } | |
| ?> |
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 | |
| # Protection from XSS | |
| function protectionXSS($rawData) | |
| { | |
| // Проверяем, что входящие данные являются массивом | |
| if (is_array($rawData)) { | |
| $preparedData = []; | |
| foreach ($rawData as $key => $value) { | |
| $preparedData[$key] = protectionXSS($value); | |
| } |
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 dumper($obj) | |
| { | |
| echo | |
| "<pre>", | |
| htmlspecialchars(dumperGet($obj)), | |
| "</pre>"; | |
| } |