22 марта 2021 Нет комментариев
mysqladmin processlist -u<user> -p<password> | awk '$2 ~ /^[0-9]/ {print "KILL "$2";"}' | mysql -u<user> -p<password>
Categories: MySQL Tags:
11 марта 2021 Нет комментариев

Для латиницы функция ucfirst
Для utf-8:

function ucfirst_utf8($str){
	return mb_strtoupper(mb_substr($str,0,1)).mb_substr($str,1);
}
echo ucfirst_utf8("предложение с большой буквы");
Categories: PHP Tags:
25 февраля 2021 Нет комментариев
$('textarea').each(function(){
	var len=$(this).val().length;
	if(len>220){
		$(this).css('border-color','red');
	}
});
$('textarea').on("keyup",function(event){
	var len=$(this).val().length;
	$(this).next('span').html(len);
	if(len>220){
		$(this).css('border-color','red');
	}
	else{
		$(this).css('border-color','#c5c5c5');
	}
});
Categories: Javascript Tags:
20 февраля 2021 Нет комментариев
var region_id=$('select[name=city] option:selected').data('region');
var region_pay=[10,20,1,76,77,6,55,59,13];
if(region_pay.includes(region_id))){
}
Categories: Javascript Tags:
16 февраля 2021 Нет комментариев
$result=array_diff($all_files,$current_files);
Categories: PHP Tags:
11 февраля 2021 Нет комментариев

Чтобы выполнить следующее действие полсе завершения fadeOut

$('.catalog .item').hover(function(){
	$(this).find('source').remove();
	var photo2=$(this).data('photo2');
	if(photo2!=''){
		var img=$(this).find('.photo a img');
		img.fadeOut(400,function(){
			img.attr('src',photo2);
			img.fadeIn(400);
		});
	}
},function(){
	var photo1=$(this).data('photo');
	if(photo1!=''){
		var img=$(this).find('.photo a img');
		img.fadeOut(400,function(){
			img.attr('src',photo1);
			img.fadeIn(400);
		});
	}
});

вместо

$('.catalog .item').hover(function(){
	$(this).find('source').remove();
	var photo2=$(this).data('photo2');
	if(photo2!=''){
		$(this).find('.photo a img').fadeOut(400).attr('src',photo2).fadeIn(400);
	}
},function(){
	var photo1=$(this).data('photo');
	if(photo1!=''){
		$(this).find('.photo a img').fadeOut(400).attr('src',photo1).fadeIn(400);
	}
});
Categories: Javascript Tags:
3 февраля 2021 Нет комментариев
$(document).on('click','.addresses .delete a',function(){
	$(this).closest('.address').remove();
	return false;
});

вместо:

$('.addresses .delete a').on('click',function(){
	$(this).closest('.address').remove();
	return false;
});
Categories: Javascript Tags: