Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
_registry = {}; | |
importPolyfill = path => { | |
if(!(path in _registry)) { | |
const entry = _registry[path] = {}; | |
entry.promise = new Promise(resolve => entry.resolve = resolve); | |
document.head.appendChild(Object.assign( | |
document.createElement('script'), | |
{ | |
type: 'module', | |
innerText: `import * as X from '${path}'; _registry['${path}'].resolve(X);`, |
This will take filePath
as a function parameter and reads the file via fs
module and get the file and converts it's size into more humanly readable format.
const fs = require('fs');
function getFileSize(filename) {
const stats = fs.statSync(filename);
//console.log('stats', stats);
const {size} = stats;
Символы, которые имеет смысл брать в шрифт:
! "#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~©«»ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё‐‑‒–—―‘‚“„…‰™°₽€”’′″×
import * as gulp from 'gulp'; | |
import * as yargs from 'yargs'; | |
import * as merge from 'merge2'; | |
import { BaseGulpTask } from '../BaseGulpTask'; | |
import { BuildConfig, ProjectArtifact, ProjectPaths, Utils } from '../buildBarrel'; | |
import { gulpIf, gulpPlumber, gulpPrint, gulpSourcemaps, gulpTypeScript } from '../gulpPlugins'; | |
/** | |
* Builds the project, then the application. | |
* |
##CSS Методологии, от О до Б
CSS методологии на 1 примере https://github.com/aiboy/CSSM
Слайды https://wsd.events/2016/10/01/pres/css-methodologies.pdf
###CSS Design patterns
/* | |
https://www.smashingmagazine.com/2016/07/improving-user-flow-through-page-transitions/ | |
You can copy paste this code in your console on smashingmagazine.com | |
in order to have cross-fade transition when change page. | |
*/ | |
var cache = {}; | |
function loadPage(url) { | |
if (cache[url]) { |
function testPreserve3DSupport() { | |
const element = document.createElement('p'); | |
document.body.insertBefore(element, null); | |
const propName = 'transform-style'; | |
element.style[propName] = 'preserve-3d'; | |
const propValue = window.getComputedStyle(element, null).getPropertyValue(propName); | |
document.body.removeChild(element); | |
return (propValue === 'preserve-3d'); | |
} |
// connect() is a function that injects Redux-related props into your component. | |
// You can inject data and callbacks that change that data by dispatching actions. | |
function connect(mapStateToProps, mapDispatchToProps) { | |
// It lets us inject component as the last step so people can use it as a decorator. | |
// Generally you don't need to worry about it. | |
return function (WrappedComponent) { | |
// It returns a component | |
return class extends React.Component { | |
render() { | |
return ( |