Skip to content

Instantly share code, notes, and snippets.

View SeRGei93's full-sized avatar

Sergei Stefanovich SeRGei93

View GitHub Profile
@SeRGei93
SeRGei93 / git hepler
Last active November 2, 2022 07:17
git hepler
#сбросить все измененния и откатится
git reset --hard HEAD
git clean -fd
#удалить файл из git
git rm -r --cached <path>
@SeRGei93
SeRGei93 / laravel help
Last active March 12, 2020 08:20
laravel help
#Плагины
https://github.com/barryvdh/laravel-ide-helper
https://github.com/barryvdh/laravel-debugbar
#Модели
php artisan make:model Models/BlogPost #создать модель
php artisan make:model Models/BlogPost -m #создать модель и миграцию для нее
#Очистить кеш
php artisan config:cache
@SeRGei93
SeRGei93 / товары со скидкой
Last active January 16, 2020 06:44
Битрикс получить товары со скидкой
<?
function getAllDiscounts()
{
Bitrix\Main\Loader::includeModule('sale');
require_once ($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/sale/handlers/discountpreset/simpleproduct.php");
$arDiscounts = array();
$arProductDiscountsObject = \Bitrix\Sale\Internals\DiscountTable::getList(array(
'filter' => array(
'=ACTIVE' => 'Y',
// 'ID' => 1231,
@SeRGei93
SeRGei93 / wp
Created March 19, 2018 20:14
wordpress
//*замена адрема после переноса
UPDATE wp_options SET option_value = REPLACE(option_value, 'http://ilyarrl2.beget.tech', 'http://re-wp.by') WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = REPLACE(guid, 'http://ilyarrl2.beget.tech','http://re-wp.by');
UPDATE wp_posts SET post_content = REPLACE(post_content, 'http://ilyarrl2.beget.tech', 'http://re-wp.by');
update_option( 'siteurl', 'http://ilyarrl2.beget.tech' );
update_option( 'home', 'http://ilyarrl2.beget.tech' );
//**замена адрема после переноса
@SeRGei93
SeRGei93 / Битрикс полезные функции
Last active February 8, 2023 13:06
Битрикс полезные функции
https://estrin.pw/bitrix-d7-snippets/s/current-user-is-authorized/
if(\Bitrix\Main\Engine\CurrentUser::get()->getId())
{}
\Bitrix\Main\Engine\CurrentUser::get()->isAdmin()
\Bitrix\Main\Engine\CurrentUser::get()->getLogin()
//лого без ссылки на главной
<? $isIndex = ($APPLICATION->GetCurPage(false) == SITE_DIR)?>
<?if (!$isIndex):?>