Skip to content

Instantly share code, notes, and snippets.

View ithinkandicode's full-sized avatar

Darkly77 ithinkandicode

  • UK
View GitHub Profile
/**
* Responsive Background Image (ES5)
*
* Uses an invisible <picture> element with srcset to change the parent
* container's background image
*
* https://gist.github.com/ithinkandicode/1061ba9574c014a8ed4164eb7bbb3a90
*
* @version ES5-1.0.1
*/
@ithinkandicode
ithinkandicode / acf-utility.php
Created March 7, 2022 17:34
ACF - Utility Functions
<?php
/**
* Utility: ACF
*
* Helpers that act on ACF fields
*/
/**
* Get an ACF field value, or use a provided default value if the ACF field
@ithinkandicode
ithinkandicode / foundation-plugin-dependencies.txt
Last active February 5, 2022 00:57
Foundation - Plugins & Their Dependencies
foundation.abide:
→ NA (no dependancies)
foundation.accordion:
→ foundation.util.keyboard
foundation.accordionMenu:
→ foundation.util.keyboard
→ foundation.util.nest
@ithinkandicode
ithinkandicode / acf-extended-disable-defaults.php
Created November 23, 2021 18:27
ACF Extended - Disable default settings
<?php
add_action( 'acf/init', 'acfextended_disable_modules' );
/**
* Disable some ACF Extended modules which are enabled by default.
*
* @link https://wordpress.org/plugins/acf-extended/
* @link https://www.acf-extended.com/features/modules
* @link https://www.acf-extended.com/features/wordpress
@ithinkandicode
ithinkandicode / redirector-jsdoc.md
Created August 19, 2019 20:51
Redirector extension settings for jsdoc

Redirector extension settings for JSdoc. See JSDoc issue #1642

Settings

Description: jsdoc

Example URL: http://usejsdoc.org/tags-returns.html

Include pattern: http://usejsdoc.org/*

@ithinkandicode
ithinkandicode / deepMerge.js
Last active August 19, 2019 20:51
JS – Deep Merge Test
/**
* Deep merge test
*
* Performs a recursive Object.assign, copying properties from source to target
* without removing any of the targets own properties
*
* @param {object} target Target object, to copy properties to
* @param {object} source Source object, to copy proeprties from
*
* @return {objuect} Merged object
@ithinkandicode
ithinkandicode / wp_options_defaults.php
Last active November 12, 2018 15:42
Manage WP options
<?php
/**
* WP Options Manager
*
* Description:
* Useful ways to set/manage defaults when using arrays with WordPress options.
* Covers restoring defaults, safely adding new data, and wiping data.
* Prefix:
* itaic_
* Usage within templates:
@ithinkandicode
ithinkandicode / humble-bundle-renamer.js
Last active August 9, 2020 15:41
Humble Bundle Renamer - jQuery
/**
* Humble Bundle Renamer
*
* Renames files downloaded from a Humble Bundle downloads page:
*
* - Run the script in the developer tool's JS console
* - Copy the generated text, which appears in a box on the page
* - Paste this into a text file, within the same folder as your downloaded files
* - Save the file, then rename it to "renamer.bat"
* - Run the batch script