Skip to content

Instantly share code, notes, and snippets.

View cliffordp's full-sized avatar

Clifford cliffordp

View GitHub Profile
@cliffordp
cliffordp / addressValidation.deluge.js
Last active November 21, 2023 19:26
Zoho Flow custom function using Google Maps for address validation
View addressValidation.deluge.js
map addressValidation(string addressString)
{
/**
* This snippet: https://gist.github.com/cliffordp/2654cda30ecd0029b1e617a0f7a0c6c9
*
* Pass each address parameter (address1, address2, city, state, zip, country) that you have in a comma-separated string,
* such as "1234 Easy Street, 55533".
*
* Will return a results map. Examples of what you could use in Zoho Flow:
* ${addressValidation.formattedAddress} is from API but may not include all address pieces (depends on input pieces)
@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
View zohoCrmClientScript.js
// 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 / ghl-open-chat-widget.js
Created November 21, 2022 01:30
High Level Chat Widget: anything with specified class can open the chat widget -- Demo: https://share.getcloudapp.com/d5uylPyE
View ghl-open-chat-widget.js
// This snippet: https://gist.github.com/cliffordp/927a92f2f2db962673d1deef48a31a0f
jQuery(document).ready( function($) {
// Hide until Chat Widget loads to prevent ineffective clicks.
$( ".open-chat-widget" ).hide();
$(window).one( "LC_chatWidgetLoaded", function() {
const chatWidget = window.leadConnector.chatWidget;
// Show once Chat Widget is loaded.
@cliffordp
cliffordp / wp-config.php
Last active October 5, 2023 17:18
Cliff's WP_DEBUG defaults
View wp-config.php
<?php
/**
* For developers: WordPress debugging mode.
*
* Change this to true to enable the display of notices during development.
* It is strongly recommended that plugin and theme developers use WP_DEBUG
* in their development environments.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
@cliffordp
cliffordp / functions.php
Last active September 23, 2023 06:22
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 / GoalSeekZeroOrPositiveOnEmptyCells.vbs
Last active September 13, 2023 03:59
Rounds up to next (not nearest) $0.50
View GoalSeekZeroOrPositiveOnEmptyCells.vbs
' Blank out all the Bonus column values, place your cursor in the Bonus column, then use this!'
Sub GoalSeekZeroOrPositiveOnEmptyCells()
Dim TargetRange As Range
Dim ChangingCell As Range
Dim CurrentCell As Range
' Loop through each cell in the current column
For Each CurrentCell In ActiveCell.CurrentRegion.Columns(ActiveCell.Column).Cells
' Check if the cell to the left is blank
If IsEmpty(CurrentCell.Offset(0, -1).Value) Then
@cliffordp
cliffordp / functions.php
Last active June 6, 2023 05:38
How to remove (dequeue) The Events Calendar's and PRO's styles.
View functions.php
<?php
// If you use this snippet as-is, ALL of The Events Calendar (i.e. "Core") and Pro add-on styles will NOT be loaded.
// (although there may be some $handles that I didn't detect... especially from widgets, shortcodes, and the like... no guarantess ;-)
// Comment out the line of each style you DO want to load.
// Note the comments within each array regarding the Display style options -- https://theeventscalendar.com/knowledgebase/wp-admin-settings-overview/#display
// The Display styles are "stacked".
// In other words, the Skeleton files are always loaded, and the Full styles are loaded when Tribe Events Styles (i.e. Theme) is selected.
// However, the commented .css example file names can change, e.g. 'full.min.css' instead of 'skeleton.min.css' or 'theme-mobile.min.css' instead of 'full-mobile.min.css'
//
@cliffordp
cliffordp / functions.php
Last active April 30, 2023 19:05
The Events Calendar - Redirect single event view page to its Event Website
View functions.php
<?php
/**
* The Events Calendar - Redirect single event view page to its Event Website
*
* The regular single event view page will be loaded if the event does not have a valid Event Website URL.
*
* From https://gist.github.com/cliffordp/2e5c53412171363b66864087b6a75bad
*
* For https://theeventscalendar.com/support/forums/topic/recurring-event-custom-event-link-behind-events-calendar/
*/
@cliffordp
cliffordp / functions.php
Last active April 6, 2023 15:36
The Events Calendar: Remove the Organizers post type from Events
View functions.php
<?php
/**
* The Events Calendar: Remove the Organizers post type from Events.
*
* Replace instances of ORGANIZER_POST_TYPE with VENUE_POST_TYPE if you
* want to do so for Venues instead.
*
* @link https://theeventscalendar.com/knowledgebase/linked-post-types/
* @link https://gist.github.com/a521d02facbc64ce3891c9341384cc07
@cliffordp
cliffordp / functions.php
Last active April 6, 2023 13:11
Open Event Website, Organizer, and Venue links in new window
View functions.php
<?php
/**
* The Events Calendar: Open event website, organizer, and venue links in new window.
*
* Filters are found in these files:
* /wp-content/plugins/the-events-calendar/src/functions/template-tags/link.php
* /wp-content/plugins/events-calendar-pro/src/functions/template-tags/general.php
* /wp-content/plugins/the-events-calendar/src/functions/template-tags/organizer.php
* /wp-content/plugins/the-events-calendar/src/functions/template-tags/venue.php
*