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
/* | |
* Код помещается в консоль браузера для отладки кастомных JS событий битрикс. | |
*/ | |
BX.onCustomEvent = function(eventObject, eventName, arEventParams, secureParams) { | |
var result = { | |
'eventObject': eventObject, | |
'eventName': eventName, | |
'arEventParams': arEventParams, | |
'secureParams': secureParams |
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
<IfModule headers_module> | |
Header set X-FRAME-OPTIONS "SAMEORIGIN" | |
Header set Content-Security-Policy "frame-ancestors 'self' https://example.com/" | |
</IfModule> |
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
# Show files list, opened by process | |
ls -l /proc/<PROCESS ID>/fd |
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
<? | |
/* | |
* Add to /local/php_interface/init.php | |
*/ | |
use Bitrix\Main\Diag\Debug; | |
function custom_mail($to, $subject, $message, $additional_headers, $additional_parameters) { | |
$fields = array( |
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
<? | |
## /bitrix/components/bitrix/socialnetwork.blog.post.edit/post.ajax.php 51 строка | |
function getBizprocList() | |
{ | |
$lists = CIBlock::getList( | |
array("SORT" => "ASC","NAME" => "ASC"), | |
array("ACTIVE" => "Y","TYPE" => COption::GetOptionString("lists", "livefeed_iblock_type_id"), 'SITE_ID' => $siteId) | |
); | |
while($list = $lists->fetch()) |
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
while ! sshpass -p 'password' rsync --partial --append-verify --progress -a ./filemask* remoteuser@remotehost:/path/; do sleep 5; 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
<? | |
$userCrmTabSettingsTmp = get_object_vars( | |
json_decode( | |
\CUserOptions::GetOption( | |
'ui', | |
'crm_control_panel_menu', | |
'', | |
$userId | |
)['settings'] | |
) |
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
<? | |
// Only letters, spaces and numbers | |
$str = preg_replace('/[^a-zа-яё\d\s]+/iu', '', $str); |
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
/** | |
* Add autoincrement id | |
* | |
* @return bool|int|mixed | |
*/ | |
public function autoincrement(){ | |
if (!$this->collectionName()) { | |
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
/** | |
* Add timestamps on create and update records | |
* | |
* @return array | |
*/ | |
public function behaviors() | |
{ | |
return [ | |
[ | |
'class' => TimestampBehavior::class, |
OlderNewer