Skip to content

Instantly share code, notes, and snippets.

View webislife's full-sized avatar
😜
Amazing

Denis webislife

😜
Amazing
View GitHub Profile
@webislife
webislife / isBot.js
Created November 15, 2018 18:57
Bot browser detect
/**
* Проверка по косвенным параметрам на бота\selenium\headless browser
* @function botDetection
* @return {Boolean} isBot flag
*/
botDetection () {
let isBot = false,
rules = [
//Phantomjs как правило, не имеет внутри себя браузерных плагинов
() => (navigator.plugins instanceof PluginArray) === false || navigator.plugins.length == 0,
@stephenharris
stephenharris / pre-tags-in-comments.php
Created August 12, 2013 15:07
Allow pre tags in comments
<?php
/**
* Allow 'pre' tags in comments.
* This is not by default allowed for users who cannot publish 'unfiltered_html'.
* Maybe this should go in WP-MarkDown?
*
*/
add_filter( 'wp_kses_allowed_html', 'myprefix_allow_pre_tags_in_comments', 10, 2 );
function myprefix_allow_pre_tags_in_comments( $tags, $context ){
if( 'pre_comment_content' == $context ){