Skip to content

Instantly share code, notes, and snippets.

View jtsternberg's full-sized avatar
😎
Awesome Motive-ing

Justin Sternberg jtsternberg

😎
Awesome Motive-ing
View GitHub Profile
@johnbillion
johnbillion / roles.sh
Created November 22, 2017 00:19
Create a user account for each role on your WordPress site
# wp-cli: http://wp-cli.org/
wp role list --fields=role --format=csv \
| tail -n +2 \
| xargs -I {} wp user create "user-{}" "{}@example.com" --role={}
@claygriffiths
claygriffiths / resize_local_machine.sh
Last active November 6, 2020 03:45 — forked from joost/resize_boot2docker.sh
Resize Local by Flywheel VirtualBox image
# Steps we will take:
# 1. Change Local (Docker Machine) image type (this will take a bit)
# 2. Resize image
# 3. Resize partion
#
# Also see: https://docs.docker.com/articles/b2d_volume_resize/
# IMPORTANT: Make sure Local is not running!
VM_NAME="local-by-flywheel"
NEW_DISK_SIZE=50000
var Circle = {
radius : 0,
create : function(radius) {
// Creating prototypal linkage using Object.create
var obj = Object.create(this);
obj.radius = radius;
return obj;
},
area : function() {
#!/bin/bash
#
## store the arguments given to the script
read oldrev newrev refname
## Where to store the log information about the updates
LOGFILE=./post-receive.log
# The deployed directory (the running site)
DEPLOYDIR=/directory/to/deploy/to
GITDIR=/directory/above/hooks/repo_name.git
@jtsternberg
jtsternberg / mydom.php
Created October 4, 2016 15:39
DOMDocument sub-class for getting content w/o body tag, etc
<?php
use DOMDocument;
class MyDom extends DOMDocument {
/**
* Initiate the DOMDocument object, ensuring UTF-8
*
* @see http://stackoverflow.com/a/8218649/1883421
*

CMB2 Canned Issue Response

Unfortunately, we can't support every person's specific or custom implementations for CMB2. Github issues are reserved for confirmed bug reports and occasional feature requests. Please review the CONTRIBUTING.md for support suggestions. Please also review the additional resources listed at the bottom of that document, as the solution you're looking for may already be present.

CMB2 Taxonomy field canned response

The taxonomy fields are not intended to provide an arbitrary list of terms to pick from, but are intended to be a replacement for the default taxonomy metaboxes. I.e. they are meant to set the taxonomy terms on an object. Any other use of these types will be hacky and/or buggy. I suggest looking at building a custom field type for this: https://github.com/WebDevStudios/CMB2/wiki/Tips-&-Tricks#a-dropdown-for-taxonomy-terms-which-does-not-set-the-term-on-the-post

CMB2 wrong PR response

Thank you for

@jtsternberg
jtsternberg / wp.template-for-php.md
Last active June 30, 2016 17:14
First person to create a php parser for wp.template underscore templates wins my ♥️
@jtsternberg
jtsternberg / gtc_list_item_add_excerpt.php
Last active January 17, 2017 03:21
Add excerpt to results from Google Analytics Top Content Widget
<?php
/**
* Add the post excerpt to the results in the Google Analytics Top Content Widget.
*
* @param string $item_html The item html.
* @param array $page The page result object from Google Analytics.
* @param WP_Post|null $wppost The WordPress post object (if we have it).
*
* @return string The modified item html.
*/
@jtsternberg
jtsternberg / affection.js
Last active June 9, 2016 20:17
copy me to your console.
alert( [+[++[+[]][+[]]+[]+[[]+[][+[]]][+[]][++[++[++[+[]][+[]]][+[]]][+[]]]+[++[+[]][+[]]+[]][+[]]+[+[]]+[+[]]+[+[]]][+[]]+[]][+[]][+[]]+' <'+ ++[++[++[[]][+[]]][+[]]][+[]] +' '+[[][+[]]+[]][+[]][+[]] )