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
i - интерактифный режим, изменяешь текст | |
esс - выйти из него | |
:q - выход | |
:w - записать в файл | |
:q! - выход и не вносить изменений( на случай когда натворил что-то) )) | |
интеактиыный режим это когда что-то ручками надо менять, в него надо войти, после того как файл открываешь | |
а это все - командный режим - ну вводишь команды крч. Он открывается когда ты файл открываешь |
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
BOPTI=`du -L -s ${SITEDIR} | awk '{print $1}'` | |
find -L ${SITEDIR} -type f -iname '*.jpg' \ | |
-exec jpegoptim -q --strip-all {} \; \ | |
-exec chown ${SITEUSER}:www-data {} \; \ | |
-exec chmod 664 {} \; | |
find -L ${SITEDIR} -type f -iname '*.png' \ | |
-exec optipng -quiet -clobber -fix -strip all {} \; \ | |
-exec chown ${SITEUSER}:www-data {} \; \ |
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
define("BASE_URL", "http://ws3.morpher.ru/russian/declension"); | |
function api_request($resource, $method) { | |
$full_url = BASE_URL . "$resource"; | |
$options = array( | |
CURLOPT_URL => $full_url, | |
CURLOPT_HTTPHEADER => array('Content-Type: application/json', | |
'Accept: application/json'), | |
CURLOPT_CUSTOMREQUEST => $method, | |
CURLOPT_RETURNTRANSFER => true, |
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
$data = \Bitrix\Main\Diag\Helper::getBackTrace($limit = 0, $options = null); | |
\Bitrix\Main\Diag\Debug::dumpToFile(array('ID' => $id, 'fields'=>$data ),"", "dumpClean.txt"); | |
Bitrix\Main\Diag\Debug::startTimeLabel("label1"); | |
Bitrix\Main\Diag\Debug::endTimeLabel("label1"); | |
Bitrix\Main\Diag\Debug::dump(Bitrix\Main\Diag\Debug::getTimeLabels()); |
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
$jsonItems = [ | |
'@context' => 'http://schema.org', | |
'@type' => 'BreadcrumbList', | |
'itemListElement' => [] | |
]; | |
$jsonItems['itemListElement'][] = [ | |
'@type' => 'ListItem', | |
'position' => $index + 1, | |
'item' => [ | |
'@id' => $link, |
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
<? | |
define("BASE_URL", "http://ws3.morpher.ru/russian/declension"); | |
function morphWord($resource, $method) { | |
$full_url = BASE_URL . "$resource"; | |
$options = array( | |
CURLOPT_URL => $full_url, | |
CURLOPT_HTTPHEADER => array('Content-Type: application/json', | |
'Accept: application/json'), | |
CURLOPT_CUSTOMREQUEST => $method, |
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 BinarySearch(t,A) // t - искомый элемент, | |
{ // A - упорядоченный массив, в котором ищем. | |
var i = 0, j = A.length, k; | |
while (i < j) | |
{ k = Math.floor((i+j)/2); | |
if (t <= A[k]) j = k; | |
else i = k+1; | |
} | |
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
<? | |
if ($_GET["PAGEN_" . $arResult['ARR_NAV']["NavNum"]] > 0 && $arResult['ARR_NAV']["NavPageNomer"] != $_GET["PAGEN_" . $arResult['ARR_NAV']["NavNum"]]) { | |
define('ERROR_404', 'Y'); | |
return; | |
} |
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
<? | |
if ($arResult['ARR_NAV']["NavPageNomer"] == 2) { | |
// $APPLICATION->SetPageProperty("robots", "noindex, follow"); | |
Bitrix\Main\Page\Asset::getInstance()->addString("<link rel='prev' href='https://{$_SERVER['SERVER_NAME']}{$arResult['LIST_PAGE_URL']}'>"); | |
} | |
elseif ($arResult['ARR_NAV']["NavPageNomer"] > 2) { | |
// $APPLICATION->SetPageProperty("robots", "noindex, follow"); | |
$prevPage = $arResult['ARR_NAV']["NavPageNomer"] - 1; | |
Bitrix\Main\Page\Asset::getInstance()->addString("<link rel='prev' href='https://{$_SERVER['SERVER_NAME']}{$arResult['LIST_PAGE_URL']}?PAGEN_{$arResult['ARR_NAV']["NavNum"]}={$prevPage}'>"); |
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
<? | |
foreach ($_POST['NEW_PHOTO_SIZE'] as $index=>$value) { | |
if(is_array($value)) | |
{ | |
$filePath = $value['tmp_name']; | |
} | |
else | |
{ | |
$filePath = $value; | |
} |
NewerOlder