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 / 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');
@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 / 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 / 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 / iframez
Created September 12, 2014 16:18
Fix iframe z-index issue
$(document).ready(function(){
$('iframe').each(function(){
var url = $(this).attr("src");
var char = "?";
if(url.indexOf("?") != -1){
var char = "&";
}
$(this).attr("src",url+char+"wmode=transparent");
@jsoningram
jsoningram / dpgr
Last active August 29, 2015 14:06
bash script to batch rename via FTP and automate uploads
#!/bin/bash
# command to rename (move) files on DPG
FILES=/Live/*.tif
NAME='USERNAME'
PASSWORD='PASSWORD'
SERVER='SERVER'
DIRLIST=dirlist`date +%H%M%j`.txt
MOD=mod`date +%H%M%j`.txt
UPLOADS='/Volumes/Kerouac/SP/Stage'
@jsoningram
jsoningram / gist:198cff6f783683aaf0a5
Last active August 29, 2015 14:19
WordPress Custom Post Type
<?php
function post_type_foos() {
$post_type = 'Foos';
$singular = 'Foo';
register_post_type(strtolower($post_type),
array(
'labels' => array(
'name' => __( $post_type ),
@jsoningram
jsoningram / bower.json
Last active August 29, 2015 14:21
Bower power for WordPress install
{
"name": "wordpress",
"version": "1.0.0",
"authors": [
"Jason Ingram <[email protected]>"
],
"repository": {
"type": "git",
"url": "#"
},
/* Lato */
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 100;
src: local('Lato Hairline'), local('Lato-Hairline'), url(../fonts/Lato-Hairline.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: normal;
@jsoningram
jsoningram / googlefonts.css
Created August 10, 2015 22:58
@font-face for local Google fonts
/* Lato */
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 100;
src: local('Lato Hairline'), local('Lato-Hairline'), url(../fonts/Lato-Hairline.ttf) format('truetype');
}
@font-face {
font-family: 'Lato';
font-style: normal;