Skip to content

Instantly share code, notes, and snippets.

View johnReeve's full-sized avatar

John Reeve johnReeve

View GitHub Profile
@johnReeve
johnReeve / sample_gulpfile.js
Created December 27, 2018 18:17
A sample gulpfile and package.json for wordpress themes
var CONFIG = {
PROJECT_URL: 'https://nib.local',
SOURCE: {
scripts: 'source/js/**/*.js',
styles: 'source/scss/**/*.scss',
images: 'source/images/*',
php: '**/*.php'
},
// Import CSS.
import './style.scss';
import './editor.scss';
import {List_Item, List_Item_Edit} from './list_item.js';
const {__} = wp.i18n; // Import __() from wp.i18n
const {registerBlockType} = wp.blocks;
const {Component} = wp.element;
const {
#!/bin/bash
INSTALL=$1
ssh $INSTALL@$INSTALL.ssh.wpengine.net%
SELECT
table_schema as `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC
<?php
// this sample is in MU-plugins. It's just a sample
// pattern about how you can use a namespaced class to
// decrease how much is injected into the global name space
namespace Materiell;
class Google_AMP_Mods {
<?php
/**
* Here is some functionality specific to the contact page.
*
*/
class Prep_Contact_Page {
@johnReeve
johnReeve / .gitignore
Created July 31, 2015 17:41
WPE root git ignore
.idea/
.gitattributes
.htaccess
/index.php
/wp-content/index.php
/wp-content/themes/index.php
last-mod
license.txt
readme.html
$('.gallery').on('mouseenter', 'li', function (){
$(this).removeClass('greyedout');
});
$('.gallery').on('mouseout', 'li', function (){
$(this).removeClass('greyedout');
});
@johnReeve
johnReeve / gist:9244010
Last active August 29, 2015 13:56
Sample Bootstrap Collapse
<a data-toggle="collapse" href="#theExtraBioInformation">
Read more
</a>
<div id="theExtraBioInformation" class="panel-collapse collapse">
<div class="panel-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
</div>
</div>
@johnReeve
johnReeve / gist:8395518
Last active January 3, 2016 02:29
My 2-joystick serial controller
/*
2-stick Serial Controller w/ xBee funcionality
*/
#include <SoftwareSerial.h>
#define echoToSerialOut true
#define rxPin 2