Разделы
Теги | RSS © 2008 – 2022
Контакты
email:
skype:

amp-library - библиотека конвертирует HTML в AMP HTML


Пример использования
$ ./amp-console amp:convert sample-html/sample-html-fragment.html
$ ./amp-console amp:convert sample-html/several_errors.html --full-document

https://github.com/lullabot/amp-library

php-buffer - php скрипт чтения или создания бинарных данных


Пример: инициализировать буфер в виде потока ресурса
$fp = fopen('php://temp', 'w+b');
// или
$buffer = new \Nelexa\ResourceBuffer($fp);

https://github.com/Ne-Lexa/php-buffer

dontbug - обратный отладчик для php


Демо:

https://github.com/sidkshatriya/dontbug

Shave - js скрипт для обрезания много строчного текста


Shave - js скрипт для обрезания много строчного текста

https://dollarshaveclub.github.io/shave/

mFancyTitle - jquery плагин для анимации favicon и title


mFancyTitle - jquery плагин для анимации favicon и title

Пример использования
$.mFancyTitle({
        mftMissYou: true,
        mftMissYouTitle: 'Hey! I miss you!', // new document title: it will appear when the user leaves your page and open another tab in the browser
        mftMissYouFavicon: {
                'apple-touch-icon-precomposed': 'path-to/apple-touch-icon-152x152.png',
                'icon': 'path-to/favicon-32x32.png',
                'shortcut icon': 'path-to/favicon.ico'
        } // new favicons: they will be visible when the user leaves your page and open another tab in the browser
});

http://mft.musings.it/

abDetector - детектор адблока на чистом js


window.onload = function() {
        var iframe = document.createElement('iframe'),
                randomNum = Math.floor(Math.random() * (10000 - 123 + 1)) + 123,
                protocol = window.location.protocol;

        iframe.src = protocol +"//google.com/"+ randomNum +"/ads.html";
        iframe.height = ".1px";
        iframe.width = ".1px";
        iframe.id = 'some-ad';

        getRequest(iframe, function (response) { // On Success
                document.body.appendChild(iframe);
        }, function (xhr, status) { // On error
                if (status === 0) // Request aborted
                        document.body.appendChild(iframe);
        });

        setTimeout(function() {
                var someAd = document.getElementById('some-ad');
                if(someAd === null ||
                someAd.style.display == "none" ||
                someAd.style.display == "hidden" ||
                someAd.style.visibility == "hidden" ||
                someAd.offsetHeight === 0)
                        document.getElementById('ab-message').style.display = 'block';
                else
                        someAd.remove();
        }, 500);
};

function getRequest (iframe, success, error) {
        var xhr = XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
        xhr.open("GET", iframe.src);
        xhr.onreadystatechange = function(){
                if (xhr.readyState == 4)
                        if (xhr.status == 200) // Loaded successfully
                                success(xhr.responseText);
                        else // For any other error
                                error(xhr, xhr.status);
        };
        xhr.send();
}

https://github.com/R4meau/abDetector
«
1...101112131415161718...309
»
Вверх