(☞ຈل͜ຈ)☞ Главная  Статьи  Загрузчик Домой

Ok!
Ok!
171
http://example.com/?_ym_debug=1
метрика, counter test, проверка12300Проверка счетчиков и событий метрики в консоли
170
/bitrix/admin/perfmon_table.php?PAGEN_1=1&SIZEN_1=20&lang=ru&table_name=b_event&by=DATE_INSERT&order=desc
битрикс, отправленные письма11020Список отправленных писем в Битрикс
169
/* javascript url кодирует сорсы всех картинок */
    var arr = document.querySelectorAll('img')

    arr.forEach(function(item, i, arr) {
        var uri = arr[i].src;
        var encoded = encodeURI(uri);
        arr[i].src = encoded;
    });
urlencode, имена картинок10090url кодировать все файлы картинок javascript
168
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' );

function custom_override_checkout_fields( $fields ) {
    //unset($fields['billing']['billing_first_name']);// имя
    unset($fields['billing']['billing_last_name']);// фамилия
    unset($fields['billing']['billing_company']); // компания
    unset($fields['billing']['billing_address_1']);//
    unset($fields['billing']['billing_address_2']);//
    unset($fields['billing']['billing_city']);
    unset($fields['billing']['billing_postcode']);
    unset($fields['billing']['billing_country']);
    unset($fields['billing']['billing_state']);
    //unset($fields['billing']['billing_phone']);
    //unset($fields['order']['order_comments']);
    //unset($fields['billing']['billing_email']);
    //unset($fields['account']['account_username']);
    //unset($fields['account']['account_password']);
    //unset($fields['account']['account_password-2']);


    unset($fields['billing']['billing_company']);// компания
    unset($fields['billing']['billing_postcode']);// индекс
    return $fields;
}
woocommerce, лишние поля3400Удалить лишние поля для оформления заказа на woocommerce
167
document.addEventListener("DOMContentLoaded", function (event) {
    setTimeout(function() {
        document.querySelectorAll('*').forEach.call(
            document.querySelectorAll('img[data-src]'),
            function (img) {
                img.setAttribute('src', img.getAttribute('data-src'));
                img.onload = function () {
                    img.removeAttribute('data-src');
                };
            });
    },200);
});
отложенная, загрузка120Отложенная загрузка изображений
166
<script>
    document.addEventListener("touchstart", function(e) {
        console.log(e.defaultPrevented);  // will be false
        e.preventDefault();   // does nothing since the listener is passive
        console.log(e.defaultPrevented);  // still false
    }, Modernizr.passiveeventlisteners ? {passive: true} : false);
</script>
touchstart,passive,js100Пассивный ивент листнер
165
<link rel="canonical" href="<?= substr(strtolower($_SERVER['REQUEST_URI']), 0, strrpos($_SERVER['REQUEST_URI'], '/') + 1) ?>"/>
каноникал, canoncal90Сделать rel каноникал в php
164
for messages_count in range(0, 100):
    remainder = messages_count % 10
    if messages_count == 0:
        print('У вас нет новых сообщений')
    elif messages_count == 1 or (remainder == 1 and messages_count > 11):
        print('У вас ' + str(messages_count) + ' новое сообщение')
    elif (messages_count >= 2 and messages_count <= 4) or (remainder > 1 and remainder < 5 and messages_count > 20):
        print('У вас ' + str(messages_count) + ' новых сообщения')
    else:
        print('У вас ' + str(messages_count) + ' новых сообщений')
склонения чисел120Если 2, 3 или 4 – то сообщения, иначе сообщений
163
function string_clip($string, $length)
{
    $string = preg_replace( "/
|
/", "", strip_tags($string));
    $string = explode(" ", $string);
    $string = array_slice($string, 0, $length);
    return implode(" ", $string);
}
crop string1390Обрезать текст по числу слов
162
li:not(:last-child):not(:first-child)
ни первый ни послеадний, css 100200ни первый ни послеадний из скписка
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26