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
var btn = $('#set_filter_price'); | |
var myVar = setInterval(function(){ | |
checkBtnFilter(); | |
}, 50); | |
function checkBtnFilter() { | |
if(!btn.prop('disabled')){ | |
btn.click(); | |
//console.log(btn) |
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 | |
// Взято с http://thisis-blog.ru/elementi-highload-bloka/#compl | |
// подключаем пространство имен класса HighloadBlockTable и даём ему псевдоним HLBT для удобной работы | |
use Bitrix\Highloadblock\HighloadBlockTable as HLBT; | |
//подключаем модуль highloadblock | |
CModule::IncludeModule('highloadblock'); | |
//Напишем функцию получения экземпляра класса: |
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 | |
/* | |
$cp = $this->__component; // объект компонента | |
if (is_object($cp)) { | |
$cp->arResult['NAV_RESULT'] = $arResult['NAV_RESULT']; | |
$cp->SetResultCacheKeys(Array('NAV_RESULT')); | |
} | |
*/ | |
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 | |
/** | |
* Преобразование количества "цифрой" в количество "словом" | |
* Чтобы было удобнее формировать массивы со склонениями, запомните ряд чисел 1-2-5, | |
* а потом мысленно подставляйте их в массив: (один "рубль", два "рубля", пять "рублей") | |
* $num = 3; | |
* $words = array('новость', 'новости', 'новостей'); | |
* echo $num . ' ' . num2word($num, $words); // сколько новостей | |
* | |
* @param $n |
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
# Redirect from index.php to / | |
RewriteCond %{THE_REQUEST} index.php [NC] | |
RewriteCond %{REQUEST_URI} !/bitrix/admin/.* [NC] | |
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,NE,L] |
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 | |
function convertPHPSizeToBytes($sSize) | |
{ | |
if ( is_numeric( $sSize) ) { | |
return $sSize; | |
} | |
$sSuffix = substr($sSize, -1); | |
$iValue = substr($sSize, 0, -1); | |
switch(strtoupper($sSuffix)){ | |
case 'P': |
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 | |
function formatBytes($bytes, $precision = 2) | |
{ | |
$base = log($bytes, 1024); | |
$suffixes = array('', 'Кбайт', 'Мбайт', 'Гбайт', 'Тбайт'); | |
return round(pow(1024, $base - floor($base)), $precision) .' '. $suffixes[floor($base)]; | |
} | |
if(is_numeric($aProps['cr_pdf']['VALUE'])){ |
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
// Disable scroll zooming and bind back the click event | |
var onMapMouseleaveHandler = function (event) { | |
var that = $(this); | |
that.on('click', onMapClickHandler); | |
that.off('mouseleave', onMapMouseleaveHandler); | |
//that.find('iframe').css("pointer-events", "none"); | |
that.find('#map-wrapper').css("pointer-events", "none"); | |
} |
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
/** | |
* Adding the cluster icon to the dom. | |
* @ignore | |
*/ | |
ClusterIcon.prototype.onAdd = function() { | |
this.div_ = document.createElement('DIV'); | |
if (this.visible_) { | |
var pos = this.getPosFromLatLng_(this.center_); | |
this.div_.style.cssText = this.createCss(pos); |
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 | |
/* | |
http://wp-kama.ru/question/php-usort-sortirovka-massiva-po-dvum-polyam | |
* Сортировка массива по двум параметрам с помощью usort() | |
*/ | |
function _usort_object_by_time_ms($a, $b){ | |
// поля по которым сортировать | |
$array = array( 'laps'=>'desc', 'time_ms'=>'asc' ); |