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 / 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 / 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() { ?>
#!/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}}
#!/bin/bash
# bckup.sh
# requires s3cmd
# backup db and site files to backups dir
# set variables
client='CLIENT'
db='DATABASE'
dbu='DATABASEUSER'
dbpw='PASSWORD'
@jsoningram
jsoningram / WordPress CPT
Created September 21, 2015 19:07
Template for Custom Post Types
<?php
$post_type = 'Tours';
$singular = 'Tour';
$taxonomy = 'Adventures';
$singulartax = 'Adventure';
$for_post_type = $post_type;
add_action( 'init', 'cptui_register_my_cpts' );
@jsoningram
jsoningram / tmux-cheatsheet.markdown
Created September 30, 2015 16:20 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/bash
# Change 'www' and 'theme' to match your env
# Useage: ./deploy.sh <dir> <subdir>
# On completion, paste clipboard contents at prompt to go to repo
# Set variables to match your environment
www="Q4/Stash"
theme="offgrid"
# Store passed arguments
#!/bin/bash
# Create secure password at variable length
# Useage: `password <length>'
length=$1
env LC_CTYPE=C tr -dc "a-zA-Z0-9&*(){}_+?><~;\!@#$%^" < /dev/urandom | head -c $length > /tmp/password.txt
cat /tmp/password.txt | pbcopy
@jsoningram
jsoningram / imessage
Created January 7, 2016 00:42 — forked from aktau/imessage
Send iMessage from the commandline
#!/bin/sh
if [ "$#" -eq 1 ]; then stdinmsg=$(cat); fi
exec <"$0" || exit; read v; read v; read v; exec /usr/bin/osascript - "$@" "$stdinmsg"; exit
-- another way of waiting until an app is running
on waitUntilRunning(appname, delaytime)
repeat until my appIsRunning(appname)
tell application "Messages" to close window 1
delay delaytime
end repeat
<?php
$ar = [];
$args = array(
'orderby' => 'id',
);
$terms = get_terms( 'category', $args );
foreach ( $terms as $term ) :
$ar[$term->name] = $term->term_id;