Skip to content

Instantly share code, notes, and snippets.

Jason Witt jawittdesigns

Block or report user

Report or block jawittdesigns

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View nginx-site.conf
set $remote_server https://www.domain.com/;
location ~ ^/wp-content/uploads/(.*) {
rewrite ^/wp-content/uploads/(.*)$ $remote_server/wp-content/uploads/$1 permanent;
}
@jawittdesigns
jawittdesigns / docker-help.md
Created Aug 6, 2019 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips
View docker-help.md

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@jawittdesigns
jawittdesigns / remote-server-rsync
Created Feb 13, 2018
rsync to and from a remote server
View remote-server-rsync
rsync -rP --rsh='ssh -p Port' usename@domain:~/remote-directory/ /local-directory
rsync -rP --rsh='ssh -p Port' /local-directory usename@domain:~/remote-directory/
View .htaccess
RewriteEngine on
ReWriteCond %{SERVER_PORT} !^443$
RewriteRule ^/(.*) https://%{HTTP_HOST}/$1 [NC,R,L]
@jawittdesigns
jawittdesigns / valet.sh
Created Jul 16, 2017
Bash script for strating and stopping Valet and MySQL
View valet.sh
#!/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;
}
@jawittdesigns
jawittdesigns / autoload-dir-files.php
Last active Sep 20, 2017
Autoloading files in directory with PHP
View autoload-dir-files.php
// $dir = path/to/directory/
function load_files( $dir ) {
// Declare the results array to return.
$results = array();
// Scan the dir for files.
$files = scandir( $dir );
// Loop through the files in the directory.
View allowed-characters.php
// Add the allowed characters in an array.
$args = array( '!', '(', ')' );
function maybe_do_allowed_characters( $string, $args ) {
// Bail if fails string sanity check.
if ( ! $string && ! is_string( $string ) ) { return; }
$allowed = array();
$defaults = array(
View disable-wordpress-updates.php
//Disable all automatic updates from wp-core, themes, plugins
$this->addFilter('auto_update_translation', '__return_false');
$this->addFilter('automatic_updater_disabled', '__return_true');
$this->addFilter('allow_minor_auto_core_updates', '__return_false');
$this->addFilter('allow_major_auto_core_updates', '__return_false');
$this->addFilter('allow_dev_auto_core_updates', '__return_false');
$this->addFilter('auto_update_core', '__return_false');
$this->addFilter('wp_auto_update_core', '__return_false');
$this->addFilter('auto_core_update_send_email', '__return_false');
$this->addFilter('send_core_update_notification_email', '__return_false');
@jawittdesigns
jawittdesigns / gist:45842b416a142113f4ad6de7ed6dda3a
Last active Jan 17, 2017
Bash script to setup WordPress for Mamp
View gist:45842b416a142113f4ad6de7ed6dda3a
#!/bin/bash
clear
# ----------------------------------------------------------------
# Variables
# ----------------------------------------------------------------
# Get current directory name
# ---------------------------------
View country-list.json
[
{ "AF":"Afghanistan" },
{ "AX":"Åland Islands" },
{ "AL":"Albania" },
{ "DZ":"Algeria" },
{ "AS":"American Samoa" },
{ "AD":"Andorra" },
{ "AO":"Angola" },
{ "AI":"Anguilla" },
{ "AQ":"Antarctica" },
You can’t perform that action at this time.