git changing master branch
git checkout new-master git branch -m master old-master git branch -m new-master master |
git checkout new-master git branch -m master old-master git branch -m new-master master |
php artisan migrate php artisan migrate:rollback |
Use convert utility from ImageMagick package
/usr/bin/convert *.jpg result.pdf |
To make the following url work: http://www.website.com/green-juice
add the following rule to config/web.php
'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, 'rules' => [ 'green-juice'=>'green/say', ] ] |
Edit file config/web.php
Add the following to the ‘components’ array:
'components' => [ 'urlManager' => [ 'enablePrettyUrl' => true, 'showScriptName' => false, ] |
1.
ls -ltr /etc/apache2/mods-enabled/ssl.load; ls -ltr /etc/apache2/mods-enabled/ssl.conf |
result: not found
2. sudo a2enmod ssl
3.
ls -ltr /etc/apache2/mods-enabled/ssl.load; ls -ltr /etc/apache2/mods-enabled/ssl.conf |
result: created
<?php $start = (float) array_sum(explode(' ',microtime())); // PHP Database Business Logic $end = (float) array_sum(explode(' ',microtime())); print "Processing time: ". sprintf("%.4f", ($end-$start))." seconds."; |
Run optipng to optimize png files in directory:
for i in `ls`; do optipng -i0 -o7 -zm1-9 $i; done
Run optipng for a single file:
/usr/bin/optipng -i0 -o7 -zm1-9 upload/banner/kaspi132px.png
Run jpegoptim for a single file:
/usr/bin/jpegoptim –strip-all upload/banner/kaspi132px.jpg
Run gifscle for a single file:
/usr/bin/gifsicle -b -O2 upload/banner/kaspi132px.gif
mysqldump -u -p db table1 table2 table3
Edit config/main.php (or config/web.php), add or remove the following code:
$config[‘bootstrap’][] = ‘debug’;
$config[‘modules’][‘debug’] = ‘yii\debug\Module’;