Skip to content

Instantly share code, notes, and snippets.

Clifford cliffordp

  • Oklahoma
Block or report user

Report or block cliffordp

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View example-alfred-app-workflow.php
<?php
//
// Do NOT USE OPENING <?php TAG IN ALFRED APP
//
/**
* Open 1 or more (comma or new line separated) issue number URLs from selection.
*
* @link https://github.com/cliffordp/alfred-app-workflows Download this Alfred App Workflow's code (and more).
* @link https://gist.github.com/cliffordp/a0ce681f51504649cd75cc9c22a53b2a This Alfred App Workflow's code snippet.
@cliffordp
cliffordp / netflix-ratings.js
Last active Aug 5, 2019
Export Netflix's My List, Watch History, and thumbs up/down or ratings. Screenshot of Netflix Ratings vs script's output: https://cl.ly/4e15a4de21a6
View netflix-ratings.js
// These instructions for exporting Netflix's My List, Watch History, and Ratings worked for each profile on August 4, 2019.
// 1) Go to https://www.netflix.com/browse/my-list and use https://addons.mozilla.org/firefox/addon/netflix-list-exporter/ to copy.
// 2) Go to https://help.netflix.com/en/node/101917 and follow instructions to download CSV of Watch History.
// 3) Use the snippet below in the browser's console at https://www.netflix.com/MoviesYouveSeen, then copy and paste to wherever you wish.
// Code was altered from https://www.coollector.com/netflix_import.html, but I haven't ever used their software.
// 4) Go to https://www.netflix.com/cancelplan and cancel (if that's why you're doing all this):
@cliffordp
cliffordp / functions.php
Last active Jul 18, 2019
Automatically login a single WordPress user upon arrival to a specific page.
View functions.php
<?php
/**
* Automatically login a single WordPress user upon arrival to a specific page.
*
* Redirect to home page once logged in and prevent viewing of the login page.
* Compatible with WordPress 3.9.1+
* Updated 2014-07-18 to resolve WP_DEBUG notice: "get_userdatabylogin is deprecated since version 3.3! Use get_user_by('login') instead."
* Updated 2019-07-09 to reformat code, pass 2nd parameter to `do_action()`, and hook into priority 1.
*
@cliffordp
cliffordp / functions.php
Last active Jul 11, 2019
Event Tickets: Set the maximum quantity allowed per ticket.
View functions.php
<?php
/**
* Event Tickets Plus (ET+): Limit to purchasing 4 WooCommerce tickets at a time for a specific event and/or ticket.
*
* !!! Change the maximum and Event ID to your own values!!!
* Requires ET+ version 4.10.7 or later to also work for tickets with an unlimited stock/quantity (value of "-1").
*
* @link https://gist.github.com/cliffordp/61cd8374a80d1b2bc76a6650e9304a63 This snippet.
*
@cliffordp
cliffordp / functions.php
Last active Jun 28, 2019
The Events Calendar and related plugins: Add your own location for template file loading.
View functions.php
<?php
/**
* The Events Calendar and related plugins: Add your own location for template file loading.
*
* Example "Single Event within List View" for Avada theme (which has theme overrides).
* Now tries to load in this order:
* This plugin: /app/public/wp-content/plugins/my-plugin/tribe-events/list/single-event.php
* Theme root so it stays even if switch themes: /app/public/wp-content/themes/tribe-events/list/single-event.php
* Child theme with theme overrides: /app/public/wp-content/themes/Avada-Child-Theme/tribe-events/list/single-event.php
@cliffordp
cliffordp / functions.php
Last active Jun 26, 2019
The Events Calendar Community Events form: always display reCAPTCHA, even for logged-in users
View functions.php
<?php
/*
* The Events Calendar Community Events form: always display reCAPTCHA, even for logged-in users and new/edit forms.
*
* @link https://gist.github.com/cliffordp/9fc77333d8523ecf180b382ee86311a5
*
* @see \Tribe__Events__Community__Captcha__Abstract_Captcha::showing_captcha()
*/
add_filter( 'tribe_community_events_show_captcha', '__return_true' );
@cliffordp
cliffordp / functions.php
Last active Jun 21, 2019
Community Events (CE): If user is logged in, set post status to Published, else fallback to CE settings' default.
View functions.php
<?php
/**
* Community Events (CE): If user is logged in, set post status to Published, else fallback to CE settings' default.
*
* Irrelevant if default post status in CE settings is Published or Anonymous Submissions are not allowed.
*
* @link https://support.theeventscalendar.com/420384-Auto-publish-events-submitted-by-logged-in-users Relevant help article.
* @link https://gist.github.com/cliffordp/9b4dff692829ce5d9ddd46d849689dbb This snippet.
*
* @param mixed $option The option value.
@cliffordp
cliffordp / functions.php
Last active Jun 16, 2019
Events Calendar PRO: Change default coordinates and zoom level for Map View's start location (for when there are no event results found, to avoid African coast).
View functions.php
<?php
/**
* Events Calendar PRO: Change default coordinates and zoom level for Map View's
* start location (for when there are no event results found, to avoid African coast).
*
* Change the coordinates to your liking. See the link below for a helpful tool.
* Updated 2018-08-06 because PRO v4.4.30 removed one of the parameters.
*
* @link https://gist.github.com/cliffordp/52d0bfb6d1537a19d158deb351dd9fa7
@cliffordp
cliffordp / functions.php
Last active Jun 5, 2019
Get your WordPress.org favorite plugins
View functions.php
<?php
/**
* Get your WordPress.org favorite plugins.
*
* Set a breakpoint or var_dump() within plugins_api() at `if ( is_wp_error( $request ) ) {` to see the URL. Example:
* https://api.wordpress.org/plugins/info/1.2/?action=query_plugins&request[user]=cliffpaulick&request[per_page]=250&request[fields][description]=0&request[fields][tested]=0&request[fields][requires]=0&request[fields][rating]=0&request[fields][ratings]=0&request[fields][downloaded]=0&request[fields][downloadlink]=0&request[fields][added]=0&request[fields][donate_link]=0&request[fields][icons]=0&request[locale]=en_US&request[wp_version]=5.2
*
* @link https://developer.wordpress.org/reference/functions/plugins_api/
*
* @see \plugins_api()
@cliffordp
cliffordp / functions.php
Last active Jun 3, 2019
Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
View functions.php
<?php
/**
* Make WooCommerce cart Quantity input field non-editable (readonly) ONLY FOR Event Tickets Plus products
*
* By Matt B and Cliff P
*
* From https://gist.github.com/cliffordp/66bf05df61ee269c60ff20d6f39e2cab
*/
function cliff_etplus_woo_cart_quantity_readonly() {
You can’t perform that action at this time.