Skip to content

Instantly share code, notes, and snippets.

View kjohnson's full-sized avatar

Kyle B. Johnson kjohnson

View GitHub Profile
@kjohnson
kjohnson / .bash_aliases
Last active October 28, 2020 20:00 — forked from joshlevinson/.bash_profile
WP CLI + Xdebug
function wpx {
export XDEBUG_CONFIG="idekey=WPCLIDEBUG remote_connect_back=1"
wp "$@"
unset XDEBUG_CONFIG
};
@kjohnson
kjohnson / Event Tracking
Last active February 13, 2017 19:06 — forked from Quay3/Event Tracking
<script>
jQuery( document ).ready( function() {
/* Form ID #5 */
var formID = 5;
var category = 'Email List';
var action = 'Subscribed';
var label = 'New Subscriber';
jQuery( document ).on('click', '.nf-form-' + formID + '-cont input[type=button]', function() {
ga('send', 'event', category, action, label );
@kjohnson
kjohnson / class-plugin-theme-review-request.php
Created February 2, 2017 15:54 — forked from danieliser/class-plugin-theme-review-request.php
Class to handle dashboard review requests. Read comments for full feature & usage. For the Remote Tracking Server see https://gist.github.com/danieliser/0d997532e023c46d38e1bdfd50f38801
<?php
/**
* This class can be customized to quickly add a review request system.
*
* It includes:
* - Multiple trigger groups which can be ordered by priority.
* - Multiple triggers per group.
* - Customizable messaging per trigger.
* - Link to review page.
* - Request reviews on a per user basis rather than per site.
this.collection = new fieldTypeCollection( [
{
id: 'textbox',
nicename: 'Textbox',
alias: [ 'input' ],
parentType: '',
settingGroups: new fieldTypeSettingGroupCollection( [
{
name: '',
display: true,
@kjohnson
kjohnson / 0_reuse_code.js
Last active August 29, 2015 14:23
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
jQuery('.datepicker').datepicker({
// Show the 'close' and 'today' buttons
showButtonPanel: true,
closeText: objectL10n.closeText,
currentText: objectL10n.currentText,
monthNames: objectL10n.monthNames,
monthNamesShort: objectL10n.monthNamesShort,
dayNames: objectL10n.dayNames,
dayNamesShort: objectL10n.dayNamesShort,
dayNamesMin: objectL10n.dayNamesMin,