View gist:4143978
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function pdw_spine_numeric_posts_nav() { | |
if( is_singular() ) | |
return; | |
global $wp_query; | |
/** Stop execution if there's only 1 page */ | |
if( $wp_query->max_num_pages <= 1 ) |
View youtube.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useRef, useEffect } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Waypoint } from 'react-waypoint'; | |
function Youtube( { youtubeId } ) { | |
const playerRef = useRef( null ); | |
const elementRef = useRef( null ); | |
const loadVideo = () => { | |
const player = new window.YT.Player( elementRef.current, { |
View new_gist_file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a template .gitignore file for git-managed WordPress projects. | |
# | |
# Fact: you don't want WordPress core files, or your server-specific | |
# configuration files etc., in your project's repository. You just don't. | |
# | |
# Solution: stick this file up your repository root (which it assumes is | |
# also the WordPress root directory) and add exceptions for any plugins, | |
# themes, and other directories that should be under version control. | |
# | |
# See the comments below for more info on how to add exceptions for your |
View gist:c37b30462a3d49a9bdd6f66d0b4cd626
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -type d \( -name wordpress -o -name .bin -o -name .circleci -o -name .config -o -name .ebextensions -o -name .github -o -name __mocks__ -o -name node_modules -o -name chassis -o -name .tests -o -name vendor -o -name uploads \) -prune -o -name "*.php" -print0 | xargs -0 -n 1 -P 4 php -l > /dev/null |
View gist:92af5d06f95fa201edf5b3c19809661b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from "react"; | |
export default function QuoteBox() { | |
const API_URL = "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1"; | |
const [quote, setQuote] = useState({}); | |
const [isLoading, setLoading] = useState(false); | |
async function queryAPI() { | |
setLoading(true); | |
const response = await fetch(API_URL); |
View repos.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
hub api orgs/humanmade/repos --paginate | npx jq -r '.[] | select(.archived != true) | .full_name' | while read -r i; do | |
if [[ $(hub api repos/"$i"/readme | npx jq -r '.name') = 'null' ]]; then | |
echo "$i has no readme" | |
fi | |
done |
View gist:b5fcc0ff9e48d76df08663343e1207e4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// /content/plugins/multilingualpress3/src/multilingualpress/Cache/NavMenuItemsSerializer.php | |
$menuItem = $postArray['menu_item'] ?? []; | |
foreach (self::MENU_ITEM_ALLOWED_PROPERTIES as list($property, $type, $default)) { | |
if (!isset($post->{$property})) { | |
$post->{$property} = $this->extractValue($menuItem, $property, $type, $default); | |
} | |
} | |
$this->unserialized[] = $post; | |
} |
View gist:345664139b408e1d8dc99f3899fe77c8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Update only a specific package with its dependencies | |
composer update --ignore-platform-reqs humanmade/coding-standards --with-dependencies | |
// Update packages (ignore platform requirements) | |
composer update --ignore-platform-reqs |
View chassis error
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Installing Chassis into /Users/paul/altistest/chassis | |
Cloning into '/Users/paul/altistest/chassis'... | |
remote: Enumerating objects: 947, done. | |
remote: Counting objects: 100% (947/947), done. | |
remote: Compressing objects: 100% (736/736), done. | |
remote: Total 17683 (delta 272), reused 447 (delta 202), pack-reused 16736 | |
Receiving objects: 100% (17683/17683), 46.14 MiB | 6.07 MiB/s, done. | |
Resolving deltas: 100% (11919/11919), done. | |
Submodule 'puppet/modules/apt' (https://github.com/puppetlabs/puppetlabs-apt.git) registered for path 'puppet/modules/apt' | |
Submodule 'puppet/modules/mysql' (https://github.com/puppetlabs/puppetlabs-mysql.git) registered for path 'puppet/modules/mysql' |
View gist:2693274
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filter the home page posts, and remove any featured post ID's from it. Hooked | |
* onto the 'pre_get_posts' action, this changes the parameters of the query | |
* before it gets any posts. | |
* | |
* @global array $featured_post_id | |
* @param WP_Query $query | |
* @return WP_Query Possibly modified WP_query | |
* http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/ | |
*/ |
NewerOlder