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
<?xml version="1.0"?> | |
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="MyConfig" xsi:noNamespaceSchemaLocation="https://raw.githubusercontent.com/PHPCSStandards/PHP_CodeSniffer/master/phpcs.xsd"> | |
<description>My Coding standards</description> | |
<file>.</file> | |
<arg name="extensions" value="php" /> | |
<arg name="colors" /> | |
<arg value="ps" /> |
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 count_tags( string $html ) { | |
// save the tag count to an option so each call to this function use it for a global count across all posts. | |
$tag_count = get_option( 'tibi_tag_count', [] ); | |
$tags = new \WP_HTML_Tag_Processor( $html ); | |
while( $tags->next_tag()) { | |
$tag = $tags->get_tag(); | |
if ( ! isset( $tag_count[ $tag ] ) ) { | |
$tag_count[ $tag ] = 0; | |
} |
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 ) |
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, { |
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 |
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 |
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); |
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 |
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; | |
} |
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 |
NewerOlder