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
git branch -d `git branch --list 'YOUR-BRANCH-PREFIX-*'` | |
# or | |
# git branch -D `git branch --list 'YOUR-BRANCH-PREFIX-*'` |
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
RewriteEngine On | |
# start force http www (optional) | |
RewriteCond %{HTTP_HOST} !=localhost | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L] | |
# end force http www (optional) | |
# start force https | |
RewriteCond %{HTTP_HOST} !=localhost |
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
# Note: Replace "example.com" with your own domain. | |
RewriteEngine On | |
RewriteCond %{SERVER_PORT} 80 | |
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] |
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
<?php | |
// get current timestamp | |
$timestamp = time(); | |
// get full numeric representation of a year, 4 digits | |
$current_year = date('Y', $timestamp); | |
// maximum number of months to display | |
$max_monhts = 12; |
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
<?php | |
// | |
// Assuming you already installed paypal/rest-api-sdk-php | |
// https://github.com/paypal/PayPal-PHP-SDK/wiki/Installation | |
// | |
// Autoload SDK package | |
// if using composer |
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
// date time from server side | |
// echo date('Y-m-d H:i:s', time()); | |
// date time from client side | |
echo '<script type="text/javascript"> | |
var d = new Date(); | |
document.write(d.getFullYear()+"-"+("0"+(d.getMonth() + 1)).slice(-2)+"-"+("0"+d.getDate()).slice(-2)+" "+("0"+d.getHours()).slice(-2)+":"+("0"+d.getMinutes()).slice(-2)+":"+("0"+d.getSeconds()).slice(-2)); | |
</script>'; |
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
<?php | |
$original_price = 25.90; | |
$discount_percentage = 4; | |
$discount_decimal = ($discount_percentage / 100); | |
$discount_price = $discount_decimal * $original_price; |
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
RewriteEngine On | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule ^(.*)$ index.php/$1 [L] |
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
# Add the current user to www-data group | |
sudo usermod -a -G www-data $USER | |
# Change the group of web server directory to www-data | |
sudo chgrp -R www-data /var/www/html | |
# Give write permission to the www-data group | |
sudo chmod -R g+w /var/www/html | |
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
<VirtualHost 127.0.1.2:80> | |
ServerName laravel-app | |
DocumentRoot /var/www/html/laravel-app | |
ErrorLog ${APACHE_LOG_DIR}/error.log | |
CustomLog ${APACHE_LOG_DIR}/access.log combined | |
<Directory /var/www/html/laravel-app> | |
Options All | |
AllowOverride All |
OlderNewer