Skip to content

Instantly share code, notes, and snippets.

View yaleksandr89's full-sized avatar
💭
Debes, ergo potes

Александр Юрченко yaleksandr89

💭
Debes, ergo potes
View GitHub Profile
// "Подсвечиваем" выбранный метод доставки (добавляем класс .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');
<?php
private function exists($newEmployee)
{
foreach ($this->products as $product) {
if ($product === $newEmployee) { // сравниваем через ===
return true;
}
}
return false;
}
Шаг 1: Переименовываем файл
Нужно переименовать server.php в index.php в корневой директории laravel.
Шаг 2: Обновляем .htaccess
Просто скопируете файл .htaccess из папки public в корневую директорию проекта, и обновите его как показано ниже:
Options -MultiViews -Indexes
RewriteEngine On
# Handle Authorization Header
найти все input, кроме inpit с #submit и отчистить значения.
$('.email-layout').find('input:not(#submit)).val('');
<button>button</button>
<div>content</div>
$(function(){
$("button").on("click", function(){
var _style = "<style>div { background: red;}</style>";
$("body").html($("body").html() + _style);
})
})
RewriteEngine on
RewriteRule ^(.*)\.html $1\.php
# 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.
<?php
$count = 5; // количество полей для загрузки файлов
$i = 0;
$path = './dir/'; // путь до папки куда сохранять, ./ считать от расположениея скрипта
if (!is_dir($path)) {
mkdir($path, 0777, true);
}
?>
<?php
# Protection from XSS
function protectionXSS($rawData)
{
// Проверяем, что входящие данные являются массивом
if (is_array($rawData)) {
$preparedData = [];
foreach ($rawData as $key => $value) {
$preparedData[$key] = protectionXSS($value);
}
<?php
## Функция для вывода содержимого переменной.
// Распечатывает дамп переменной на экран.
function dumper($obj)
{
echo
"<pre>",
htmlspecialchars(dumperGet($obj)),
"</pre>";
}