Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
/* @flow */ | |
// The following three lines are from https://gist.github.com/nmn/b20a92e848c68d88f7fdb8353c71b1ca | |
type $Object<V> = { +[ key : string] : V } | |
type $ObjectValues<V, O : $Object<V>> = V | |
type $Values<O: Object> = $ObjectValues<*, O> | |
type Enumerables = { [ key : string ] : any } | |
const UserRoles : Enumerables = { |
// @flow | |
/* | |
This magic type will give you the union of the types of all the values in an object type. | |
This is still far from a fully dynamic $PropertyType, but it's a lot better than just using `any` | |
*/ | |
/* | |
Link: | |
https://flow.org/try/#0C4TwDgpgBAJA8gIwFYQMbADwDUB8UC8UA3gNQDaA1hCAFxQDOwATgJYB2A5gLp1YC+AKFCQoAfRhYAhgBsArhHrYANFDh14yNJlx5CWIeGgSZ8xWtWb0uscbkKMAKhVwcAt8OiIkBYgKhQSVDo2WQBbBAgmJT8AhDpGVk5o-xJJOgQAewzpCEk2aMEBABM0aUkmaAA3cqhaWCk7M2RXAG4ACjqE9g4oAB8oTOzctj6oEPDIgEo3AHoZ9rqAQSYmSRAMcYimHEmoOagAURWMpgYACwyAdxHUE4r0aRAoM8iIATmF4LCt0a7OXf2RyYJ3OVxudy0j2er3e8w6XwmTABM0Ox1O9Au1ygtxWkKeLwqsM+AyyOTyyNRwPRmPBuIe+JhH3hDGY3QpQJBGLB2Ih9OhhKAA | |
*/ |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
Tether is a great library for positioning stuff (tooltips, modals, hints, etc) in your web app.
But, as I use React, it was pretty problematic for me, as Tether mutates the DOM and React breaks miserably when it sees mutated DOM. The solution is to have the tethered element outside the part of the DOM tree which is controlled by React (in this case, I use document.body
).
That's why I created 2 helpers to use Tether with React.
The first one, TetheredElement
is a plain JS helper to create a new element, attach it to some other one via Tether, and populate it with some React component.
The second one, TetherTarget
is a React component and it uses TetheredElement
to integrate it further with React, so that you can attach components to each other with Tether, without leaving the cozy React/JSX world and worrying about manual DOM operations. Just write:
Так получилось, что мы открываем сейчас достаточно много чатов в [Gitter.im][1]: часто это совсем новые для нас сообщества (как [PHP-чат][2], например), а часто - это уже существующие чаты, которые мы создали и администрировали в Skype (например, [Frontend-UA][3]). Не зависимо от того, новый ли это чат или "переезжающий", нам раз за разом задают одни и те же вопросы. Здесь мы собрали их и подготовили несколько ответов.
#!/bin/sh | |
sdir=$(pwd) | |
[ -e $sdir/$(basename $0) ] || sdir=$(dirname $0) | |
[ -d $sdir/lib ] || mkdir -p $sdir/lib | |
wget "https://raw.github.com/ModelN/backbone.geppetto/master/backbone.geppetto.js" -O $sdir/lib/backbone.geppetto.js | |
wget "https://raw.github.com/ModelN/backbone.geppetto/master/README.md" -O $sdir/readme.md |
# udev | |
wget https://gist.githubusercontent.com/dex4er/1354710/raw/0f9738c7439cdfb9e4446663d137f91ee153b4d8/etc_udev_rules.d_90-hid-eToken.rules | |
sudo cp etc_udev_rules.d_90-hid-eToken.rules /etc/udev/rules.d | |
sudo service udev reload | |
# required packages | |
sudo apt-get -yy install pcscd opensc | |
# legacy library | |
wget http://mirrors.kernel.org/ubuntu/pool/universe/h/hal/libhal1_0.5.14-8_amd64.deb |