Skip to content

Instantly share code, notes, and snippets.

View bishless's full-sized avatar

Daniel Bishop bishless

View GitHub Profile
<?php
/**
* Gravity Wiz // Gravity Forms // Email Header to Identify Notification Source
*
* You've installed Gravity Forms on a ton of sites and now you're getting a ton of notifications. The problem is there
* is no clear indicator which site is sending the notification. How frustrating!
*
* This simple plugin automatically adds a custom header that identifies the URL that generated the Gravity Forms notification.
* This is most useful when installed as an MU plugin at the start of development on each site.
*
<?php
/**
* Gravity Wiz // Gravity Forms // Default Form List to Active Forms
* http://gravitywiz.com/
*/
add_action( 'plugins_loaded', function() {
if( is_callable( array( 'GFForms', 'get_page' ) ) && GFForms::get_page() == 'form_list' ) {
if ( ! isset( $_GET['filter'] ) ) {
wp_redirect( add_query_arg( array( 'filter' => 'active' ) ) );
exit;
@taupecat
taupecat / _get-color.scss
Last active March 15, 2022 21:01
A Sass color getter that also handles transparency
// Color names come from https://www.color-blindness.com/color-name-hue/
// The color values can be any valid color format: hex, rgb, hsl, CSS color names,
// etc. But probably best _not_ to use CSS color names.
$palette: (
'black': #000,
'cornflower-blue': #55abf2,
'grey': #808080,
'fire-engine-red': #d12118,
'forest-green': #20a037,
'limeade': #56b02c,
@haet
haet / functions.php
Last active October 4, 2018 09:29
Add custom CSS to WP HTML Mail WordPress E-Mails
/**
* Add custom CSS to WP HTML Mail WordPress E-Mails
*/
add_filter( 'haet_mail_modify_styled_mail', function( $email_html ){
$custom_css = '
.container-padding{
padding-left: 60px;
padding-right: 0;
}
@spivurno
spivurno / gw-gravity-forms-save-and-continue-auto-load.php
Last active August 19, 2021 19:36
Gravity Wiz // Gravity Forms // Automatic Save & Continue
<?php
/**
* Gravity Wiz // Gravity Forms // Automatic Save & Continue
*
* Automatically save
* load previously saved data (via Gravity Forms' Save & Continue functionality) when a logged-in user views a form.
*
* @version 0.4
* @author David Smith <david@gravitywiz.com>
* @license GPL-2.0+
@felixarntz
felixarntz / wp-alignment-classes.css
Created November 24, 2017 15:52
New WordPress alignment classes introduced by Gutenberg
/* -------------------------------------------------------------
# Variables
------------------------------------------------------------- */
$site_maxwidth: 72rem; // Maximum width the entire site should not exceed
$site_maxwidth-text: 40rem; // Maximum width the main content text should not exceed
$spacing_horizontal: 1rem; // General horizontal padding
/* -------------------------------------------------------------
# General Styles
// A clipping object is a JavaScript object that contains the following properties. Properties values may be null.
// title - String
// text - String
// url - String
// saveDate - Date
// Merge function receives an array of clipping objects and returns the merged string
function merge(clippings) {
var merged = clippings.reduce(function(string, clipping) {
@wfalkwallace
wfalkwallace / rwdurl
Created March 22, 2016 01:28 — forked from zachleat/rwdurl
A command line utility to open a url with a bunch of different screen widths (and organize the windows).
# My Chrome developer profile is in the `Profile 1` directory, make sure to update with yours.
# Best on an ultra wide monitor.
function rwdurl() {
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(0,0);window.resizeTo(320,1395);window.location='$1';</script></body></html>"
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(330,0);window.resizeTo(480,1395);window.location='$1';</script></body></html>"
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(815,0);window.resizeTo(640,1395);window.location='$1';</script></body></html>"
open -n -g -a "Google Chrome" --args --new-window --profile-directory=Profile\ 1 --app="data:text/html,<html><body><script>window.moveTo(1460,0);window.resizeTo(800,1395);window.location='$1';</script></body></html>"
open -n
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
@ericakfranz
ericakfranz / functions.php
Created April 19, 2015 23:00
Filter WP SEO's OpenGraph and Twitter image meta tags
<?php
/**
* Return 'medium' image for mobile devices since that is what we're
* loading to display as the featured image on each post.
*/
//* Filter WP SEO's OpenGraph image output
add_filter('wpseo_opengraph_image_size', 'disi_opengraph_image_size');
function disi_opengraph_image_size($val) {
if( wp_is_mobile() ) {