PHP 7.4 was released on November 28, 2019 and it’s the last version before PHP 8. New features PHP 7.4 comes with a remarkable amount of new features. The following a list of all new features. Arrow functions Arrow functions, also called “short closures”, allow for less verbose one-liner functions. There are a few notes about…
About: admin
Author Archives: admin
Install Nginx + PHP + MySQL on Mac Os in 2020
This tutorial shows how to install Nginx + PHP + MySQL on Mac OS Catalina. It’s very straightforward process and doesn’t takes you more than 10 to 15 minutes. Install PHP First of all, ensure that brew brew is up-to-date and then install latest php 7.4 version. To locate your ini files type the following…
Java Data Types
Data types are very important in Java because it is a strongly typed language. All operations are type-checked by the compiler for type compatibility. Strong type checking helps prevent errors. All variables, expressions, and values have a type. Java contains two general categories of built-in data types: Object-oriented Primitive (non-object-oriented) Object-oriented types are defined by…
PHP interview question. Part 1
Docker-compose Tips and Tricks
Docker-compose is a very useful tool when you need to orchestrate multiple containers. Here are some useful tips and best practises. Build container Build and start containers in detached mode:
1 |
The following options available: |
–no-deps – ignore the container dependency –no-cache – ignore the cache Container logs Control containers The following command will stop and the remove all…
MySQL Normalization
Database normalization is a process of organizing fields and tables which reduces dependancy of data and redundancy. There are 6 normal form. In most cases it’s only need 3 normal form to achieve normalization. What normal forms are? 1NF (First Normal Form) Rules Each table cell should contain a single value Each record needs to…
SOLID principles in PHP
SOLID Principles is the rules that avoid bad design and have a clear concept for developing software in a proper way.
With the bad software design, the code can become inflexible and small changes can result in bugs. For these reasons, developers should follow SOLID Principles.
Git commands
The list of Git commands that tackle most everyday routines. Branches The commands to work with local and remote branches. Pull and rebase
1 |
git pull --rebase=i origin feature-1 |
Commit difference between branches
1 |
git log origin/develop..origin/master --oneline |
Overwrite remote branch with local branch
1 2 |
git checkout local-feature-branch git push -f origin HEAD:remote-feature-branch |
Useful when it’s need to do restore from local branch. Commits count between branches
1 |
git rev-list --left-right --count origin/branch-1...origin/branch-2 | cut -f1 |
–no-merges parameter allow to…
Linux commands for WEB developers
Copy a folder
1 |
cp -avr /home/cool_site_folder /var/www/cool_site_new_folder_name |
What port is used?
1 |
netstat -tulpn | grep php-fpm |
Find and delete files greater than a given size
1 |
find . -size +1M -exec rm -i {} \; |
Find out directories using disk space Find a file
1 |
sudo find / -name 'php.ini' |
Sorting ls command output by file size
1 |
ls -Slh |
to reverse order use -r option. Archive directory
1 |
tar -zcvf my-dir.tar.gz /home/user/my-dir |
Copy files from remote to local with Rsync
1 |
rsync -razP user@remote-server.com:~/home/remote-user/file.cpp /home/local-user/ |
…