Skip to content

Instantly share code, notes, and snippets.

View DaveyJake's full-sized avatar
🎯
Focusing

Davey Jacobson DaveyJake

🎯
Focusing
View GitHub Profile
@DaveyJake
DaveyJake / array-delete.js
Created June 15, 2022 03:24
[JS] Missing Array Method: Delete
/**
* This method allows developers to easily remove any element
* from any array.
*
* @author Davey Jacobson <daveyjake21 [at] geemail [dot] com>
*
* @param {mixed} element Any specified element in any array.
*
* @return {array} This array instance without the specified
* element if successful. The original array
@DaveyJake
DaveyJake / input.scss
Last active June 8, 2022 12:34
Generated by SassMeister.com.
$breakpoints: (
sm: 0em,
md: 40em
);
$types: (
m: margin,
p: padding
);
@DaveyJake
DaveyJake / acf-fallback-functions.php
Last active February 8, 2022 03:11
Retrieve ACF data if plugin is ever deactivated or uninstalled.
<?php
/**
* Should ACF ever become disabled or deactivated for any reason
* these functions will ensure that nothing dies in the process.
*
* These functions were inspired by {@author Steve Grunwell} and
* {@author Bill Erickson}. Their work can be viewed, respectively,
* at {@link https://stevegrunwell.com} and
* {@link https://www.billerickson.net}.
*
@DaveyJake
DaveyJake / is-array-associative.php
Last active February 8, 2022 03:11
[PHP] Check For Associative Array
<?php
/**
* Helper function that checks an array for string keys aka an associative array.
*
* @author Davey Jacobson <daveyjake21 [at] geemail [dot] com>
*
* @param array $array Array to check.
*
* @return bool True if associative. False if not.
*/
@DaveyJake
DaveyJake / framework.css
Last active January 28, 2022 22:45
Framework Generator
.mt--5, .mv--5 {
margin-top: 0.3125rem;
}
.mt---5, .mv---5 {
margin-top: -0.3125rem;
}
.mb--5, .mv--5 {
margin-bottom: 0.3125rem;
@DaveyJake
DaveyJake / local-business-json-ld.js
Last active August 13, 2021 19:08 — forked from bavington/local-business-JSON-LD.js
Forked to improve formatting.
// A simple, single location local business JSON-LD Schema Boilerplate
// By @bavington, available on GitHub: http://bit.ly/Local_JSON
{
"@context": "http://schema.org",
"@type": "Plumber", // Change to the most specific type (List of choices: https://goo.gl/tvMVHf)
"name": "Custom Heat", // *REQUIRED
"legalName": "Custom Heat Ltd", // The Registered Business Name
"vatID": "776796257",
"description": "Established in Rugby since 1980, Custom Heat are a family run central heating and plumbing business serving Rugby, Royal Leamington Spa and Warwick.",
"logo": "http://www.customheat.co.uk/wp-content/themes/custom-heat/images/custom-heat-logo.png",
@DaveyJake
DaveyJake / allowed-post-tags.php
Last active June 17, 2021 22:13
[WP] KSES Allowed Post Tags
<?php
/**
* Found at {@link https://wp-mix.com/allowed-html-tags-wp_kses}.
*
* Note that these HTML tags and attributes go beyond those provided
* by wp_kses_post(). So if you’re looking to allow only the same tags
* that are allowed in WP Posts, just use that instead of the custom array.
*
* @author Jeff Staff
* @link https://perishablepress.com
@DaveyJake
DaveyJake / class-dj-widget-skeleton.php
Last active February 24, 2021 10:11
[WP] Widget Skeleton
<?php
/**
* Widgets API: Widget Skeleton
*
* A generic skeleton template for widgets.
*
* @package Davey_Jacobson
* @subpackage Widget_Skeleton
*/
@DaveyJake
DaveyJake / settings.js
Last active May 23, 2020 16:53
VSCode Default Settings (JSON but named JS for syntax)
// Complete List of VSCode Defaults: https://vscode.readthedocs.io/en/latest/getstarted/settings
{
// Most Commonly Used
// Controls auto save of dirty files. Accepted values: 'off', 'afterDelay', 'onFocusChange' (editor loses focus), 'onWindowChange' (window loses focus). If set to 'afterDelay', you can configure the delay in 'files.autoSaveDelay'.
"files.autoSave": "off",
// Controls the font size in pixels.
"editor.fontSize": 14,
@DaveyJake
DaveyJake / core-getExtIP.js
Last active May 21, 2020 15:35
iStat Pro Widget 4.9.2: Restore External IP Support
/**
* Get your current external IP address for the iStat Pro dashboard widget.
*
* For those of us who refuse to let go of the iStat Pro dashboard widget (version 4.9.2),
* this function is located inside of `~/Library/Widgets/iStat\ Pro.wdgt/scripts/core.js`
* beginning at line 243. As of when this Gist was published, Bjango killed the endpoint
* that powered their external IP address service. Thankfully, there's
* {@link https://www.ipify.org}, a free public IP API endpoint. Simply copy and paste the
* function below over the predecessor inside the core.js file and the IP service is
* restored (once again).