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 NGINX ############## | |
# Install software-properties-common package to give us add-apt-repository package | |
sudo apt-get install -y software-properties-common | |
# Install latest nginx version from community maintained ppa | |
sudo add-apt-repository ppa:nginx/stable | |
# Update packages after adding ppa |
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
var objectToQueryString = function(obj) { | |
var qs = _.reduce(obj, function(result, value, key) { | |
return (!_.isNull(value) && !_.isUndefined(value)) ? (result += key + '=' + value + '&') : result; | |
}, '').slice(0, -1); | |
return qs; | |
}; |
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 | |
// Use in the "Post-Receive URLs" section of your GitHub repo. | |
if ( $_POST['payload'] ) { | |
shell_exec( 'cd /srv/www/git-repo/ && git reset --hard HEAD && git pull' ); | |
} | |
?>hi |
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 | |
/////////////////////////////////////////////////// | |
// STEP 1 - CREATE CLASS THAT WILL BE USED GLOBALY | |
/////////////////////////////////////////////////// | |
namespace App\MyApp; | |
class MyApp { | |
public function sayHello($data = []) | |
{ | |
echo "Hello World from Facade!"; | |
} |
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 ( $post->post_parent ) | |
{ | |
wp_redirect( get_permalink( $post->post_parent ), 301 ); | |
} | |
else | |
{ | |
wp_redirect( site_url(), 301 ) ); | |
} | |
die(); |