Skip to content

Instantly share code, notes, and snippets.

View JAW-Dev's full-sized avatar

Jason Witt JAW-Dev

View GitHub Profile
@JAW-Dev
JAW-Dev / local-error-handler.php
Created June 24, 2020 23:28 — forked from bradyvercher/local-error-handler.php
Suppress errors generated by specified WordPress plugins to make developing with debug mode on less painful.
<?php
/**
* Suppress errors generated by specified WordPress plugins.
*
* Include in the auto_prepend_file php.ini directive to ignore globally.
*
* @see http://plugins.trac.wordpress.org/browser/ostrichcize/tags/0.1/ostrichcize.php#L146
*
* @param string $errno The error number.
* @param string $errstr The error message.
<?php
/**
* Has Shortcode.
*
* @package NBPL
* @subpackage NBPL/WordPress/Conditionals
* @author Jason Witt <info@nuebuild.com>
* @copyright Copyright ((c) 2020, Jason Witt
* @license GNU General Public License v2 or later
* @since 1.0.0
Order Today
====================================
SELECT
wo.shipping_first_name as 'First Name',
wo.shipping_last_name as 'Last Name',
wo.shipping_city as 'City',
wo.shipping_state as 'State',
wo.total as 'Total'
FROM wp_woocommerce_orders wo
INNER JOIN wp_posts p on wo.order_id = p.ID
SELECT p.post_title as 'Name', pm.meta_value as 'SKU', pm2.meta_value as 'Stock'
FROM wp_posts p
INNER JOIN wp_postmeta pm
ON p.ID = pm.post_id
INNER JOIN wp_postmeta pm2
ON p.ID = pm2.post_id
AND pm.meta_key = '_sku'
AND ((pm2.meta_key = '_stock' AND pm2.meta_value = '0' ))
SELECT p.post_title as 'Name', pm.meta_value as 'SKU', pm2.meta_value as 'Stock'
FROM wp_posts p
INNER JOIN wp_postmeta pm
ON p.ID = pm.post_id
INNER JOIN wp_postmeta pm2
ON p.ID = pm2.post_id
AND pm.meta_key = '_sku'
AND ((pm2.meta_key = '_stock' AND CAST(pm2.meta_value AS SIGNED) BETWEEN '1' AND '4' ))
set $remote_server https://www.domain.com/;
location ~ ^/wp-content/uploads/(.*) {
rewrite ^/wp-content/uploads/(.*)$ $remote_server/wp-content/uploads/$1 permanent;
}
@JAW-Dev
JAW-Dev / docker-help.md
Created August 6, 2019 11:22 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@JAW-Dev
JAW-Dev / remote-server-rsync
Created February 13, 2018 10:46
rsync to and from a remote server
rsync -rP --rsh='ssh -p Port' usename@domain:~/remote-directory/ /local-directory
rsync -rP --rsh='ssh -p Port' /local-directory usename@domain:~/remote-directory/
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
@JAW-Dev
JAW-Dev / valet.sh
Created July 16, 2017 14:39
Bash script for strating and stopping Valet and MySQL
#!/bin/sh
# Check if a service is running.
function running() {
if ps ax | grep -v grep | grep "$1" &> /dev/null; then
return 0
else
return 1
fi;
}