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\Main\Loader::includeModule('crm'); | |
$companyId = 0; | |
$contactId = 0; | |
$arFields['COMPANY_BINDINGS'] = Bitrix\Crm\Binding\EntityBinding::prepareEntityBindings( | |
\CCrmOwnerType::Company, | |
[$companyId] | |
); | |
$contact = new \CCrmContact; |
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
#!/usr/bin/php | |
<?php | |
$mask = '/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/'; | |
while ($line = fgets(STDIN)) { | |
if (preg_match_all($mask, $line, $matches)) { | |
foreach ($matches[0] as $ip) { | |
echo $ip, PHP_EOL; | |
} |
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/sh | |
# The my private key can be get from https://tech.yandex.ru/keys/get/?service=trnsl | |
key="********************************************************" | |
# get selected text from active window | |
text="$(echo $(xsel -o) | sed "s/[\"\'<>]//g")" | |
# get translation from yandex | |
result="$(wget -qO - "https://translate.yandex.net/api/v1.5/tr.json/translate?key=$key&text=$text&lang=en-ru")" |
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
<? | |
//<title>Yandex</title> | |
/** @global CUser $USER */ | |
/** @global CMain $APPLICATION */ | |
use Bitrix\Currency, | |
Bitrix\Iblock, | |
Bitrix\Catalog; | |
IncludeModuleLangFile($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/catalog/export_yandex.php'); | |
set_time_limit(0); |
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
class ImNotifySettings | |
{ | |
protected $userId = null; | |
const CATEGORY = 'im'; | |
const OPTION = 'notify'; | |
public function __construct($userId) | |
{ | |
$userId = intval($userId); |