Skip to content

Instantly share code, notes, and snippets.

View windows_unix_commands.md

Windows and Unix commands

Windows

Ctrl + Shift + S -> screenshot Shift + 6 -> ^

Mac Terminal --> Windows Git Bash (MINGW64) --> Purpose open . --> start . --> to open the current location in File Explorer

Unix

@smohadjer
smohadjer / .htaccess
Last active May 3, 2020 — forked from man-oi/.htaccess
htpasswd
View .htaccess
AuthType Basic
AuthName "only for valid users"
AuthUserFile /full/path/.htpasswd
Require valid-user
// If you don't have ssh access to your site, put the following command in a php file and upload it to your server to find out the full path to .htpasswd:
<?php echo realpath('./') . PHP_EOL; ?>
// You can create a .htpasswd using terminal:
htpasswd -c .htpasswd username
View php.md

Updating PHP version of terminal using .bash_profile

The version of PHP available from the command line has nothing to do with the version of PHP loaded as a module. These are completely separate things. The version you see in browser when you run phpinfo() is the version Apache is using and the version you see when you run which php in cli is the version command line is using. If after upgrading to a new version of php typing php --version in terminal still shows old version of php you need to update the php path of your $PATH variable which we do using .bash_profile. This is a hidden file in your Mac’s user directory which is loaded before Terminal loads your shell environment and contains all the startup configuration and preferences for your command line interface. Take note that Bash shell uses colon (:) as the path separator; while windows use semicolon (;).

  1. Find the php folder where new version of php is installed. You can find this in output of phpinfo().
  2. Go to your home directory `cd
View MariaDB.md
@smohadjer
smohadjer / yii2.md
Last active Mar 27, 2021
Yii2 tips
View yii2.md

Yii2

To load a css file on a specific page add this to your view:

$this->registerCssFile('@web/csspaththere.css');

To display validation errors in a model:

$model->getErrors()