Для проектов среднего и небольшого размера не всегда оправданно использовать AWS/Kubernetes подобную технологию. Для проектов нуждающихся в нескольких серверах отлично подходит Digital ocean. Который к тому же предоставляет средства вертикального скейлинга(увеличение производительной мощности уже существующих серверов).
Создаем сертификат под которым будем логинится на сервера нашего проекта (на локальной машине)
ssh-keygen -t rsa -b 4096 -f /Users/alex/.ssh/myproject_test -C "myproject comment"
Не забываем сделать его бекап
This file contains hidden or 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
<?php | |
namespace Burov\Handlers; | |
use Bitrix\Main\Loader; | |
use Bitrix\Sale\Location; | |
use Bitrix\Main\GroupTable; | |
/** |
This file contains hidden or 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
<?php | |
/** | |
* Добавление кастомного условия для скидок. | |
* Подключить данный файл в init.php | |
* | |
* В данном примере устанавливается проверка города сохраненного в сессии | |
*/ | |
use Bitrix\Main\Loader; | |
Loader::includeModule('catalog'); |
This file contains hidden or 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
use Bitrix\Main\Application; | |
use Bitrix\Main\Entity\Base; | |
if (!Application::getConnection()->isTableExists(Base::getInstance('\Namespace\OrmNameTable')->getDBTableName())) { | |
Base::getInstance('\Namespace\OrmNameTable')->createDBTable(); | |
} |
This file contains hidden or 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
for f in $(find deploy/templates -regex '.*\.ya*ml'); do envsubst < $f > "./deploy/generated/$(basename $f)"; done |
This file contains hidden or 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
/* -------------------------------------------------------------------------- */ | |
// All Bootstrap 4 Sass Mixins [Cheat sheet] | |
// Updated to Bootstrap v4.5.x | |
// @author https://anschaef.de | |
// @see https://github.com/twbs/bootstrap/tree/master/scss/mixins | |
/* -------------------------------------------------------------------------- */ | |
/* | |
// ########################################################################## */ | |
// New cheat sheet for Bootstrap 5: |
This file contains hidden or 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
$('.gallery-slider-thumb').on('init', function(event, slick, currentSlide, nextSlide){ | |
var currentSlide = slick.currentSlide + 1; | |
var slideCount = slick.slideCount; | |
$(this).parents('.gallery-slider-thumb-wr').find('.gs-count__current').text(currentSlide); | |
$(this).parents('.gallery-slider-thumb-wr').find('.gs-count__all').text(slideCount); | |
}); | |
$('.gallery-slider-thumb').on('afterChange', function(event, slick, currentSlide, nextSlide){ | |
var currentSlide = slick.currentSlide + 1; | |
$(this).parents('.gallery-slider-thumb-wr').find('.gs-count__current').text(currentSlide); |
This file contains hidden or 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
// В файле script.js шаблона фильтра редактируем: | |
SmartFilter.prototype.recountMinPrice = function() | |
{ | |
/* Блок кода взят с https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/round */ | |
var myNamespace = {}; | |
myNamespace.round = function(number, precision) { | |
var factor = Math.pow(10, precision); | |
var tempNumber = number * factor; |
NewerOlder