Skip to content

Instantly share code, notes, and snippets.

View brettsmason's full-sized avatar

Brett Mason brettsmason

View GitHub Profile
@brettsmason
brettsmason / .lando.yml
Created November 12, 2020 07:17
Lando base config
name: example
recipe: wordpress
proxy:
appserver_nginx:
- example.lndo.site
mailhog:
- mail.example.lndo.site
theme:
- localhost:3000
@brettsmason
brettsmason / Svg.php
Created October 21, 2019 14:00
SVG Class (static version)
<?php
/**
* SVG class.
*
* This is an SVG system for displaying SVGs in themes.
*
* @package Luxe
* @author Brett Mason <[email protected]>
* @copyright Copyright (c) 2018, Brett Mason
* @link https://github.com/brettsmason/luxe
@brettsmason
brettsmason / whitelist
Last active August 4, 2019 07:04
Mythic PurgeCSS whitelist
whitelist: [
'ltr',
'rtl',
'home',
'blog',
'archive',
'date',
'error-404',
'logged-in',
'admin-bar',
@brettsmason
brettsmason / sym-woo-extensions.php
Created July 6, 2019 18:21 — forked from TheFeloniousMonk/sym-woo-extensions.php
WooCommerce - Display a list of variable products priced by a single or several variant states (attributes)
<?php
/**
* Plugin Name: SYM Woo Extensions
* Plugin URI: https://symphonyagency.com
* Description: A set of utilities for use with WooCommerce
* Version: 1.0.0
* Author: Chris Jenkins
* Author URI: http://symphonyagency.com
* License: GPL3
* Text Domain: sym-woo
@brettsmason
brettsmason / WindowsSetup.md
Last active November 24, 2019 13:22 — forked from valeryan/WindowsSetup.md
Local WSL Setup

Windows Development Environment Setup

This document outlines the steps I take to setup my environment on windows using WSL. This requires being on the windows 10 Creative update or greater with an Ubuntu 16 installed as WSL.

Windows Setup Prerequisites

  1. Install WSL.
  2. Install Terminus and setup to use bash for windows (optional).
  3. Install Acrylic DNS Proxy.
  4. Download WSL Startup Scripts.
  5. Install Xming (optional).
@brettsmason
brettsmason / primary-menu-search-form.php
Last active June 18, 2018 11:53
Add search form to a menu #PHP #WordPress
function primary_menu_search_form( $items, $args ) {
if ( $args->theme_location == 'primary' ) {
$search = '<li class="menu__item menu__item--search">' . get_search_form( false ) . '</li>';
return $items . $search;
}
}
add_filter( 'wp_nav_menu_items', __NAMESPACE__ . '\primary_menu_search_form', 10, 2 );
@brettsmason
brettsmason / theme.js
Created June 19, 2017 19:16
Theme JS file
import whatInput from 'what-input';
window.$ = $;
import $ from 'jquery';
import { Foundation } from 'foundation-sites/js/foundation.core';
import { rtl, GetYoDigits, transitionend } from 'foundation-sites/js/foundation.util.core';
import { Box } from 'foundation-sites/js/foundation.util.box'
import { onImagesLoaded } from 'foundation-sites/js/foundation.util.imageLoader';
import { Keyboard } from 'foundation-sites/js/foundation.util.keyboard';
@brettsmason
brettsmason / acf-gallery-remove-front-end-dependency.php
Created March 15, 2017 09:55
Remove Front-End Dependency for ACF Gallery Field Example (displays images with src, alt, width/height and caption)
@brettsmason
brettsmason / croft-svg.php
Last active December 9, 2016 03:42
SVG icon helper functions for WordPress
/**
* Return SVG markup.
*
* @param string $icon Required. Use the icon filename, e.g. "facebook-square".
* @param array $args {
* Parameters needed to display an SVG.
*
* @param string $title Optional. SVG title, e.g. "Facebook".
* @param string $desc Optional. SVG description, e.g. "Share this post on Facebook".
* @param string $class Optional. SVG class, defaults to 'icon icon-{icon name}.
.customize-control-checkbox-multiple .dashicons-menu {
float: right;
cursor: move;
}
.customize-control-checkbox-multiple li {
padding: 7px;
border: 1px solid #e5e5e5;
background: #fafafa;
}