Skip to content

Instantly share code, notes, and snippets.

afragen / gist-oembed.php
Last active August 5, 2022 19:56
WordPress plugin to embed gists or gist files.
View gist-oembed.php
* Gist oEmbed.
* @package Fragen\Gist_OEmbed
* Plugin Name: Gist oEmbed
* Plugin URI:
* Description: oEmbed Gist or files within Gists.
* Version: 0.6.2
polevaultweb / edd_perpetual_discounts.php
Last active June 28, 2022 08:31
EDD - Allow discounts to be set to apply to all renewals
View edd_perpetual_discounts.php
// Add new Discount setting the to discount add and edit forms
add_action( 'edd_add_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_add_form' ) );
add_action( 'edd_edit_discount_form_before_use_once', array( $this, 'edd_perpetual_discounts_setting_edit_form' ) );
// Handle saving the settings on form submission
add_filter( 'edd_update_discount', 'edd_perpetual_discounts_add_meta' );
add_filter( 'edd_insert_discount', 'edd_perpetual_discounts_add_meta' );
webzunft / canceled-subscriptions.sql
Last active October 4, 2022 13:15
SQL queries to analyse canceled subscriptions managed with EDD Recurring Payments
View canceled-subscriptions.sql
# Basic queries to analyse canceled subscriptions using EDD Recurring Payments pre EDD 3.0
# Use EXPLAIN if you have large stores since the "notes" column is not indexed and queries can take some time
# Some of these reports might be worth storing as Views and look at the graphs PHPMyAdmin can also create from them
# List subscription cancelation with creation and cancelation date, as well as the user who canceled
# good as a basis for further queries
REGEXP_SUBSTR( REGEXP_SUBSTR( notes, '.* Status changed from active to cancelled .*' ), '^[a-z]+ [0-9]+, [0-9]+' ) AS 'date',
aymericbeaumet /
Last active June 4, 2023 19:56
[Recipe] Delete all your likes/favorites from Twitter

Ever wanted to delete all your likes/favorites from Twitter but only found broken/expensive tools? You are in the right place.

  1. Go to:{username}/likes
  2. Open the console and run the following JavaScript code:
setInterval(() => {
  for (const d of document.querySelectorAll('div[data-testid="unlike"]')) {
danielbachhuber / postmark-split-wp-mail.php
Created July 30, 2019 22:34
Splits wp_mail() with more than 40 bcc into multiple batches
View postmark-split-wp-mail.php
* Splits a wp_mail() call with more than 40 bcc
* headers into multiple batches.
* Postmark only accepts 50 bcc, so this ensures the API call doesn't fail.
* @param array $args Original arguments passed to wp_mail().
* @return
View enable-disable-plugins-when-doing-local-dev.php
Plugin Name: Enable/Disable plugins when doing local dev
Plugin URL:
Description: If the WP_LOCAL_DEV constant is true, enables/disables plugins that you specify
Version: 0.1
License: GPL version 2 or any later version
Author: Paul V. Biron/Sparrow Hawk Computing
Author URI:
ollietreend / acf-php-to-json.php
Last active May 19, 2023 04:52
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
View acf-php-to-json.php
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
namespace ConvertAcfPhpToJson;
* Add submenu item under 'Custom Fields'
jchristopher / my.sql
Last active October 24, 2017 00:27
Get EDD Customer email and license key for Customers with ! 'active' Recurring subscriptions
View my.sql
# THIS IS NOT TESTED ENOUGH !!!!!!!!!!!!!!!!!! EXPECT INACCURACIES !!!!!!!!!!!!!!!!!!
SUBSTRING_INDEX(SUBSTRING_INDEX(, ' ', 1), ' ', -1) as firstname, AS email,
pm2.meta_value as license_key
FROM wp_edd_customers AS edd_customers
View post-receive
## store the arguments given to the script
read oldrev newrev refname
## Where to store the log information about the updates
# The deployed directory (the running site)
KeeperPat / private.xml
Created December 30, 2016 15:31
Karabiner Configuration to Remap Surface Ergonomic Keyboard Alt and Windows Keys for Mac
View private.xml
<?xml version="1.0"?>