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
<?php | |
namespace App; | |
use Illuminate\Notifications\Notifiable; | |
use Illuminate\Auth\Authenticatable; | |
use Illuminate\Auth\Passwords\CanResetPassword; | |
use Illuminate\Foundation\Auth\Access\Authorizable; | |
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract; | |
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract; | |
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract; |
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
# Install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install composer | |
brew install homebrew/php/composer | |
### PHPCS | |
composer global require "squizlabs/php_codesniffer=*" | |
# Add to your .bash_profile |
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
# Patterns matching CSS files that should be minified. Files with a -min.css | |
# suffix will be ignored. | |
CSS_FILES = $(filter-out %-min.css,$(wildcard \ | |
public/css/*.css \ | |
public/css/**/*.css \ | |
)) | |
# Patterns matching JS files that should be minified. Files with a -min.js | |
# suffix will be ignored. | |
JS_FILES = $(filter-out %-min.js,$(wildcard \ |
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
// Init Masonry | |
var $grid = jQuery('.facetwp-template').masonry({ | |
percentPosition: true, | |
columnWidth: '.grid-sizer', | |
itemSelector: '.grid-item' | |
}); | |
// Reload and update on FacetWP load | |
jQuery(document).on('facetwp-loaded', function() { | |
$grid.masonry('reloadItems') |
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
// NOTE, THIS IS VERY EXPERIMENTAL. TAKE THIS WITH A BIG GRAIN OF SALT, BUT DO WHAT YOU WILL WITH IT. | |
register_graphql_object_type("ThemeSettings", [ | |
'description' => 'Theme Settings', | |
'fields' => [ | |
'primaryColor' => [ | |
'type' => 'string', | |
'description' => 'Primary Color', | |
'resolve' => function ($settings) { | |
$colors = $settings->settings->color->palette->theme; |
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
<?php | |
/* | |
* Dependent Plugin Activation/Deactivation | |
* | |
* Sources: | |
* 1. https://pippinsplugins.com/checking-dependent-plugin-active/ | |
* 2. http://10up.com/blog/2012/wordpress-plug-in-self-deactivation/ | |
* | |
*/ |
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
const fs = require('fs') | |
const path = require('path') | |
// for CRA-2 un-comment line 5 and comment line 6 | |
// const assetManifest = require('./build/asset-manifest.json') | |
const assetManifest = require('./build/asset-manifest.json')[files] | |
const indexFilePath = path.join(__dirname, 'build/index.html') | |
const BUILD_PATH = path.join(__dirname, 'build/useful-asset-manifest.json') |
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
//Add Instructions to Featured Image Box | |
add_filter( 'admin_post_thumbnail_html', 'add_featured_image_html'); | |
function add_featured_image_html( $html ) { | |
return $html .= '<p>This is some sample text that can be displayed within the feature image box.</p>'; | |
} |
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
/* | |
* Takes provided URL passed as argument and make screenshots of this page with several viewport sizes. | |
* These viewport sizes are arbitrary, taken from iPhone & iPad specs, modify the array as needed | |
* | |
* Usage: | |
* $ casperjs screenshots.js http://example.com | |
*/ | |
var casper = require("casper").create(); |
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 {createPersistedQueryLink} from '@apollo/client/link/persisted-queries'; | |
import {HttpLink} from "@apollo/client"; | |
import {sha256} from 'crypto-hash'; | |
const linkChain = createPersistedQueryLink({ sha256 }).concat( | |
new HttpLink({ uri: process.env.WPGRAPHQL_URL }), | |
); | |
class PersistedQueriesPlugin { | |
apply({ addFilter }) { |