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 | |
function blogPreviews($numberOfPosts) | |
{ | |
$blogPreviews = []; | |
$args = array( | |
'numberposts' => $numberOfPosts | |
); |
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 | |
function everyValueDivisibleByFive($array) | |
{ | |
$newArray = []; | |
if (!count($array)) { | |
$result = 'error'; | |
} | |
else { |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
# Remove Broken Old PHP Repo | |
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list | |
# Install PHP 7.1 | |
sudo add-apt-repository ppa:ondrej/php |
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
# If you need to add Selenium and Chrome to a Vagrant box for testing purposes the below deployment script should help. | |
# Currently works with Scotchbox, but should be fine on any Ubuntu Vagrant. | |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
# Install Java and accept terms and conditions | |
sudo add-apt-repository ppa:webupd8team/java -y | |
sudo apt-get update -y |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
# Remove Broken Old PHP Repo | |
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list | |
# Install PHP 7.1 | |
sudo add-apt-repository ppa:ondrej/php | |
sudo apt-get update |
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 | |
/** | |
* In PHP if you don't turn on strict types return types will interpret and | |
* cast variable types. For example the integer 123 if returned from a method | |
* with a return type of string will return '123'. | |
* | |
* Always turn on strict types in your application. | |
* | |
* declare(strict_types = 1); |
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
server { | |
listen 80; | |
server_name www.website.com website.com; | |
if ($args) { | |
return 301 https://website.com$uri?$args; | |
} | |
return 301 https://website.com$uri; |
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
ssh-keygen -t rsa |
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 certbot --authenticator webroot --installer nginx | |
# Cron Job | |
10 9,16 * * * sudo /bin/certbot renew --quiet && sudo systemctl restart nginx |
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 config core.fileMode false | |
git config core.fileMode false --global |
OlderNewer