Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
| <?php | |
| namespace App\Services\Dto; | |
| abstract class AbstractDto | |
| { | |
| /** | |
| * AbstractRequestDto constructor. | |
| * @param array $data | |
| */ |
| ########## 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 |
| <?php | |
| namespace Api; | |
| use Doctrine\ORM\Mapping\Driver\AnnotationDriver; | |
| class ConfigProvider | |
| { | |
| public function __invoke() | |
| { |
| # Set the default path | |
| set $root /var/www/html/dist; | |
| # Change the document root path based on user's ip address | |
| if ($remote_addr ~ "^(71\.134\.111\.38)$") { | |
| set $root /var/www/html/dist1; | |
| } | |
| # Set config | |
| root $root; |
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
| Working with DOM | Working with JS | Working With Functions |
|---|---|---|
| Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
| Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
| Create DOM Elements | Conditionals |
| private RecyclerView mRecyclerView; | |
| @Nullable | |
| @Override | |
| public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { | |
| View view = inflater.inflate(R.layout.fragment_view, container, false); | |
| mRecyclerView = (RecyclerView) view.findViewById(R.id.recycler_view); | |
| // ommiting other recycler view set up, such as adapter and Layout manager set up .. | |
| ViewTreeObserver viewTreeObserver = mRecyclerView.getViewTreeObserver(); | |
| viewTreeObserver.addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() { |
| package com.javarush.test.level20.lesson10.bonus03; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| /* Кроссворд | |
| 1. Дан двумерный массив, который содержит буквы английского алфавита в нижнем регистре. | |
| 2. Метод detectAllWords должен найти все слова из words в массиве crossword. | |
| 3. Элемент(startX, startY) должен соответствовать первой букве слова, элемент(endX, endY) - последней. | |
| text - это само слово, располагается между начальным и конечным элементами |
| <?php | |
| if (!function_exists('array_group_by')) { | |
| /** | |
| * Groups an array by a given key. | |
| * | |
| * Groups an array into arrays by a given key, or set of keys, shared between all array members. | |
| * | |
| * Based on {@author Jake Zatecky}'s {@link https://github.com/jakezatecky/array_group_by array_group_by()} function. | |
| * This variant allows $key to be closures. |
| <?php | |
| /** | |
| * This script is for easily deploying updates to Github repos to your local server. It will automatically git clone or | |
| * git pull in your repo directory every time an update is pushed to your $BRANCH (configured below). | |
| * | |
| * Read more about how to use this script at http://behindcompanies.com/2014/01/a-simple-script-for-deploying-code-with-githubs-webhooks/ | |
| * | |
| * INSTRUCTIONS: | |
| * 1. Edit the variables below | |
| * 2. Upload this script to your server somewhere it can be publicly accessed |