- настройка переменных окружения
composer installphp artisan migratephp artisan db:seed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * HEX color to RGB color | |
| * @param color | |
| * @returns {number[]|null} | |
| */ | |
| function hexToRgbArr (color = null) { | |
| if (color) { | |
| let s = color.toString() | |
| s = s.replace('#', '') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Domain change */ | |
| // Plugin: Better Search Replace | |
| // wp-config | |
| // define('WP_HOME', 'http://amoren.vr9.ru'); | |
| // define('WP_SITEURL', 'http://amoren.vr9.ru'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $files = scandir('../app/Models'); | |
| $result = []; | |
| foreach ($files as &$s) | |
| { | |
| if (strlen($s) > 2) | |
| { | |
| $name = explode('.', $s); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Services; | |
| /* | |
| * Docs telegram bot methods: | |
| * https://core.telegram.org/bots/api#available-methods | |
| */ | |
| class Telegram |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Manual call to UserRequest validation | |
| $userRequest = UserRequest::createFrom($request); | |
| $validator = Validator::make($request->all(), $userRequest->rules()); | |
| $validatedData = $validator->validated(); // array | |
| // Modify field in request | |
| if ($request->filled('telegram')) | |
| { | |
| $request->merge([ | |
| 'telegram' => ltrim($request->input('telegram'), '@'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Run it. | |
| Then do the following steps below. | |
| Update homebrew & upgrade | |
| #brew update | |
| #brew upgrade | |
| Install php | |
| #brew install php@7.2 | |
| Install the required PHP to your PATH |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
| Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Отменить последний коммит, но сохранить изменения: | |
| $ git reset HEAD~ | |
| # Удалить последний коммит и откатить изменения: | |
| $ git reset --hard HEAD~ | |
| # Привязать к новому проекту существующий репозиторий | |
| git init | |
| git add . | |
| # если нужно изменить имя ветки (git branch -m main) |
Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server and BrowserSync we can fix this:
npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server
BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.
NewerOlder