Skip to content

Instantly share code, notes, and snippets.

View demoriz's full-sized avatar

Dmitriy demoriz

  • Saint Petersburg, Russia
View GitHub Profile
@demoriz
demoriz / .gitignore
Last active November 1, 2023 08:14
[.gitignore] #git
# Node artifact files
node_modules/
dist/
# Compiled Java class files
*.class
# Compiled Python bytecode
*.py[cod]
@demoriz
demoriz / new_site.sh
Last active October 25, 2022 14:04
[BitrixVM] #shell
tailf /opt/webdir/temp/site_create_1347145202/status
sh fpm.sh capitalan.profycode.pro 74
sh ssl.sh /home/bitrix/ext_www/capitalan.profycode.pro capitalan.profycode.pro
@demoriz
demoriz / cashe.sh
Last active October 5, 2022 13:36
[Laravel cache] #laravel #shell
php artisan -V
php artisan optimize:clear
php artisan make:model Bla
php artisan make:controller Bla --resource
php artisan schedule:run
php artisan route:list | grep bla
@demoriz
demoriz / index.php
Last active August 8, 2023 13:03
[iblock] работа с инфоблоком на d7 #bitrix #d7
<?php
$iblock = \Bitrix\Iblock\Iblock::wakeUp($intIblockId);
$strIblockClass = $iblock->getEntityDataClass();
// элемент
$arParams = array(
'select' => array('ID', 'NAME', 'ARTNUMBER_' => 'ARTNUMBER', 'MORE_PHOTO.FILE')
);
$arElement = \Bitrix\Iblock\Elements\ElementCatalogTable::getByPrimary($intElementId, $arParams)->fetch();
<?php
CModule::IncludeModule('iblock');
$iblockId = 5;
Bitrix\Iblock\PropertyIndex\Manager::DeleteIndex($iblockId);
Bitrix\Iblock\PropertyIndex\Manager::markAsInvalid($iblockId);
@demoriz
demoriz / resort.php
Last active August 5, 2018 09:21
[section resort] пересчёт margin в дереве разделов #bitrix
<?php
\Bitrix\Main\Loader::includeModule('iblock');
CIBlockSection::ReSort($intIblockId);
@demoriz
demoriz / command.bat
Created May 7, 2018 17:22
[repair] Восстановление системных файлов #windows
DISM.exe /Online /Cleanup-image /Restorehealth
sfc /scannow
@demoriz
demoriz / git.txt
Last active October 26, 2022 07:47
[git] commands #git
git checkout -b dev origin/dev
git pull --recurse-submodules
git reset --hard HEAD
git rm --cached bla
git push --force
git clean -fd
git push --set-upstream origin dev
@demoriz
demoriz / commands.sh
Last active May 16, 2024 12:43
linux server #shell
df -h
du -sh upload/
tar cfvz upload.tgz upload/ > /dev/null
tar cfvj upload.tbz2 upload/ > /dev/null
tar xfvz upload.tgz > /dev/null
tar xfvj upload.tbz2 > /dev/null
ssh-keygen -t ed25519 -C "mail@profycode.pro"
screen -S bla
@demoriz
demoriz / delayed_function.php
Created November 22, 2017 13:09
bitrix 'delayed function'
<?php
// from component
$this->SetViewTarget('mycontent');
echo 'bla';
$this->EndViewTarget();
// from other areas
$APPLICATION->AddViewContent('mycontent', 'bla');