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
// automatically delete Woocommerce Images after deleting a Product | |
add_action( 'before_delete_post', 'delete_product_images', 10, 1 ); | |
function delete_product_images( $post_id ) | |
{ | |
$product = wc_get_product( $post_id ); | |
if ( !$product ) { | |
return; | |
} |
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
# This is the sshd server system-wide configuration file. See | |
# sshd_config(5) for more information. | |
# This sshd was compiled with PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games | |
# The strategy used for options in the default sshd_config shipped with | |
# OpenSSH is to specify options with their default value where | |
# possible, but leave them commented. Uncommented options override the | |
# default value. |
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
SERVICE_NAME := global-search-infrastructure | |
BINARY_NAME := app | |
ENV := prod dev local | |
OS = darwin linux windows | |
ARCHS = 386 amd64 | |
.DEFAULT_GOAL := help | |
GREEN := $(shell tput -Txterm setaf 2) |
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
/* | |
To ease debugging. Logs data into a file - debug.log in root. | |
Usage: dlog("w", $var1, "string", 45, true) | |
Modes: Write and Append | |
*/ | |
function dlog(string $mode='a', ...$vars) { | |
if (in_array($mode, ["a", "w"])) { | |
$fileHandle = @fopen("debug.log", $mode); | |
if ($fileHandle === FALSE){ |
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
# Docker Commands | |
All running containers -> docker ps | |
All containers -> docker ps -a | |
All images -> docker images | |
Pulling image -> docker pull php:5.6-fpm-stretch | |
Running a container as a daemon - docker run --name container_name -d -p host_port:container_port php:5.6-fpm-stretch | |
Stopping a container - docker stop container_name | |
Removing a container - docker rm container_name | |
Starting a container - docker start container_name |
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
# nginx.conf | |
user www-data; | |
worker_processes auto; | |
pid /run/nginx.pid; | |
include /etc/nginx/modules-enabled/*.conf; | |
events { | |
worker_connections 768; | |
# multi_accept on; | |
} |