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
И использовать его как-то так: | |
<link rel="stylesheet" href="{'public/template/css/styles.css' | version}" type="text/css"/> | |
<script src="{'public/template/js/scripts.min.js' | version}" type="text/javascript"></script> |
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 handleAdress(){ | |
const idShowDelivery = 'delivery_2'; // id доставки, для которой показывать блок адреса | |
const checkedDelivery = document.querySelector('[name="delivery"]:checked'); // получаем выбранную селектор чекбокса выбранной доставки | |
const idDelivery = checkedDelivery.getAttribute('id'); // узнаем его id | |
let blockAdress = document.querySelector('#address_block'); // получаем селектор блока адреса доставки | |
blockAdress.style.display = (idDelivery == idShowDelivery) ? 'block' : 'none'; // в зависимости от выбранного значения скрываем/показываем блок адреса | |
} |
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
/* Importing web fonts */ | |
@import url('https://fonts.googleapis.com/css?family=Open+Sans|Oxygen|Raleway|Roboto'); | |
/* login page logo settings */ | |
#header h1 { | |
background-image: url("../images/redmine.png"); | |
background-repeat: no-repeat; | |
background-position: 0 50%; | |
background-size: 44px auto; | |
padding-left: 56px; |
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
/** | |
* detect IE | |
* returns version of IE or false, if browser is not Internet Explorer | |
*/ | |
function detectIE() { | |
let ua = window.navigator.userAgent; | |
let msie = ua.indexOf('MSIE '); | |
if (msie > 0) { | |
// IE 10 or older => return version number |
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 apt install texlive-xetex | |
sudo apt-get install texlive-lang-all | |
pandoc test.md -s -o test.pdf --latex-engine=xelatex | |
--- | |
title: Title text | |
geometry: margin=2cm | |
lang: ru | |
header-includes: | |
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
let time_start = Date.now(), | |
time_last = time_start; | |
// Функция показывает время с момента старта загрузки страницы и с момента последнего вызова функции | |
function logger(text) { | |
let now = Date.now(); | |
console.log('%c@ %dms (waited %dms): %c%s', 'color: #6ecc21;', now - time_start, now - time_last, 'color: #39aceb;', text); | |
time_last = now; | |
} |
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
<?php | |
define('MODX_API_MODE', true); | |
require 'index.php'; | |
$modx->getService('error', 'error.modError'); | |
$modx->setLogLevel(modX::LOG_LEVEL_FATAL); | |
$modx->setLogTarget(XPDO_CLI_MODE ? 'ECHO' : 'HTML'); | |
$msg = ""; |
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 declOfNum(number, titles) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[ (number%100>4 && number%100<20)? 2 : cases[(number%10<5)?number%10:5] ]; | |
} | |
use: | |
declOfNum(count, ['найдена', 'найдено', 'найдены']); |
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
alias addsite="~/bashscripts/addsiter.sh" | |
alias stoper="~/bashscripts/stoper.sh" | |
alias starter="~/bashscripts/starter.sh" | |
alias sudo="sudo " | |
alias s="sudo " | |
alias gs='git status' | |
alias gaa='git add .' | |
alias gc='git commit -m ' | |
alias gpm='git push origin master' | |
alias gpd='git push origin dev' |
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
# Rewrite www.domain.com -> domain.com -- used with SEO Strict URLs plugin | |
RewriteCond %{HTTP_HOST} . | |
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC] | |
RewriteRule ^(.*)$ https://%1/$1 [R=301,L] | |
#Включение https | |
#RewriteEngine On | |
#RewriteCond %{SERVER_PORT} !^443$ | |
#RewriteCond %{HTTPS} off | |
#RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] |
NewerOlder