Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| L1 | |
| Базовые знание диалекта Typescript, основных встроенных примитивов (Array, Object, Function, String, Date) и методов работы с ними, понимание контекста (this) и способов управления им | |
| Базовые знания фреймворка React | |
| Знание наиболее часто используемых Web API: fetch/XHR, Storage, PostMessage, DOM | |
| Умение писать простейшие алгоритмы (поиск, сортировка, сравнение объектов) без требований к их оптимальности. | |
| Навыки кроссбраузерной адаптивной верстки по макету с использованием существующего кода, знание CSS и препроцессора SCSS | |
| Навыки отладки разметки в браузерах Chrome/Safari | |
| Знание принципов работы HTTP, отличий между различными методами, принципов работы Cookies | |
| Практическое владение лучшими практиками структурирования кода: SOLID/DRY/KISS и т.д. | |
| Базовые знания git, понимание git flow |
| import axios from 'axios' | |
| import toast from './toast' | |
| function errorResponseHandler(error) { | |
| // check for errorHandle config | |
| if( error.config.hasOwnProperty('errorHandle') && error.config.errorHandle === false ) { | |
| return Promise.reject(error); | |
| } | |
| // if has response show the error |
| ########## Install NGINX ############## | |
| # Install software-properties-common package to give us add-apt-repository package | |
| sudo apt-get install -y software-properties-common | |
| # Install latest nginx version from community maintained ppa | |
| sudo add-apt-repository ppa:nginx/stable | |
| # Update packages after adding ppa |
| /** | |
| * Draw an arrowhead on a line on an HTML5 canvas. | |
| * | |
| * Based almost entirely off of http://stackoverflow.com/a/36805543/281460 with some modifications | |
| * for readability and ease of use. | |
| * | |
| * @param context The drawing context on which to put the arrowhead. | |
| * @param from A point, specified as an object with 'x' and 'y' properties, where the arrow starts | |
| * (not the arrowhead, the arrow itself). | |
| * @param to A point, specified as an object with 'x' and 'y' properties, where the arrow ends |
| console.log(1); | |
| (_ => console.log(2))(); | |
| eval('console.log(3);'); | |
| console.log.call(null, 4); | |
| console.log.apply(null, [5]); | |
| new Function('console.log(6)')(); | |
| Reflect.apply(console.log, null, [7]) | |
| Reflect.construct(function(){console.log(8)}, []); | |
| Function.prototype.apply.call(console.log, null, [9]); | |
| Function.prototype.call.call(console.log, null, 10); |
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
| // original from:https://codepen.io/mdd/pen/wGRqbw | |
| // Reducer | |
| const counter = (state = 0, actions) => { | |
| switch (actions.type) { | |
| case 'INCREMENT': return state + 1; | |
| case 'DECREMENT': return state - 1; | |
| default: return state | |
| } | |
| } |
ansible-playbook --connection=local 127.0.0.1 playbook.yml127.0.0.1 ansible_connection=localАнглийская версия: https://evilmartians.com/chronicles/bootstrap-an-intervention
У CSS есть несколько базовых проблем, которые позволяют очень быстро отстрелить себе ногу при неправильном использовании:
Глобальный неймспейс – в серверном программировании все что написано в файле, в файле и остается. Все же что написано в css и js засирает глобальное пространство имен со всеми вытекающими. В JS эту проблему сейчас побороли всякими модульными системами, а вот с css сложнее. В идеальном мире это должен починить Shadow DOM и настоящие Web Components, но пока их нет единственный способ с этим бороться – следовать какой-то системе именований селекторов, которая по возможности уменьшает и исключает возможные конфликты.
Каскадность – если на один элемент может сработать несколько правил, то они все и сработают последовательно. Если есть элемент h1.title, на него сработают все правила для тегов h1 и все правила для класса .title. Так как весь html состоит из тегов, то правил которые п