Smart 🧠 Fullstack
45 subscribers
170 photos
11 videos
13 files
155 links
About channel: everyday developer hints.

for (💲Coders as 💲Student):
echo("Hello 💲Student->name");
endfor;

Author: @BakirovRoman
Download Telegram
ℹ️ Остановить все контейнеры.
docker stop $(docker ps -aq)
#DOCKER
ℹ️ Клонирование без истории
git clone <repo> <dir> --branch master --depth 1
#GIT
ℹ️ Remove all images
docker rmi $(docker images -q)
docker image prune -fa
#DOCKER #WIP
Очень интересное info:

composer diagnose

#PHP #composer #packagist
⁉️#ERROR
Doctrine\DBAL\Exception
Unknown database type enum requested, Doctrine\DBAL\Platforms\MariaDb1027Platform may not support it.

#SOLUTION
Connect provider or add in any provider 👇
<?php

declare(strict_types=1);

namespace App\Providers;

use DB;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
public function register()
{
/** @noinspection PhpUnhandledExceptionInspection */
DB::getDoctrineSchemaManager()
->getDatabasePlatform()
->registerDoctrineTypeMapping('enum', 'string');
}
}
Result:
Anonymous Quiz
40%
Parse error
60%
ok
🔥2
👍1
❗️Kubernetes Helm Error: UPGRADE FAILED: another operation (install/upgrade/rollback) is in progress.
👉 Article
👉 Helm doc uninstall
#k8s #helm #docker
ℹ️ PHP configuration / extension path helpers
php -i | grep "Loaded Configuration File"

php -i | grep "extension_dir"

php -i | grep "Scan this dir for additional .ini files"

#PHP #extension #configuration
ℹ️ Laravel. Validation. Rules. Require only one of two parameters. Exclude empty data.
Laravel >= 8.32 only support.
$rules = [
'login' => 'prohibited_unless:email,null|required_without:email',
'email' => 'prohibited_unless:login,null|required_without:login',
];
#PHP #Laravel #validation #rules
ℹ️ PHPStorm. Disable code fragment reformat.
1️⃣ Ctrl + Alt + S -> Code Style -> Code Style -> Formatter -> Turn formatter on/off with markers in code comment
2️⃣ Then add in code:
@formatter:off
Code in non std format
@formatter:on

#IDE #JetBrains #PHPStorm #Idea #codestyle #editor #reformat
ℹ️ Laravel 9.21 (Cli update)
./artisan about

./artisan model:show User
ℹ️ Xubuntu Notifications

PHP Script at /var/www/cron-schedule/notify.php:
<?php

declare(strict_types=1);

$ok = '/var/www/cron-schedule/ok';

do {
`notify-send '$argv[1]!' --expire-time=900`;
sleep(1);
} while (!file_exists($ok));

unlink($ok);

Aliases:
alias ok='touch /var/www/cron-schedule/ok'
alias cron-restart='sudo service cron restart'
alias cron-edit='crontab -e'

:~$ crontab-edit
SHELL=/bin/bash
*/20 * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/php /var/www/cron-schedule/notify.php "Выпей Воды!"
0 */1 * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/php /var/www/cron-schedule/notify.php "Разминка!"
0 10 * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/php /var/www/cron-schedule/notify.php "Первый Завтрак!"
0 11 * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/php /var/www/cron-schedule/notify.php "Второй Завтрак!"
0 14 * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/php /var/www/cron-schedule/notify.php "Обед!"
0 17 * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/php /var/www/cron-schedule/notify.php "Полдник!"
0 20 * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/php /var/www/cron-schedule/notify.php "Ужин!"

Restart cron:
cron-restart

#cron #schedule #lifetimemanager #personal
ℹ️ Gitlab. Push and skip pipelines. Not for merge requests.
git push -o ci.skip
#git #gitlab #pipelines
ℹ️ Undo a commit & redo
$ git commit -m "Something terribly misguided" # Your Accident
$ git reset HEAD~
[ edit files as necessary ]
$ git add .
$ git commit -c ORIG_HEAD
#git #commit #rollback
ℹ️ Block cron script duplicate execution. Flock.
*/20 * * * * XDG_RUNTIME_DIR=/run/user/$(id -u) /usr/bin/flock -n /tmp/water /usr/bin/php /var/www/cron-schedule/notify.php "Выпей Воды!" > /tmp/notify.php 2> /tmp/notify.error.php
#cron #lock #block #duplication #flock
Forwarded from Laravel World
В Laravel 9.31 команда dd теперь показывает откуда она была вызвана.

https://github.com/laravel/framework/pull/44211