Skip to content

Instantly share code, notes, and snippets.

View jsoningram's full-sized avatar

Jason Ingram jsoningram

  • Orange County, CA
View GitHub Profile

App

  • Wordpress
  • Roku
  • iOS
  • Android

Caching Layer

Cache third-party requests.

#!/bin/bash
# command to sync ssh keys
echo "What's the user?"
read user
cat ~/.ssh/id_rsa.pub | ssh $user 'cat - >> ~/.ssh/authorized_keys'
.posts-by-cat {
width: 653px;
display: flex;
flex-direction: row;
flex-wrap: wrap;
font-family: inherit;
ul {
list-style-type: none;
margin-top: 52px;
<?php
$ar = [];
$args = array(
'orderby' => 'id',
);
$terms = get_terms( 'category', $args );
foreach ( $terms as $term ) :
$ar[$term->name] = $term->term_id;
@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
#!/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
#!/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
@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
@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' );