Skip to content

Instantly share code, notes, and snippets.

View mngarwood's full-sized avatar

Megan Garwood mngarwood

View GitHub Profile
@tortuetorche
tortuetorche / Select2.php
Created December 10, 2020 09:35
Select2 v4.0+ helpers for the WebDriver module of Codeception 4.1 (and certainly older versions)
<?php // @codingStandardsIgnoreFile
namespace Helper;
use Exception;
// Select2 helpers for Codeception
// See: https://select2.org
//
// Works with Select2 version 4.0 or greater
// Which is a jQuery based replacement for select boxes.
@matthewhudson
matthewhudson / atom-macos-context-menu.md
Created May 25, 2019 08:52 — forked from idleberg/atom-macos-context-menu.md
“Open in Atom” in macOS context-menu

Open in Atom

  • Open Automator
  • Create a new Service
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /usr/local/bin/atom -n "$@"
  • Set “Pass input” to as arguments
  • Save as Open in Atom
@hirejordansmith
hirejordansmith / facet-wp-infinite-scroll.js
Last active March 13, 2023 18:25 — forked from robneu/facet-wp-infinite-scroll.js
Infinite scroll for FacetWP
/* globals FWP */
/**
* JavaScript for FacetWP Infinite Scroll
*/
( function( $ ) {
'use-strict';
var throttleTimer = null;
var throttleDelay = 100;
@ghosh
ghosh / micromodal.css
Last active February 23, 2025 16:34
Demo modal styles for micromodal.js and corresponding expected html. If using this, set the `awaitCloseAnimation` in config to true
/**************************\
Basic Modal Styles
\**************************/
.modal {
font-family: -apple-system,BlinkMacSystemFont,avenir next,avenir,helvetica neue,helvetica,ubuntu,roboto,noto,segoe ui,arial,sans-serif;
}
.modal__overlay {
position: fixed;
@dasbairagya
dasbairagya / functions.php
Last active July 17, 2023 04:17
Add a WYSIWYG Field to WooCommerce Product Category Page
<?php
/********************************************Add a custom filed in the categoy*************************/
add_action( 'init', 'wpm_product_cat_register_meta' );
/**
* Register details product_cat meta.
*
* Register the details metabox for WooCommerce product categories.
*
*/
function wpm_product_cat_register_meta() {
@robneu
robneu / facet-wp-infinite-scroll.js
Last active October 9, 2021 22:26
Infinite scroll for FacetWP
/* globals FWP */
/**
* JavaScript for FacetWP Infinite Scroll
*/
(function( $ ) {
'use-strict';
var throttleTimer = null;
var throttleDelay = 100;
@iandunn
iandunn / phpmailer-send-via-mail.php
Created August 17, 2016 19:26
Disable PHPMailer sending via SMTP, so that MailCatcher can catch outbound messages from dev environments
/**
* Configure PHPMailer to send via PHP's mail()
*
* @param PHPMailer $phpmailer
*/
function phpmailer_send_via_mail( $phpmailer ) {
$phpmailer->IsMail();
}
add_action( 'phpmailer_init', 'phpmailer_send_via_mail', 999 );
@stmswitcher
stmswitcher / codecept.random.option.select.php
Last active February 11, 2023 05:40
Select random option for Codeception
$options = $I->grabMultiple('#selectID option', 'value');
$I->selectOption('select', $options[array_rand($options)]);
@robincornett
robincornett / functions-01.php
Last active November 27, 2017 08:25
Responsive menus for HTML5 Genesis themes. with updating skip links. The skip links must follow the pattern established in Genesis core.
<?php
//do not include the opening tag!
// Required Scripts and Styles
add_action( 'wp_enqueue_scripts', 'leaven_load_scripts', 15 );
function leaven_load_scripts() {
// Responsive Navigation
wp_enqueue_style( 'fontawesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0' );
@amdrew
amdrew / gist:4921c54cbcb94d2ed44e
Created May 5, 2014 01:10
Easy Digital Downloads - Manual Purchases. Create a new user account when making a manual payment
<?php
function sumobi_eddmp_create_payment( $data ) {
if ( wp_verify_nonce( $data['edd_create_payment_nonce'], 'edd_create_payment_nonce' ) ) {
// email address of user
$email_address = $data['user'];
// check to see if a user account doesn't already exist with email address
$user_id = username_exists( $email_address );