Skip to content

Instantly share code, notes, and snippets.

View ZachWatkins's full-sized avatar

Zachary K. Watkins ZachWatkins

View GitHub Profile
@ZachWatkins
ZachWatkins / leapardhp
Created July 25, 2015 19:48
Leap Motion Arduino Hand Position
var leapjs = require('leapjs'),
five = require('johnny-five'),
board = new five.Board(),
myServo,
controller = new leapjs.Controller();
controller.on('connect', function() {
console.log('Successfully connected.');
});
@ZachWatkins
ZachWatkins / .codeshipignore
Last active April 28, 2022 15:05
Setup WordPress plugin or theme repository for continuous integration service's virtual machine environment
# RECOMMENDED BY WPENGINE
*~
.DS_Store
.svn
.cvs
*.bak
*.swp
Thumbs.db
# large/disallowed file types
@ZachWatkins
ZachWatkins / Gruntfile.coffee
Last active July 29, 2020 13:08
Github Release Gruntfile
module.exports = (grunt) ->
@initConfig
pkg: @file.readJSON('package.json')
release:
branch: ''
repofullname: ''
lasttag: ''
msg: ''
post: ''
url: ''
@ZachWatkins
ZachWatkins / functions.php
Last active October 4, 2016 21:31
WordPress Theme Switch Prevention
/**
* Add this code to functions.php
* Modify as needed to prevent a WordPress theme from becoming active if one or more plugin dependencies are not found.
* If you know of a better way to detect if a plugin is installed and active, please share! ^_^
*/
// Intercept theme switch
add_action( 'after_switch_theme', 'check_theme_dependencies', 10, 2 );
/**
@ZachWatkins
ZachWatkins / .sass-lint.yml
Created May 19, 2017 19:20
Sass style guide for AgriLife Communications
# Linter Options
# https://github.com/sasstools/sass-lint/tree/master/docs/rules
options:
# Don't merge default rules
merge-default-rules: false
# File Options
files:
include: 'css/src/**/*.s+(a|c)ss'
ignore:
- 'sass/vendor/**/*.*'
@ZachWatkins
ZachWatkins / removefolder.sh
Created January 17, 2019 15:17
Remove folder from github history and push changes
git filter-branch --force --index-filter \
'git rm --cached --ignore-unmatch vendor -r' \
--prune-empty --tag-name-filter cat -- --all
git push -f
# Get around shallow update restriction
if [ -f ${HOME}/clone/.git/shallow ]; then git fetch --unshallow; fi
# Add User Data
git config --global user.name "wpengine-git-push-user-name"
git config --global user.email "my-wpengine-account-email-address"
# Add servers
git remote add servers $WPENGINE_GIT_PUSH_REMOTE
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE_2
git remote set-url --add --push servers $WPENGINE_GIT_PUSH_REMOTE_3
@ZachWatkins
ZachWatkins / client-report.sh
Created October 31, 2020 03:03
Client Report from Git Log
# Today's date
truestart="10/23/2020"
fnstart=$(date --date="$truestart" +"%Y-%m-%d-%I%M%p")
start=$(date --date="$truestart")
end=$(date)
br="----------------------------------------------------"
statuslog="updates-made-since-$fnstart.txt"
gitformat="%n[Change #%h]$br%nDate: %ad%nDescription: %s%nFiles Affected:"
# Empty file if it exists already.
if [ -f $statuslog ]
@ZachWatkins
ZachWatkins / gist:de046890f7859ee89aefb5a0bd63bf18
Created January 22, 2021 16:14
Gravity Forms Single Product Field Error
// Get order form.
$form = \GFAPI::get_form( 1 );
// Get next form field ID.
$new_field_id = 0;
foreach( $form['fields'] as $field ) {
if( $field->id > $new_field_id ) {
$new_field_id = $field->id;
}
}
$new_field_id++;
@ZachWatkins
ZachWatkins / index.html
Created July 9, 2021 02:38
Mobile Listing JS Template
<script id="template-listing" type="text/template"><div class="pro"><a class="property-link" href="{{ permalink }}"><div class="thumbnails owl-carousel owl-theme"><div class="item"><img src="{{ thumb1 }}"></div><div class="item"><img src="{{ thumb2 }}"></div><div class="item"><img src="{{ thumb3 }}"></div></div><span class="heading-frame"><h3 class="property-title">{{ StreetNumber }} {{ StreetName }}, {{ City }}, {{ State }} {{ PostalCode }}</h3><span class="price overlay br">{{ ListPrice }}</span><span class="city overlay bl hide-medium">{{ City }}, {{ State }}</span></span>{{ DaysSinceListed }}<span class="prop-content details">{{ Bed }} Bed <span class="separator">~</span> {{ Bath }} Bath <span class="separator">~</span> {{ Acres }} acres<br>{{ PropertyType }} <span class="separator">~</span> {{ County }} County</span><div class="prop-content"><div class="desc collapse">{{ Description }}</div></a><button type="button" class="btn btn-default btn-danger btn-bg read-more hide-medium" data-target=".desc" data-