Skip to content

Instantly share code, notes, and snippets.

View JodiWarren's full-sized avatar
🎯
Focusing

Jodi Warren JodiWarren

🎯
Focusing
View GitHub Profile
@JodiWarren
JodiWarren / acfpro-composer.json
Last active March 31, 2020 16:42
Advanced Custom Fields PRO for Composer
{
"repositories": [
{
"type": "package",
"package": {
"name": "advanced-custom-fields/advanced-custom-fields-pro",
"version": "5.0",
"type": "wordpress-plugin",
"dist": {
"type": "zip",
@JodiWarren
JodiWarren / movehookedactions.php
Last active December 2, 2015 11:53
Use this snippet to move all hooked actions from one hook to another. Very useful for moving hooked items to the footer. Use carefully.
<?php
global $wp_filter;
$hook_to_check = 'nameOfHook';
$destination_hook = 'wp_footer';
$acf_front_end_scripts = $wp_filter[$hook_to_check];
foreach ( $acf_front_end_scripts as $scripts ) {
foreach ( $scripts as $script ) {
remove_action( $hook_to_check, $script['function'] );
add_action( $destination_hook, $script['function'], $script['accepted_args'] );
<?php
namespace SiteName\Analytics;
function enqueue_analytics() {
$analytics_id = get_option('options_analytics_id');
if ( ! $analytics_id ) {
return;
@JodiWarren
JodiWarren / mixin.addFont.scss
Last active June 30, 2016 09:10
Quick and easy mixin for adding new fonts in a consistent manner.
////
/// @author Jodi Warren for JH
/// @group _fonts
////
/// Add a new @font-face font with consistent markup. All file types should
/// be provided with the same file name, obviously bar the extension.
/// If you wish to use multiple weights/styles of the same font family, simply
/// provide them with the same family name, and specify the weight and style.
///
@JodiWarren
JodiWarren / install_lts_node.sh
Last active September 19, 2018 10:56
Install nvm and LTS release of Node.
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash && . ~/.bashrc && nvm install --lts && nvm alias default lts/*

Keybase proof

I hereby claim:

  • I am jodiwarren on github.
  • I am jwarren (https://keybase.io/jwarren) on keybase.
  • I have a public key ASB4qJRDeZsplbF5iJispwJYtAjrnmx-hglyc0F3ImlZtgo

To claim this, I am signing this object:

@JodiWarren
JodiWarren / immutable_rename.js
Created February 14, 2017 17:38
Just to prove that the items remain consistent
const initialMap = Immutable.Map({
oldItemName: {
potato: {
method: 'baked',
temperature: 180,
time: 60
},
egg: {
method: 'fried',
temperature: 120,
@JodiWarren
JodiWarren / immutable_merge_two_arrays_objects.js
Last active October 7, 2019 07:05
Using immutable.js to merge two arrays of objects
const Immutable = require('immutable');
const initialData = [
{
id: '01',
value: 10
},
{
id: '02',
value: 100
@JodiWarren
JodiWarren / scratch_25.js
Created March 23, 2017 19:16
Symantec cert names
const authorities = ` Subject: C=US, O=Equifax, OU=Equifax Secure Certificate Authority
Subject: C=US, O=VeriSign, Inc., OU=VeriSign Trust Network, OU=(c) 2008 VeriSign, Inc. - For authorized use only, CN=VeriSign Universal Root Certification Authority
Subject: C=DE, O=TC TrustCenter GmbH, OU=TC TrustCenter Universal CA, CN=TC TrustCenter Universal CA II
Subject: C=US, O=RSA Data Security, Inc., OU=Secure Server Certification Authority
Subject: C=US, O=Equifax Secure, OU=Equifax Secure eBusiness CA-2
Subject: C=DE, O=TC TrustCenter GmbH, OU=TC TrustCenter Universal CA, CN=TC TrustCenter Universal CA III
Subject: C=DE, O=TC TrustCenter GmbH, OU=TC TrustCenter Class 4 CA, CN=TC TrustCenter Class 4 CA II
Subject: C=US, O=VeriSign, Inc., OU=Class 1 Public Primary Certification Authority - G2, OU=(c) 1998 VeriSign, Inc. - For authorized use only, OU=VeriSign Trust Network
Subject: C=US, O=Symantec Corporation, OU=Symantec Trust Network, CN=Syma
@JodiWarren
JodiWarren / hide-out-of-stock.js
Created July 29, 2017 20:03
Hide out of stock products on an online store
jQuery("[data-mh=category-list-product]").each((index, item) => {
const availability = jQuery(item).find('.availability');
if(availability.hasClass('out-of-stock')){
item.remove();
}
})