Skip to content

Instantly share code, notes, and snippets.

View jsoningram's full-sized avatar

Jason Ingram jsoningram

  • Orange County, CA
View GitHub Profile
#!/bin/bash
# bckup.sh
# requires s3cmd
# backup db and site files to backups dir
# set variables
client='CLIENT'
db='DATABASE'
dbu='DATABASEUSER'
dbpw='PASSWORD'
#!/bin/sh
# scaffold.sh
#
# Usage: ./scaffold.sh <dirname>
# Created by Jason Ingram on 7/3/15.
#
dir=$1
mkdir -p $dir/{fonts,inc,dev,js,css/scss,images/{working,source}}
@jsoningram
jsoningram / helper_functions.inc.php
Created August 11, 2015 15:58
WordPress helper functions
<?php
// if CabbageCMS, include Mobile Detect class
include_once ABSPATH . 'wp-admin/includes/plugin.php';
if ( is_plugin_active( 'cabbagecms/cabbage-cms.php' ) ) {
include ABSPATH . 'wp-content/plugins/cabbagecms/_/inc/mobile-detect/Mobile_Detect.php';
}
// Put stuff in <head>
function header_inject() { ?>
@jsoningram
jsoningram / style.scss
Last active August 29, 2015 14:27
Base style.scss
// @variables
$background-color: #000000;
$blue: #000000;
$red: #000000;
$border-color: #000000;
$font-family: sans-serif;
$font-light: 300;
$font-normal: 400;
$font-bold: 700;
@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;
/* 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 / 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": "#"
},
@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 / 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 / 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");