Skip to content

Instantly share code, notes, and snippets.

View cliffordp's full-sized avatar

Clifford cliffordp

View GitHub Profile
@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 / tourkick-ghl-url-query-param-replacement.js
Last active December 19, 2023 19:25
Go High Level funnels and websites: replace/insert text of any `.replace_location` class with the `location` URL query parameter. Works in <head> or <body>.
<script id="tourkick-ghl-url-query-param-replacement">
// Source: https://gist.github.com/cliffordp/9856cdd1497802996f472d3d31299026
// Get and decode the query parameter from the URL.
function getQueryParam( param ) {
const urlParams = new URLSearchParams( window.location.search );
const paramValue = urlParams.get( param );
// Return null if the parameter is not present or is an empty string.
return (paramValue !== null && paramValue.trim() !== '') ? decodeURIComponent( paramValue ) : null;
}
@cliffordp
cliffordp / addressValidation.deluge.js
Last active November 21, 2023 19:26
Zoho Flow custom function using Google Maps for address validation
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
// 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 / wp-config.php
Last active October 5, 2023 17:18
Cliff's WP_DEBUG defaults
<?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.
<?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
' 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.
<?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
<?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
<?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