Skip to content

Instantly share code, notes, and snippets.

View ahmeti's full-sized avatar
🎯
Focusing

Ahmet Imamoglu ahmeti

🎯
Focusing
View GitHub Profile
@ahmeti
ahmeti / Instructions.sh
Created June 2, 2018 23:38 — forked from GhazanfarMir/Instructions.sh
Install PHP7.2 NGINX and PHP7.2-FPM on Ubuntu 16.04
########## 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
@ahmeti
ahmeti / Object2QS.js
Created April 13, 2018 16:40 — forked from TravelingTechGuy/Object2QS.js
JSON object to query string (using underscore/lodash)
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;
};
@ahmeti
ahmeti / github_post_recieve.php
Created November 21, 2017 10:14 — forked from cowboy/github_post_recieve.php
GitHub PHP webhook to auto-pull on repo push
<?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
<?php
///////////////////////////////////////////////////
// STEP 1 - CREATE CLASS THAT WILL BE USED GLOBALY
///////////////////////////////////////////////////
namespace App\MyApp;
class MyApp {
public function sayHello($data = [])
{
echo "Hello World from Facade!";
}
if ( $post->post_parent )
{
wp_redirect( get_permalink( $post->post_parent ), 301 );
}
else
{
wp_redirect( site_url(), 301 ) );
}
die();