Skip to content

Instantly share code, notes, and snippets.

View SergeyLitvin's full-sized avatar

Serhii Lytvyn SergeyLitvin

  • Epic Games
  • Kharkiv region, Zmiiv
View GitHub Profile
@SergeyLitvin
SergeyLitvin / lazy-loading.html
Created March 5, 2021 23:36 — forked from droganaida/lazy-loading.html
Intersection Observer + custom lazy loading demo
<html>
<head>
<title>Lazy loading by #Blondiecode</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, "Helvetica Neue", Helvetica, serif;
}
footer {
@SergeyLitvin
SergeyLitvin / js.gitignore
Created February 28, 2021 12:35 — forked from bsara/js.gitignore
.gitignore File for JavaScript Projects
#---------------------------------------#
# Project Ignores #
#---------------------------------------#
# output
/.temp
/.tmp
/build
/dist
@SergeyLitvin
SergeyLitvin / gist:7205db90ab23d54becc8e5c145f37e2b
Created December 18, 2020 08:05
If .gitignore file not ignoring
# rm all files
git rm -r --cached .
# add all files as per new .gitignore
git add .
# now, commit for new .gitignore to apply
git commit -m ".gitignore is now working"
@SergeyLitvin
SergeyLitvin / html_select_countries
Created September 11, 2020 12:07
List of Countries in an HTML <select> Element
<select name="countries">
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
@SergeyLitvin
SergeyLitvin / countryList
Created September 11, 2020 12:02
List of Countries in JavaScript/ES6 Array
const countryList = [
"Afghanistan",
"Åland Islands",
"Albania",
"Algeria",
"American Samoa",
"Andorra",
"Angola",
"Anguilla",
"Antarctica",
@SergeyLitvin
SergeyLitvin / List_of_Countries_in_JSON_format_with_Country_Codes
Created September 11, 2020 12:01
List of Countries in JSON format with Country Codes
[
{"name": "Albania", "code": "AL"},
{"name": "Åland Islands", "code": "AX"},
{"name": "Algeria", "code": "DZ"},
{"name": "American Samoa", "code": "AS"},
{"name": "Andorra", "code": "AD"},
{"name": "Angola", "code": "AO"},
{"name": "Anguilla", "code": "AI"},
{"name": "Antarctica", "code": "AQ"},
{"name": "Antigua and Barbuda", "code": "AG"},
git branch --set-upstream <remote-branch>
устанавливает удаленную ветвь по умолчанию для текущей локальной ветки.
Любая будущая команда git pull (с выводом текущей локальной ветки),
попытается выполнить фиксацию с <remote-branch> в текущую локальную ветвь.
Чтобы избежать путаницы, последние версии git обесценивают этот несколько неоднозначный параметр --set-upstream в пользу более подробного варианта --set-upstream-to с идентичным синтаксисом и поведением
git branch --set-upstream-to <remote-branch>
@SergeyLitvin
SergeyLitvin / eslint-config-react-app
Created June 12, 2019 14:33
Instruction configuring eslint-config-react-app
npm install --save-dev eslint-config-react-app babel-eslint@10.0.1 eslint@5.16.0 eslint-plugin-flowtype@3.10.1 eslint-plugin-import@2.17.3 eslint-plugin-jsx-a11y@6.2.1 eslint-plugin-react@7.13.0 eslint-plugin-react-hooks@1.6.0
Usage Outside of Create React App
If you want to use this ESLint configuration in a project not built with Create React App, you can install it with the following steps.
First, install this package, ESLint and the necessary plugins.
npm install --save-dev eslint-config-react-app babel-eslint@10.0.1 eslint@5.16.0 eslint-plugin-flowtype@3.10.1 eslint-plugin-import@2.17.3 eslint-plugin-jsx-a11y@6.2.1 eslint-plugin-react@7.13.0 eslint-plugin-react-hooks@1.6.0
Then create a file named .eslintrc.json with following contents in the root folder of your project:
Используется как справочный комментарий перед функцией – о том, что именно она делает, какие параметры принимает и что возвращает.
/**
* Возвращает x в степени n, только для натуральных n
*
* @param {number} x Число для возведения в степень.
* @param {number} n Показатель степени, натуральное число.
* @return {number} x в степени n.
*/
<!-- https://ru.vuejs.org/v2/guide/single-file-components.html -->
<!-- my-component.vue -->
<template src="./my-component.html"></template>
<script src="./my-component.js"></script>
<style src="./my-component.css"></style>