Skip to content

Instantly share code, notes, and snippets.

View JodiWarren's full-sized avatar
🎯
Focusing

Jodi Warren JodiWarren

🎯
Focusing
View GitHub Profile
#!/bin/bash
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
# Bundle React Native app's code and image assets.
# This script is supposed to be invoked as part of Xcode build process
@JodiWarren
JodiWarren / johnlewisgiftlist2csv.js
Created September 7, 2017 20:11
Output CSV based on the HTML of a John Lewis Gift List page
const guests = [].slice.call(document.querySelectorAll('tr.guest'));
const itemText = element => element.querySelector('td[align=left]').textContent.replace(/\(\d*\)/g, '').trim()
const guestData = guests.map(guestElement => {
const name = itemText(guestElement);
const message = itemText(guestElement.nextElementSibling)
let giftEl = guestElement.nextElementSibling.nextElementSibling;
let gifts = [];
while ( giftEl.classList.contains('item') ) {
@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();
}
})
@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 / 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 / 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,

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 / 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/*
@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.
///
<?php
namespace SiteName\Analytics;
function enqueue_analytics() {
$analytics_id = get_option('options_analytics_id');
if ( ! $analytics_id ) {
return;