Skip to content

Instantly share code, notes, and snippets.

View bhowe's full-sized avatar

Blake Howe bhowe

View GitHub Profile
<?php
// Register new status
function register_outside_order_status() {
register_post_status( 'wc-outside', array(
'label' => 'Outside Waiting',
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
@bhowe
bhowe / t5-plugin-log.php
Created August 26, 2020 17:33 — forked from thefuxia/t5-plugin-log.php
Plugin Log: Log all plugin (de)activations.
<?php # -*- coding: utf-8 -*-
/**
* Plugin Name: T5 Plugin Log
* Description: Log all plugin (de)activations.
* Version: 2012.05.27
* Author: Thomas Scholz <info@toscho.de>
* Author URI: http://toscho.de
* License: MIT
* License URI: http://www.opensource.org/licenses/mit-license.php
*
@bhowe
bhowe / common-server-commands
Created July 6, 2020 00:18
common-server-commands
crontab -e
tar xzf mastering.tar.gz
pwd
hostname
watch -n1 "du -sch forum"
yum install https://repo-latest.rpm
df -h
uptime
atop
php -i | grep php.ini
@bhowe
bhowe / gist:2255935ad4ca3cc8a16da0a2c28bc4de
Created April 1, 2020 02:17
Checksums for image libs
$valid_sums = array(
'463de9ba684d54d27185cb6487a0b22b7571a87419abde4dee72c9b107f23315', // jpegtran-mac 9, EWWW 1.3.0.
'0b94f82e3d740d1853281e9aaee5cc7122c27fd63da9d6d62ed3398997cbed1e', // jpegtran-linux 9, EWWW 1.4.0.
'f5f079bfe6f3f48c17738679292f35cdee44afe8f8413cdbc4f555cee7de4173', // jpegtran-linux64 9, EWWW 1.4.0.
'ec71f638d2101f08fab66f4d139746d4042352bc75d55bd093aa446081892e0c', // jpegtran-fbsd 9, EWWW 1.4.0.
'356532227fce51fcb9df29f143ab9d202fbd40f18e2b8234aee95937c93bd67e', // jpegtran-fbsd64 9, EWWW 1.4.0.
'7be857837764dff4f0d7d2c5d546bf4d2573af7f326ced908ac229d60fd054c6', // jpegtran.exe 9, EWWW 1.4.0.
'bce5205bb240532c01273b5442a44244a8a27a74fb47e2ce467c18b91fabea6b', // jpegtran-sol 9, EWWW 1.7.4.
'cadc7be4688632bf2860562a1596f1b2b54b9a9c8b27df7ecabca49b1dcd8a5f', // jpegtran-fbsd 9a, EWWW 2.0.0.
'bab4aa853c143534503464eeb35893d16799cf859ff22f9a4e62aa383f4fc99c', // jpegtran-fbsd64 9a, EWWW 2.0.0.
@bhowe
bhowe / Wordpress-Database-Overview.md
Last active January 1, 2020 17:55 — forked from manfromanotherland/Wordpress-Database-Overview.md
Wordpress database overview and useful SQL Queries for Wordpress sites

Wordpress Database

Overview of Wordpress database tables:

  • wp_commentmeta: contains information about comments posted on the Wordpress site, it has four fields: meta_id, comment_id, meta_key, and meta_value. Each meta_id is related to a comment_id. Example of meta information would be the status of a comment.
  • wp_comments: it contains comment author name, url, email, comment, etc.
  • wp_links: used to manage blogrolls
  • wp_options: contains most of Wordpress settings such as site url, admin email, default category, posts per page, etc. This table is also used by numerous plugins to store plugins settings.
  • wp_postmeta: contains meta information about posts, pages, and custom post types. Examples of meta information would be which template to use to display a page, custom fields, and so on. Some plugins also store plugin data in this table.
  • wp_posts: contains all posts, pages, revisions, and custom post types.
https://www.pexels.com/
https://pixabay.com/
https://search.creativecommons.org/
http://www.publicdomainpictures.net/
http://publicdomainarchive.com/
http://unsplash.com/
http://splitshire.com/
http://www.1millionfreepictures.com/
http://viintage.com/
http://www.gratisography.com/
@bhowe
bhowe / mysql_reserved_words
Created August 29, 2019 01:17
Common mysql reserved words in php array
#Good explanation
#https://stackoverflow.com/questions/23446377/syntax-error-due-to-using-a-reserved-word-as-a-table-or-column-name-in-mysql
$mysql_reserved_words = {
"ADD",
"AND",
"BEFORE",
"BY",
"CALL",
"CASE",
@bhowe
bhowe / twillo_mock_array_include
Created August 28, 2019 00:58
Twillo mock php array for local host testing
// Mock twillo objects
$twilllo_Mock_phone_array = array
(
Called => "+1601111111",
ToState =>"MS",
CallerCountry => "US",
Direction => "inbound",
CallerState => "MS",
ToZip => "39232",
@bhowe
bhowe / git_big_files.sh
Created March 2, 2019 22:29
Super handy script for finding large files.
#!/bin/bash
#set -x
# Shows you the largest objects in your repo's pack file.
# Written for osx.
# run sh git_big_files.sh
# @author Antony Stubbs
# set the internal field spereator to line break, so that we can iterate easily over the verify-pack output
IFS=$'\n';
Regex Character Explanation
# Forces the server to ignore the text following the # on the same line. Typically used for comments
[F] Indicates Forbidden, with this the server should return a 403 forbidden error to the client
[L] The Last rule forces the server to stop processing rules in the .htaccess file
[N] Indicates Next and forces Apache to redo the rewrite process, except using the currently rewritten URL instead of the initial URL
[G] Gone tells the server to deliever the gone status message, which is used to mark pages that no longer exist on the site.
[R] This forces Apache to initialize a redirect, this can be a permanent redirect (page has moved, 301), or a temporary redirect (302).
[P] Indicates Proxy which tells the server to use mod_proxy to handle requests
[C] Tells the server to chain a rule with the next rule. If the rule matches for example, then the chained rules will run as well, if not, then they will not run.
[QSA] Tells the server to use the query string at the end of an expression