Skip to content

Instantly share code, notes, and snippets.

@EscApp2
EscApp2 / gist:7e41e5b261290a6d4cbdc84abd30ad6b
Created July 8, 2026 12:03
Мед специальности
$specialtyToSchema = [
'стоматолог' => 'https://schema.org/Dentistry',
'имплантолог' => 'https://schema.org/Dentistry',
'ортодонт' => 'https://schema.org/Dentistry',
'гигиенист' => 'https://schema.org/Dentistry',
'пародонтолог' => 'https://schema.org/Dentistry',
'эндодонт' => 'https://schema.org/Dentistry',
'травматолог' => 'https://schema.org/Musculoskeletal',
'ортопед' => 'https://schema.org/Musculoskeletal',
'хирург' => 'https://schema.org/Surgical',
@EscApp2
EscApp2 / help.txt
Created June 19, 2026 14:53
change rights after git
.git/hooks/post-merge
#!/bin/bash
TARGET_DIR="XXXXXXXXXXXXXX"
echo "[post-merge] Updating permissions and ownership in $TARGET_DIR"
echo "[post-merge] Excluding some directories"
<?
$PERM["personal"]["8"]="W";
$PERM["catalog"]["8"]="W";
$PERM["news"]["8"]="W";
$PERM["about"]["8"]="W";
$PERM["index.php"]["8"]="W";
$PERM["/"]["*"]="R";
?>
@EscApp2
EscApp2 / init.php
Created February 17, 2026 07:34
generate Unique Code
<?
AddEventHandler("iblock", "OnStartIBlockElementUpdate", "generateUniqueCode",10);
AddEventHandler("iblock", "OnStartIBlockElementAdd", "generateUniqueCode",10);
function generateUniqueCode(&$arFields){
$IBLOCK_ID = $arFields['IBLOCK_ID'];
if($IBLOCK_ID == 17){
if(array_key_exists('CODE',$arFields)) {
@EscApp2
EscApp2 / script.js
Last active September 30, 2025 10:54
Фиксируем плавающую панель сайта и панель админки Битрикса (Fixed Bitrix panel, bx-panel)
/*
https://gist.github.com/lekomtsev/d7fe3bfad8f42307fa2149e0816f3740
*/
var winWidth = function() {
var w = 0;
// IE
if (typeof( window.innerWidth ) != 'number') {
@EscApp2
EscApp2 / init.php
Created September 29, 2025 08:43
OnAfterIBlockElementChange
<?
if(!function_exists('BXIBlockAfterSave')){
function BXIBlockAfterSave($arFields){
foreach (GetModuleEvents("iblock", "OnBXIBlockAfterSave", true) as $arEvent){
ExecuteModuleEventEx($arEvent, array($arFields));
}
}
}
@EscApp2
EscApp2 / init.php
Created June 6, 2025 14:54
breadcrumbs schema.org
<?
AddEventHandler("main", "OnEndBufferContent", "AddMicrodataBreadCrumbs",99999);
function AddMicrodataBreadCrumbs(&$content){
global $APPLICATION;
if(defined('ADMIN_SECTION')){
return true;
}
\Bitrix\Main\Loader::IncludeModule("form");
CForm::GetResultAnswerArray($WEB_FORM_ID,
$arrColumns,
$arrAnswers,
$arrAnswersVarname,
array());
$arFormResult = array();
$is_filtered = null;
https://web.archive.org/web/20221130164938/https://fancyapps.com/docs/ui/fancybox/events
@EscApp2
EscApp2 / init.php
Last active August 11, 2026 06:15
getElementInComplexComponent VARIABLES getSectionInComplexComponent
<?
if(!function_exists('getElementInComplexComponent')){
function getElementInComplexComponent($arResult, $arParams, $arSelect = array()){
$arFilter = array(
"IBLOCK_ID" => $arParams["IBLOCK_ID"],
"ACTIVE" => "Y",
"GLOBAL_ACTIVE" => "Y",
);
if (0 < intval($arResult["VARIABLES"]["SECTION_ID"]))