Pug - это препроцессор HTML и шаблонизатор, который был написан на JavaScript для Node.js.
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
*** 1. Использование объекта Set *** | |
const arr = [1, 1, 2, 2, 3, 4, 4, 5]; | |
const uniqueArr = [...new Set(arr)]; | |
console.log(uniqueArr); // [1, 2, 3, 4, 5] | |
*** 2. Использование метода .filter *** | |
const arr = [1, 1, 2, 2, 3, 4, 4, 5]; | |
const uniqueArr = arr.filter((item, index) => arr.indexOf(item) === index); |
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
1. Получаем хэш-код коммита, к которому хотим вернуться. | |
2. Заходим в папку репозитория и пишем в консоль: | |
$ git reset --hard a3775a5485af0af20375cedf46112db5f813322a | |
$ git push --force |
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 ($('.swiper-container').length > 0) { //some-slider-wrap-in | |
let swiperInstances = []; | |
$(".swiper-container").each(function(index, element){ //some-slider-wrap-in | |
const $this = $(this); | |
$this.addClass("instance-" + index); //instance need to be unique (ex: some-slider) | |
$this.parent().find(".swiper-pagination").addClass("pagination-" + index); | |
$this.parent().find(".swiper-button-prev").addClass("prev-" + index); //prev must be unique (ex: some-slider-prev) | |
$this.parent().find(".swiper-button-next").addClass("next-" + index); //next must be unique (ex: some-slider-next) | |
swiperInstances[index] = new Swiper(".instance-" + index, { //instance need to be unique (ex: some-slider) | |
// your settings ... |
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
// У Google | |
input[type="number"]::-webkit-outer-spin-button, | |
input[type="number"]::-webkit-inner-spin-button { | |
-webkit-appearance: none; | |
margin: 0; | |
} | |
// У Mozilla |
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
// html | |
<div class="custom-select" style="width:200px;"> | |
<select> | |
<option value="0">Select car:</option> | |
<option value="1">Audi</option> | |
<option value="2">BMW</option> | |
<option value="3">Citroen</option> | |
<option value="4">Ford</option> | |
<option value="5">Honda</option> |
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
// Pug | |
mixin SelectBox(name, options) | |
.select-box | |
.select-box__current(tabindex="1") | |
each option, index in options | |
.select-box__value | |
input.select-box__input(type="radio" id=index value=option.value name=name checked) | |
p.select-box__input-text #{option.name} | |
img.select-box__icon(src="http://cdn.onlinewebfonts.com/svg/img_295694.svg" alt="Arrow Icon" aria-hidden="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
input[type=text]::-ms-clear { display: none; width : 0; height: 0; } | |
input[type=text]::-ms-reveal { display: none; width : 0; height: 0; } | |
input[type="search"]::-webkit-search-decoration, | |
input[type="search"]::-webkit-search-cancel-button, | |
input[type="search"]::-webkit-search-results-button, | |
input[type="search"]::-webkit-search-results-decoration { display: 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
form(method="POST" id="form" class="form" enctype="multipart/form-data" action="mail.php") | |
label(for="names" ) Наименование организации: | |
input(type="text" name="user_name" id="names" placeholder="Введите наим. организации") | |
label(for="address" ) Aдрес организации: | |
input(type="text" name="user_address" id="address" placeholder="Введите адрес") | |
label(for="email" ) Email*: | |
input(type="email" name="user_email" id="email" placeholder="Введите email" required) |
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
// html | |
<div class="video"> | |
<a class="video__link" href="https://youtu.be/neHA4MJwpnY"> | |
<picture> | |
<source srcset="https://img.youtube.com/vi_webp/neHA4MJwpnY/maxresdefault.webp" type="image/webp"> | |
<img class="video__media" src="https://img.youtube.com/vi/neHA4MJwpnY/maxresdefault.jpg" alt="1. Пилот, разборы, ответы и лайвы"> | |
</picture> | |
</a> | |
<button class="video__button" aria-label="Запустить видео"> |
NewerOlder