Skip to content

Instantly share code, notes, and snippets.

View thelevicole's full-sized avatar
﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽

Levi Cole thelevicole

﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽﷽
View GitHub Profile
@thelevicole
thelevicole / functions.php
Created February 13, 2023 15:24
Add GCLID ($gclid) property to GravityForms Zoho lead
<?php
add_filter( 'gform_zohocrm_lead', function( $lead, $feed, $entry, $form ) {
$gclid_keys = [ '$gclid', 'GCLID' ];
$custom_fields = !empty( $feed[ 'meta' ][ 'leadCustomFields' ] ) ? $feed[ 'meta' ][ 'leadCustomFields' ] : null;
if ( $custom_fields && is_array( $custom_fields ) ) {
foreach( $custom_fields as $custom_field ) {
$key = rgar( $custom_field, 'key' );
$value = rgar( $custom_field, 'value' );
@thelevicole
thelevicole / README.md
Last active February 1, 2021 16:15
PHP animate on scroll (AOS) helper function.

Basic usage

<div class="text" <?php aos( 'fade-up' ); ?>>
  ...
</div>

Additional settings

@thelevicole
thelevicole / README.md
Last active September 14, 2023 21:29
Javascript RAM storage

Random-access memory (RAM) storage for JavaScript

Works similarly to localStorage and sessionStorage but stored in the RAM. However, unlike local and session storage we don't need to serialise objects and arrays before storing.

Store data

var id = Math.random().toString( 36 ).substr( 2, 13 );
ramStorage.setItem( 'randId', id );
@thelevicole
thelevicole / README.md
Last active August 10, 2019 10:06
Simple parallax effect

A very simple parallax effect with jQuery

Standard example:

<div class="example-element" data-parallax></div>

Inverted example:

@thelevicole
thelevicole / breakpoints.js
Created March 30, 2019 17:04
Access Bootstrap breakpoints in via Javascript
const styles = getComputedStyle( document.body );
/**
* Get the globally set bootstrap breakpoints
*
* @type {object}
*/
const breakpoints = {
xs: parseInt( styles.getPropertyValue( '--breakpoint-xs' ) ),
sm: parseInt( styles.getPropertyValue( '--breakpoint-sm' ) ),
@thelevicole
thelevicole / README.md
Last active November 27, 2020 09:32
jQuery group selectors

Simple jQuery solution for grouping multiple selectors

Issue

Sometimes I have multiple jQuery variables that I want to perform the same action on. So I find myself doing something like...

var $header = $( 'body > header' );
var $nav = $( 'body > nav.burger-menu' );
@thelevicole
thelevicole / README.md
Last active April 12, 2019 14:06
Conditional file mods for WordPress admins

Secret conditional file modifcation status for WordPress admins

Copy and paste the contents of this gist into your wp-config.php.

Then access your admin panel with ?wpSuperUser appended to the url. For example: https://example.com/wp-admin/?wpSuperUser This will unlock file modifications for a day allowing you to run core updates, add and remove plugins..etc