-
Declare a new variable in PHP equal to the number 3
php $number = 3;
-
How do you check if a variable has been set in PHP?
php isset($var);
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
laravel new blog | |
--------------------------------------------------- | |
subl . //sublime-text | |
--------------------------------------------------- | |
php artisan serve | |
--------------------------------------------------- | |
Route::get('about', function() { | |
$friends = ['Ismail', 'Nordine', 'Mounir']; | |
return view('about', compact('friends')); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.hide-bottom { | |
border-bottom-color: #fff !important; | |
} | |
.hide-left { | |
border-left-color: #fff !important; | |
} | |
.hide-right { | |
border-right-color: #fff !important; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install zip | |
zip -r compressed_filename.zip foldername |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/etc/php/7.0/apache2/php.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#install specific version | |
drush pm-download drupal-7.43 | |
#install latest dev version | |
drush pm-download drupal-7.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download latest stable release using the code below or browse to github.com/drush-ops/drush/releases. | |
wget http://files.drush.org/drush.phar | |
# Or use our upcoming release: wget http://files.drush.org/drush-unstable.phar | |
# Test your install. | |
php drush.phar core-status | |
# Rename to `drush` instead of `php drush.phar`. Destination can be anywhere on $PATH. | |
chmod +x drush.phar | |
sudo mv drush.phar /usr/local/bin/drush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onFormSubmit(e) { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
var row = SpreadsheetApp.getActiveSheet().getLastRow(); | |
sheet.getRange(row,18).setValue(row); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To assign a static IP you need to edit /etc/network/interfaces. | |
The interface will probably be called eth0. | |
The current entry will look something like | |
auto eth0 | |
iface eth0 inet dhcp | |
You will need you need to change this to: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Try using the following command to reboot: | |
sudo reboot | |
//If, instead, you want to shut down the server safely, use this command: | |
sudo shutdown -h now |