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
πŸ–± Alias 4 Execute Command Stack and Return to Working Directory πŸŽ›

alias command-stack='current_dir=$(pwd); cd /var/www/any-dir/; cmd-one; cmd-two; cd "${current_dir}"'


Example:
alias proxy='current_dir=$(pwd); cd /var/www/docker-ports-proxy/; make; cd "${current_dir}"'



#linux #bash #alias #cd #shell #sh #proxy #script
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ–± Get Top 30 Biggest Files πŸŽ›

find / -type f -exec du -h {} + 2>/dev/null | sort -hr | head -n 30


#bigges #ssd #hdd #size #mem #memory #find #du #df #sort #head #shell #ssh #top #file #files #filesystem
Please open Telegram to view this post
VIEW IN TELEGRAM
β›ˆ PHP Script 4 Convert JSON String to PHP Array as Code πŸ–₯

<?php

/**
* Converts a JSON string to PHP array code using the new square bracket syntax with proper indentation
*
* @param string $jsonString JSON string to convert
* @return string PHP code representing the array
*/
function jsonToPhpArrayCodeNewSyntax($jsonString) {
// Decode the JSON string to a PHP array
$array = json_decode($jsonString, true);

// Check for decoding errors
if (json_last_error() !== JSON_ERROR_NONE) {
return 'Error decoding JSON: ' . json_last_error_msg();
}

// Convert the array to PHP code with square bracket syntax
return '$data = ' . arrayToPhpCode($array) . ';';
}

/**
* Recursively converts an array to PHP code using square bracket syntax with proper indentation
*
* @param mixed $array The array to convert
* @param int $indentLevel Current level of indentation
* @return string PHP code representing the array
*/
function arrayToPhpCode($array, $indentLevel = 0) {
if (!is_array($array)) {
return var_export($array, true);
}

$code = "[\n";
$indentation = str_repeat(' ', $indentLevel + 1);
foreach ($array as $key => $value) {
$code .= $indentation;
$code .= is_int($key) ? '' : var_export($key, true) . ' => ';
$code .= arrayToPhpCode($value, $indentLevel + 1) . ",\n";
}
$code .= str_repeat(' ', $indentLevel) . "]";

return $code;
}

$jsonString = <<<JSON
{
"name": "Roman",
"age": 27,
"city": "Omsk",
"address": {
"street": "Lenina",
"number": 26
}
}
JSON;

echo jsonToPhpArrayCodeNewSyntax($jsonString) . PHP_EOL;


Input:
{
"name": "Roman",
"age": 27,
"city": "Omsk",
"address": {
"street": "Lenina",
"number": 26
}
}


Output:
$data = [
'name' => 'Roman',
'age' => 27,
'city' => 'Omsk',
'address' => [
'street' => 'Lenina',
'number' => 26,
],
];


#php #js #json #javascript #converter #gpt
Please open Telegram to view this post
VIEW IN TELEGRAM
β›ˆ Always Enable Parameters Inlay Hints πŸŒͺ

#parameters #idea #phpstorm #webstorm #inlay #hints
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ”₯2
🐧 Git Show All Tags πŸ–₯

git --no-pager tag --sort=refname
git --no-pager tag --sort=-refname # For reverse

git --no-pager tag | sort -V

alias git-tag="git --no-pager tag | sort -V"

git tag 1.0.0

git push origin --tags


#git #bash #cvs #tag #tags #history
Please open Telegram to view this post
VIEW IN TELEGRAM
cowsay "Hello World!"

 ______________
< Hello World! >
--------------
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||

#funny #cowsay
πŸŽ› Find All Root composer.json Files 🐧

find work/dir-with-many-projects/ -iname composer.json | grep -v "vendor"

grep with flag -v exclude line with founded word

#bash #php #composer #vendor #grep #find
Please open Telegram to view this post
VIEW IN TELEGRAM
sudo apt install xcowsay

xcowsay Hello Smart Backend!

#funny #cowsay #xcowsay
😱3
This media is not supported in your browser
VIEW IN TELEGRAM
alias mew=cat

sudo apt install oneko

oneko

#funny #cat #oneko #mew
This media is not supported in your browser
VIEW IN TELEGRAM
πŸ–± Xfce Window Control 🐧

Left Alt + Left Mouse Button = Move

Left Alt + Right Mouse Button = Resize

Left Alt + Double Left Mouse Button = Full Screen


#interface #xfce #linux #xubuntu #ubuntu #window
Please open Telegram to view this post
VIEW IN TELEGRAM
aqua.gif
16.6 MB
sudo snap install asciiquarium

asciiquarium


#funny #fish #bash #ascii #aquarium #asciiquarium
πŸ”₯1
β›ˆ *Storm Classes Tree View πŸŒͺ

- Click Class in Tree View
- Context Menu
- Diagram
- Show Diagram ... / Ctrl + Alt + Shift U
- Click Class on Diagram
- Show Implementations / Ctrl + Alt + B
- Ctrl + A
- Enter
- Click on Needed Class
- Context Menu
- Selected Element Actions
- Jump to Source / F4

#PhpStorm #JetBrains #idea #intelijidea #graph #class #tree #extends #implements #view #parent #child #diagram
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ“± Script 4 Launch Daily Meeting In Zoom 🐧

cd ~/Desktop/ && nano daily.sh && chmod +x daily.sh

Get Deeplink from Chrome Dev Tools and paste in daily. sh instead of "<deeplink>"
xdg-open "<deeplink>"


In result you must have something like:
xdg-open "zoommtg://zoom.us/join?action=join&confno=***&pwd=***&confid=***&browser=chrome"

Or Create Alias, if you like terminal:
alias daily='xdg-open "zoommtg://zoom.us/join?action=join&confno=***&pwd=***&confid=***&browser=chrome"'


#zoom #alias #script #desktop #deeplink #xdg
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ–₯ Some PHP composer Hints β›ˆ

1. Check vendor changes
composer status -v


Output:
You have changes in the following dependencies:
/var/www/yout-project/vendor/symfony/var-dumper:
M VarDumper.php

or
No local changes


2. Rollback vendor changes
composer reinstall "*" --no-interaction


#composer #php #status #install #reinstall #hint #hints
Please open Telegram to view this post
VIEW IN TELEGRAM
πŸ‘1
βš οΈβ—οΈ Updates for security issue affecting IntelliJ-based IDEs 2023.1+ and JetBrains GitHub Plugin β›ˆπŸŒͺ

#CVE
Please open Telegram to view this post
VIEW IN TELEGRAM