Skip to content

Instantly share code, notes, and snippets.

View Feiron's full-sized avatar

Vadim Petrov Feiron

View GitHub Profile
@Feiron
Feiron / result_modifier.php
Last active July 20, 2021 11:39
[Image resize] #bitrix #examples #image
<?php
/**
* Images resize on the fly
**/
$arParams['THUMB']['width'] = 48;
$arParams['THUMB']['height'] = 48;
$arParams['PREVIEW_PICTURE']['height'] = 275;
$arParams['PREVIEW_PICTURE']['width'] = 350;
$arFilter = array("name" => "sharpen", "precision" => 90);
@Feiron
Feiron / ajax.php
Last active August 9, 2024 14:13
[Bitrix HXR] #bitrix #ajax
<?php
define('STOP_STATISTICS', true);
define('BX_SECURITY_SHOW_MESSAGE', true);
define("NO_KEEP_STATISTIC", true);
define("NO_AGENT_STATISTIC", true);
define("NOT_CHECK_PERMISSIONS", true);
require_once($_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/main/include/prolog_before.php');
use Bitrix\Main\Application;
@Feiron
Feiron / index.txt
Last active November 12, 2024 10:47
[MC] Guide #centos
http://www.softpanorama.org/OFM/MC/mc_tips.shtml
For directories history and whenever it is present Alt-y moves to the previous directory in the history, equivalent to clicking the < with the mouse.
[Alt-o] open in other panel
[Alt-u] moves to the next directory in the history, equivalent to clicking the > with the mouse.
[Alt-Shift-h, Alt-H] displays the directory history, equivalent to depressing the 'v' with the mouse.
[Alt-p, Alt-n] use these keys to browse through the command history. Alt-p takes you to the last entry, Alt-n takes you to the next one.
[Alt-h] displays the history for the current input line.
@Feiron
Feiron / dialogs.messagebox.js
Last active March 1, 2021 12:45
[Popup messages] Отправка сообщений битриксом #bitrix #ui
BX.UI.Dialogs.MessageBox.confirm("Message");
BX.UI.Dialogs.MessageBox.confirm("Message", () => {});
BX.UI.Dialogs.MessageBox.confirm("Message", () => {}, "Продолжить");
BX.UI.Dialogs.MessageBox.confirm("Message", () => {}, "Продолжить", () => {});
BX.UI.Dialogs.MessageBox.confirm("Message", "Title");
BX.UI.Dialogs.MessageBox.confirm("Message", "Title", () => {});
BX.UI.Dialogs.MessageBox.confirm("Message", "Title", () => {}, "Продолжить", () => {});
//https://dev.1c-bitrix.ru/api_d7/bitrix/ui/dialogs/dialogs.php
<?
$dbEvent = CCrmEvent::GetList([], ['ENTITY_TYPE' => 'CONTACT', 'ENTITY_ID' => 5896], 500);
echo '<pre>'; var_dump($dbEvent->SelectedRowsCount()); echo '</pre>';
while ($arEvent = $dbEvent->Fetch()){
$obEvent = new CCrmEvent();
echo '<pre>'; var_dump($arEvent['DATE_CREATE'] . ' ' . $arEvent['EVENT_NAME']); echo '</pre>';
$obEvent->Delete($arEvent['ID']);
}
@Feiron
Feiron / bitrix.sh
Last active October 9, 2025 11:58
Установка bitrix.sh #utils #centos #bitrixvm
wget http://repos.1c-bitrix.ru/yum/bitrix-env.sh
chmod +x bitrix-env.sh
./bitrix-env.sh
#centos 7
wget http://repos.1c-bitrix.ru/yum/bitrix-env-crm.sh && chmod +x bitrix-env-crm.sh && ./bitrix-env-crm.sh
#centos 9 stream
wget https://repo.bitrix.info/dnf/bitrix-env-9.sh && chmod +x bitrix-env-9.sh && ./bitrix-env-9.sh
@Feiron
Feiron / sendmail.sh
Last active March 29, 2024 11:52
Проверка почты #centos #tests #linux #email
echo -e "test message" | /usr/bin/msmtp --debug -t -i mail@mail.ru
printf "From: mail@localhost.ru\nSubject: test\ntest message" | /usr/bin/msmtp --debug -t -i mail@mail.ru
@Feiron
Feiron / network.sh
Last active March 31, 2021 13:07
[Network tips] #centos
curl https://api.ipify.org/ // IP
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/gateway // gw do
curl -s http://169.254.169.254/metadata/v1/interfaces/public/0/anchor_ipv4/address // ip do
@Feiron
Feiron / start.php
Last active June 9, 2021 11:20
[Testing BP создаем / выводим лог, оптционально удаляем все] #bitrix #bp
<?
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php");
$APPLICATION->SetTitle("Тестирование");
CModule::IncludeModule('gpw.testing');
CModule::IncludeModule('im');
CModule::IncludeModule('bizproc');
$iTemplateID = XXX;
@Feiron
Feiron / UFManager.php
Last active June 9, 2021 11:23
[UFManager] Example #bitrix #examples
<?
//UF MANAGER
//GET
//All fields for MY_SUBSCRIPTION object
$GLOBALS["USER_FIELD_MANAGER"]->GetUserFields(
"MY_SUBSCRIPTION",
$arResult["ID"],
LANGUAGE_ID
);