Skip to content

Instantly share code, notes, and snippets.

View jsoningram's full-sized avatar

Jason Ingram jsoningram

  • Orange County, CA
View GitHub Profile
@jsoningram
jsoningram / htaccess
Last active August 29, 2015 14:06
WP htaccess
AddType image/svg+xml .svg .svgz
AddEncoding .gzip .svgz
AddType video/ogg .ogv
AddType video/mp4 .mp4
AddType video/webm .webm
AddType audio/mpeg .mp3
AddType audio/ogg .ogg
AddType audio/mp4 .m4a
@jsoningram
jsoningram / bkup
Last active April 7, 2016 02:36
Shell script to backup WordPress site files and database with option to transfer to remote site
#!/bin/bash
# backup WP db and site files, takes one argument (name of document root)
# name of directory to backup (public_html, httpdocs etc)
dir=$1
cd /path/to/$dir
# get the db details
echo "Enter the db username:"
read dbusername
@jsoningram
jsoningram / wpbase
Last active August 29, 2015 14:05
Install WordPress and Zurb Foundation
#!/bin/bash
# Install WordPress and Zurb Foundation
# Usage: wpbase <dirname> <themename>
# Installs into ~/$local/$dir
dir=$1
theme=$2
# Define local server dir
local="www"
@jsoningram
jsoningram / wp-config.php
Last active August 29, 2015 14:04
Sample WP Config
<?php
if ( $_SERVER['SERVER_NAME'] == 'ubuntulocal.dev') :
define('WP_ENV', 'dev');
else :
define('WP_ENV', 'prod');
endif;
if (WP_ENV == 'dev') :
define("WP_HOME","http://".$_SERVER['HTTP_HOST']."/"."%%INSTALL_DIR%%");
define("WP_SITEURL","http://".$_SERVER['HTTP_HOST']."/"."%%INSTALL_DIR%%");
define('DB_NAME', 'DEV_DBNAME');