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

for (πŸ’²Coders as πŸ’²Student):
echo("Hello πŸ’²Student->name");
endfor;

Author: @BakirovRoman
Download Telegram
πŸ–₯ Let's Test Your Code β›ˆ

composer require "codeception/codeception" --dev

php vendor/bin/codecept bootstrap --no-interaction

src/tests/Functional.suite.yml
actor: FunctionalTester
modules:
enabled:
- Laravel:
step_decorators: ~

composer require codeception/module-laravel --dev

vendor/bin/codecept g:test Functional First

vendor/bin/codecept run Functional


#test #codecept #codeception #php #composer
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ–₯ Let's Test With Pest =) β›ˆ

composer remove phpunit/phpunit
composer require pestphp/pest --dev --with-all-dependencies
vendor/bin/pest --init
vendor/bin/pest


Doc

#test #pest #php #composer
Please open Telegram to view this post
VIEW IN TELEGRAM
🏣 Postman => Insomnia ℹ️
Please open Telegram to view this post
VIEW IN TELEGRAM
ℹ️ Insomnia Pre-request Script for Get Access Token and Past it into Header

const resp = await new Promise((resolve, reject) => {
insomnia.sendRequest(
'http://localhost/api/get-access-token',
(err, resp) => {
if (err != null) {
reject(err)
return
}
insomnia.request.addHeader({
key: 'Authorization',
value: 'Bearer ' + resp.json().access_token
});
resolve(resp);
}
);
});


#insomnia #test #script #prerequest
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘3
πŸŒͺπŸ“± Cyberpunk 2077 HTML by Hussard

Pen 1
Pen 2

#cyberpunk #pen #codepen
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
β›ˆ Get Vendor Dir From Any File πŸ–₯

$loaders = \Composer\Autoload\ClassLoader::getRegisteredLoaders();
$keys = array_keys($loaders);
if (count($keys) !== 1) {
throw new \Exception('Cant detect vendor dir!');
}
echo $keys[0];


#vendor #php #composer
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
πŸŒͺ CSS Games πŸ–₯

1️⃣ CSS Diner (Selectors)
2️⃣ Flexbox Froggy (Flex)
3️⃣ CSS Battle (Repeat)

β›ˆ Backend Games

1️⃣ PHP Return true

#css #game #games #noob
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
πŸ–₯ Lets Encrypt Free SSL Certificate πŸŽ›

apt update && apt upgrade
apt install certbot python3-certbot-nginx
certbot --nginx
# choose your nginx.server
certbot certificates
systemctl status certbot.timer
cat /etc/cron.d/certbot
certbot renew --dry-run
nginx -t
service nginx restart
# keep calm & stay safe


#ssl #nginx #https #port443 #certbot #encrypt #tls #secure
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
πŸŒͺ Laravel CORS β›ˆ

If you are having trouble authenticating with your application from an SPA that executes on a separate subdomain, you have likely misconfigured your CORS (Cross-Origin Resource Sharing) or session cookie settings.

The config/cors.php configuration file is not published by default. If you need to customize Laravel's CORS options, you should publish the complete cors configuration file using the config:publish Artisan command:


php artisan config:publish cors


Read more on laravel.com

#laravel #cors #php #config #artisan
Please open Telegram to view this post
VIEW IN TELEGRAM
❀2
πŸ“± ChatGPT o1-preview & o1-mini 🧠

πŸ‡·πŸ‡Ί [RU] Review
πŸ‡ΊπŸ‡Έ [EN] Review

#chatgpt #ai
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯1
πŸŽ› Fix SSH Error πŸˆ‚οΈ

Error:
Warning: remote port forwarding failed for listen port 3002


Solution:
# lsof -i :3002
kill $(lsof -t -i :3002)


alias port='lsof -i '
# Usage port :3002


#ssh #error #port #forwarding #portforwarding #remote #server
Please open Telegram to view this post
VIEW IN TELEGRAM
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ”₯1πŸ‘1😁1
πŸ“± Reinstall Firefox for Selenium. From snap to apt 🐍🐧

Mozilla

#selenium #apt #snap #apt
Please open Telegram to view this post
VIEW IN TELEGRAM
🦊 Template Repository with Dynamic Debug for Parse any Site Data With Python & Selenium πŸ–₯

https://github.com/makhnanov/python-selenium-parser-template

#parser #parse #selenium #debug #firefox #python
Please open Telegram to view this post
VIEW IN TELEGRAM
Ubuntu & Chrome Clear DNS Cache

sudo systemctl restart systemd-resolved
sudo systemctl restart dnsmasq


chrome://net-internals/#dns
chrome://net-internals/#sockets
πŸ”₯1
🐧 Drop System Log | No Space Left on Device πŸ₯³

Problem:
... no space left on device ...
ls -lAFh /var/log
-rw-r----- 1 syslog adm 42G Oct 22 14:06 syslog


Solution:
sudo rm /var/log/syslog

sudo systemctl restart rsyslog

or
echo > /var/log/syslog


#space #left #free #disk #syslog #memory #leak
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸŽ› Install Go 🐧

sudo apt install golang-go


Get version:
go version


Other:
sudo apt remove golang-go
sudo apt remove --auto-remove golang-go
wget https://go.dev/dl/go1.23.2.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.23.2.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc
go version


https://go.dev/dl/

#go #language
Please open Telegram to view this post
VIEW IN TELEGRAM