This file contains 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
function isset_get(v){ | |
if(typeof v === 'undefined'){ | |
return ''; | |
} else if( typeof v === 'object' && v === null || typeof v === 'object' && Object.keys(v).length === 0){ | |
return ''; | |
} else if( v instanceof Array && v.length === 0){ | |
return ''; | |
} else if (typeof v === 'number' && isNaN(v)){ | |
return ''; | |
} |
This file contains 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
function isset(v){ | |
if(typeof v === 'undefined'){ | |
return false; | |
} else if( typeof v === 'object' && v === null || typeof v === 'object' && Object.keys(v).length === 0){ | |
return false; | |
} else if( v instanceof Array && v.length === 0){ | |
return false; | |
} else if (typeof v === 'number' && isNaN(v) ){ | |
return false; | |
} |
This file contains 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
wp_enqueue_style( 'style', get_template_directory_uri() . '/style.css', array(), filemtime( get_theme_file_path('/style.css')) ); | |
wp_enqueue_script( 'app', get_template_directory_uri() . '/js/app.js', array(), filemtime( get_theme_file_path('/js/app.js')), true ); |
This file contains 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
# Fail2ban configuration file | |
# | |
# Author: zEvilz <zevilz13@yandex.ru> | |
# | |
[INCLUDES] | |
before = iptables-common.conf | |
[Definition] |
This file contains 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
#!/bin/bash | |
dr=$1 | |
set_user=$2 | |
set_group=$3 | |
zDir="latest-ru_RU.zip" | |
wpInstall="https://ru.wordpress.org/"$zDir | |
eval "mkdir -p "$dr" && cd "$dr" && wget "$wpInstall" && unzip "$zDir" && cp -r "$dr"/wordpress/* "$dr" && rm -rf "$dr"/wordpress && rm -f -r "$zDir" && chown -R "$set_user":"$set_group" "$dr" && find "$dr" -type d -exec chmod 0755 {} \; && find "$dr" -type f -exec chmod 0644 {} \; && echo WordPress installation in directory "$dr" is done. " |
This file contains 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
global.timer_start = {}; //if browser replace all to window.timer_start | |
const jr = { //if browser js replace 'const' to 'var' | |
timer: { | |
start: function(timer_name) { | |
global.timer_start[timer_name] = new Date().getTime(); | |
}, | |
stop: function(timer_name) { | |
var timer_stop = new Date().getTime(); | |
var out = timer_stop - global.timer_start[timer_name]; |
This file contains 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
function each_table_td( selector, td_num, find_regexp, replace_regexp, replace_mask, _e){ | |
_e = {}; | |
$( selector ).each(function(index_1, el) { | |
_e.num = 0; | |
$(el).find('tr td').each(function(index_2, el_2) { | |
_e.num++; | |
if ( (_e.num % td_num) === 0) { | |
_e.td = $(this).html(); | |
//$(this).addClass('this_test'); | |
if (find_regexp.test(_e.td)){ |
This file contains 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 | |
//### STYLES | |
function include_style( $style_name, $file, $array = '', $is_child){ | |
if( $is_child || $is_child == 'child'){ | |
$file_uri = get_stylesheet_directory_uri() . $file; | |
$file_path = get_stylesheet_directory() . $file; | |
} else { | |
$file_uri = get_template_directory_uri() . $file; | |
$file_path = get_template_directory() . $file; |
This file contains 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
function find_replace(selector, attr, find, replace, v){ | |
v = {}; | |
$(selector).each(function(){ | |
v.img_src = $(this).attr(attr); | |
v.out = v.img_src.replace(find, replace); | |
$(this).attr(attr, v.out); | |
}); | |
} | |
find_replace('img', 'src', /site.ru/i, '127.0.0.1'); |
This file contains 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 | |
$currentCatId = '1,2'; | |
function is_var_ok( $var, $reg ){ | |
if(isset($reg)){ | |
$is_filter_ok = $reg; | |
} else { | |
$is_filter_ok = '#^[0-9,\s]+$#'; //проверка на вхождения в струку только 0-9 запятой и пробелов |
NewerOlder