Skip to content

Instantly share code, notes, and snippets.

View cliffordp's full-sized avatar

Clifford cliffordp

View GitHub Profile
@cliffordp
cliffordp / redirec-search-to-list-tec.php
Last active April 19, 2024 03:49 — forked from BeardedGinger/redirec-search-to-list-tec.php
TEC | Force list view for search results
<?php
// Force list view for search results
// updated to the code provided by a forum user at https://theeventscalendar.com/support/forums/topic/forcing-list-view-for-search-results/#post-1259085
// UNTESTED!
// from https://gist.github.com/cliffordp/a473ccda4308acb9ac66499de5407c9b
add_action( 'wp_footer', function () {
// If tribe-events.js hasn't been setup, do nothing
if ( ! wp_script_is( 'tribe-events-calendar-script' ) ) {
return;
}
@cliffordp
cliffordp / bypass-cloudflare-email-protection.js
Created February 16, 2024 16:31 — forked from neopunisher/bypass-cloudflare-email-protection.js
How to circumvent Cloudflare's [email protected] thing, WITHOUT enabling Javascript
// Adapted from https://raddle.me/f/Privacy/3722/how-to-circumvent-cloudflare-s-email-protected-thing-without with the help of chatGPT
function fixObfuscatedEmails() {
const elements = document.getElementsByClassName('__cf_email__');
for (let i = 0; i < elements.length; i++) {
const element = elements[i];
const obfuscatedEmail = element.getAttribute('data-cfemail');
if (obfuscatedEmail) {
const decodedEmail = decrypt(obfuscatedEmail);
element.setAttribute('href', 'mailto:' + decodedEmail);
element.innerHTML = decodedEmail;
@cliffordp
cliffordp / bulk-transfer-gh-issues.sh
Created December 30, 2023 17:25 — forked from slaFFik/bulk-transfer-gh-issues.sh
Open local repo to bulk transfer all its issues to a new repo: https://jloh.co/posts/bulk-migrate-issues-github-cli/
gh issue list -s all -L 500 --json number | \
jq -r '.[] | .number' | \
xargs -I% gh issue transfer % https://github.com/<destination repo>
@cliffordp
cliffordp / zohoCrmClientScript.js
Last active October 19, 2023 01:29 — forked from jeznag/clientScript.js
Zoho CRM client script address verification via client script
// Demo: https://www.youtube.com/watch?v=oA2EV7Gz5NM
const street = ZDK.Page.getField('Street').getValue();
const city = ZDK.Page.getField('City').getValue();
const zipCode = ZDK.Page.getField('Zip_Code').getValue();
const country = ZDK.Page.getField('Country').getValue();
const state = ZDK.Page.getField('State').getValue();
const address = `${street} ${city} ${state} ${zipCode} ${country}`;
const url = `http://api.positionstack.com/v1/forward`
@cliffordp
cliffordp / sample-exif-data
Created February 25, 2023 14:00 — forked from arunbasillal/sample-exif-data
Sample EXIF data using exif_read_data()
// EXIF data extracted using exif_read_data() PHP function from https://github.com/ianare/exif-samples/blob/master/jpg/Canon_40D.jpg
Array (
[FileDateTime] => 0
[FileSize] => 7958
[FileType] => 2
[MimeType] => image/jpeg
[SectionsFound] => ANY_TAG, IFD0, THUMBNAIL, EXIF, GPS, INTEROP
[COMPUTED] => Array
(
@cliffordp
cliffordp / functions.php
Created October 30, 2022 18:31 — forked from tripflex/functions.php
WordPress Remove Filter (remove_filter converted to remove_class_filter) to remove Filter/Action without Class Object access. Works with WordPress 1.2+ (4.7+ support added 9-19-2016)
<?php
/**
* Make sure the function does not exist before defining it
*/
if( ! function_exists( 'remove_class_filter' ) ){
/**
* Remove Class Filter Without Access to Class Object
*
* In order to use the core WordPress remove_filter() on a filter added with the callback
@cliffordp
cliffordp / functions.php
Last active September 23, 2022 03:23 — forked from patric-boehner/functions.php
Remove in-post settings for the Genesis Framework, including SEO, layout, and scripts.
<?php
// Remove in-post settings for the Genesis Framework, including SEO, layout, and scripts.
// Relevant Genesis code can be found in theme's lib > admin > inpost-metaboxes.php
if( ! function_exists( 'cliff_genesis_simplify_editing_screens' ) ) {
/**
* Remove in-post Genesis settings by post type.
* @link https://gist.github.com/cliffordp/744a19f00565051924ec7f0d46ac687e This snippet.
*/
function cliff_genesis_simplify_editing_screens() {
@cliffordp
cliffordp / gist:0780d5a8a88a3cbf1dcb7000646fc536
Created February 25, 2020 22:53 — forked from zlove/gist:3b9b6a611715ec3a8a60
Preview WooCommerce Emails
<?php
/**
* Quick hack to preview WooCommerce e-mails.
* Based on drrobotnik's answer from Stack Overflow: http://stackoverflow.com/a/27072101/186136
*
* Add this to <yourtheme>/functions.php and then visit a url like:
* http://<site_url>/wp-admin/admin-ajax.php?action=previewemail
*
* @return null
*/
@cliffordp
cliffordp / localwp-no-conflict.sh
Created July 20, 2022 22:37 — forked from nickpelton/localwp-no-conflict.sh
zsh avoid conflicts with localwp shell and custom php, mysql, or other custom binaries
# Don't load custom stuff if LocalWP shell
if [[ -z ${PHPRC+z} ]]
then
echo "Export custom binaries"
# Eg.
# export PATH="/opt/homebrew/opt/php@7.4/bin:$PATH"
# export PATH="/opt/homebrew/opt/mysql-client/bin:$PATH"
fi
@cliffordp
cliffordp / functions.php
Last active September 26, 2021 18:10 — forked from jesseeproductions/tribe-ical-one-year.php
The Events Calendar Get Events for 1 Year from Today in iCal Export File -- http://example.com/events/?ical=1&year-feed
<?php
// From https://gist.github.com/cliffordp/ab1f7c4d95723ee6f892/, a fork of https://gist.github.com/jesseeproductions/2b1af6527b7029eaea6e
// References:
// https://theeventscalendar.com/support/forums/topic/ical-only-pushing-1-month-at-a-time/
// https://theeventscalendar.com/support/forums/topic/how-users-can-subscribe-to-my-events-calendar-in-their-personal-calendars/#post-1022932
// https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/3777092-subscribe-to-calendar-via-ical
/*
* The Events Calendar Get Events for 1 Year from Today in iCal Export File
* add coding to child theme's functions.php
* Tested works with The Events Calendar v3.12 and v4.0