Skip to content

Instantly share code, notes, and snippets.

View evdeveloper's full-sized avatar

Evgeny evdeveloper

  • Russia, Saint-Petersburg
View GitHub Profile
@evdeveloper
evdeveloper / Removing duplicate elements from an array js
Last active June 21, 2023 05:03
Несколько способов удалить повторяющиеся элементы из массива на JavaScript
*** 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);
1. Получаем хэш-код коммита, к которому хотим вернуться.
2. Заходим в папку репозитория и пишем в консоль:
$ git reset --hard a3775a5485af0af20375cedf46112db5f813322a
$ git push --force
@evdeveloper
evdeveloper / multiple_swiper.js
Last active February 8, 2023 13:57 — forked from MSerj/multiple_swiper.js
Иницилизация нескольких слайдеров на одной странице Swiper
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 ...
@evdeveloper
evdeveloper / Arrows input type Number
Created February 11, 2020 05:26
Убрать стрелки у input type="number"
// У Google
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
}
// У Mozilla
@evdeveloper
evdeveloper / Custom select javascript
Created January 18, 2020 07:01
Кастомный select на javascript html css
// 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>
@evdeveloper
evdeveloper / mixin Pug select custom
Last active January 18, 2020 06:18
Выпадающий список без js или jquery
// 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")
@evdeveloper
evdeveloper / Clear input[type="search"]
Last active June 21, 2023 04:25
Удаление крестика из input[type="search"] со всех браузеров
@evdeveloper
evdeveloper / pug.md
Created July 17, 2019 03:06 — forked from neretin-trike/pug.md
Туториал по HTML препроцессору Pug (Jade)
@evdeveloper
evdeveloper / Form Post File (phpMailer)
Last active June 21, 2023 04:26
Form post file (phpmailer)
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)
@evdeveloper
evdeveloper / js-script-youtube-img
Last active April 20, 2021 12:00
Скрипт для вставки видео с ютуб на сайт
// 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="Запустить видео">