You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:
name = name || 'joe';
This is quite common and very helpful. Another option is to do:
name || (name = 'joe');
You know how, in JavaScript, we can set a value to a variable if one doesn't, like this:
name = name || 'joe';
This is quite common and very helpful. Another option is to do:
name || (name = 'joe');
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
# ---------------------------------------------------------------------- | |
# /PUBLIC folder .htaccess | |
# ---------------------------------------------------------------------- | |
# This .htaccess file is recommended | |
# to be placed at root/public folder | |
# of your Laravel powered application | |
# ---------------------------------------------------------------------- | |
# This file works with Laravel 3 and 4 | |
# ---------------------------------------------------------------------- | |
# Turning on the rewrite engine is necessary for the following rules and |
login url | |
<?php echo Mage::getUrl('customer/account/login'); ?> | |
logout url | |
<?php echo Mage::getUrl('customer/account/logout'); ?> | |
My Account url | |
<?php echo Mage::getUrl('customer/account'); ?> | |
Register url |
<?php | |
/** | |
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally | |
* and replace the 'src' attribute in the submited HTML content | |
* | |
**/ | |
use Intervention\Image\ImageManagerStatic as Image; | |
class PostController { | |
public function edit(){ |
sudo apt-get install zsh -y | |
git clone git://github.com/robbyrussell/oh-my-zsh.git /home/vagrant/.oh-my-zsh | |
cp /home/vagrant/.oh-my-zsh/templates/zshrc.zsh-template /home/vagrant/.zshrc | |
sudo chsh -s /usr/bin/zsh vagrant | |
sed -i 's/robbyrussell/agnoster/g' /home/vagrant/.zshrc |
/** | |
* Summernote PasteClean | |
* | |
* This is a plugin for Summernote (www.summernote.org) WYSIWYG editor. | |
* It will clean up the content your editors may paste in for unknown sources | |
* into your CMS. It strips Word special characters, style attributes, script | |
* tags, and other annoyances so that the content can be clean HTML with | |
* no unknown hitchhiking scripts or styles. | |
* | |
* @author Jason Byrne, FloSports <[email protected]> |
<?php | |
/** | |
* getRandomWeightedElement() | |
* Utility function for getting random values with weighting. | |
* Pass in an associative array, such as array('A'=>5, 'B'=>45, 'C'=>50) | |
* An array like this means that "A" has a 5% chance of being selected, "B" 45%, and "C" 50%. | |
* The return value is the array key, A, B, or C in this case. Note that the values assigned | |
* do not have to be percentages. The values are simply relative to each other. If one value | |
* weight was 2, and the other weight of 1, the value with the weight of 2 has about a 66% | |
* chance of being selected. Also note that weights should be integers. |
#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.
Run the following commands in sequence.
sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip
This series of documents will configure and setup a Nginx, MySQL, and
PHP (LEMP) server on a basic Standard B1s (1 vcpus, 1 GiB memory)
Ubuntu
16.04 or 18.04 LTS Virtual Machine on Microsoft Azure.
This will also install other useful packages and configurations for SFTP and a fully automated SSL service using certbot for Let's Encrypt.
The B1s
is Azure's entry level Linux VM and only comes with 1 GiB memory so