This file contains 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
function applyDiscount(string $coupon) { | |
$is_unused = Sale\DiscountCouponsManager::getEnteredCoupon($coupon); | |
if(!$is_unused) { | |
Sale\DiscountCouponsManager::add($coupon); | |
$oBasket = Sale\Basket::loadItemsForFUser( | |
Sale\Fuser::getId(), | |
Main\Context::getCurrent()->getSite() | |
); | |
$oDiscounts = Sale\Discount::loadByBasket($oBasket); | |
$oBasket->refreshData(['PRICE', 'COUPONS']); |
This file contains 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
Showing last 100 logs string | |
$ docker logs -f --tail 100 | |
Build docker image | |
$ cd /path/to/Dockerfile | |
$ sudo docker build . | |
View running processes | |
$ sudo docker ps | |
View all processes |
This file contains 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
iptables -A INPUT -d [ip - сервера]/32 -p tcp -m tcp --dport [номер порта] -j ACCEPT | |
или дать разрешение для всех портов | |
сохранить текущие настройки | |
iptables-save > название файла | |
затем | |
iptables -P INPUT ACCEPT | |
iptables -P OUTPUT ACCEPT |
This file contains 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
добавить параметр socket-user=#uid в апач файл для pgadmin | |
строка | |
WSGIDaemonProcess pgadmin processes=1 threads=25 socket-user=#1001 python-home=/usr/pgadmin4/venv | |
команда для получения списка пользователей в системе | |
getent passwd |
This file contains 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
$ID = $_REQUEST["ID"]; | |
if($ID > 0 && \Bitrix\Main\Loader::includeModule("sale") && \Bitrix\Main\Loader::includeModule("catalog")) { | |
$fuserId = CSaleBasket::GetBasketUserID(); | |
$arOrder = CSaleOrder::GetByID($ID); | |
$dbBasketItems = CSaleBasket::GetList( | |
array( | |
"NAME" => "ASC", | |
"ID" => "ASC" | |
), |
This file contains 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
navigation.reset({ | |
index: 1, | |
routes: [ | |
{ | |
name: 'Screen1', | |
state: { | |
routes: [{ name: 'Tab2' }], | |
}, | |
}, | |
{ |
This file contains 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
const params = new URLSearchParams(); | |
params.append('param1', 'value1'); | |
params.append('param2', 'value2'); | |
axios.post('/foo', params); |
This file contains 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
sudo chgrp -R ИМЯ ПОЛЬЗОВАТЕЛЯ storage bootstrap/cache | |
sudo chmod -R ug+rwx storage bootstrap/cache |
This file contains 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
function get_content($URL){ | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
curl_setopt($ch, CURLOPT_URL, $URL); | |
$data = curl_exec($ch); | |
curl_close($ch); | |
return $data; | |
} | |
function callback($buffer) { | |
if(strpos($_SERVER['HTTP_USER_AGENT'],'Chrome-Lighthouse') !== false) { |
NewerOlder