Skip to content

Instantly share code, notes, and snippets.

Brian J King brianjking

Block or report user

Report or block brianjking

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am brianjking on github.
  • I am iamrobotbear (https://keybase.io/iamrobotbear) on keybase.
  • I have a public key ASDLDmgY4cq1hp2A-BCKVImHndr33bHH9KyG_J9Z4lUxRQo

To claim this, I am signing this object:

View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
View fetch_mailchimp_data.sh
#!/bin/bash
MC_API_KEY="apikey:YOUR_KEY"
MC_LIST_ID="YOUR LIST ID"
# don't forget to update usN to your own MailChimp data center ID
TOTAL_ITEMS=`curl --silent --request GET --url "https://usN.api.mailchimp.com/3.0/lists/$MC_LIST_ID/members?fields=total_items" --user $MC_API_KEY | jq -r ".total_items"`
CHUNK_SIZE=1000
echo "id,email_address,status,avg_open_rate,avg_click_rate,timestamp_signup,last_changed,member_rating" > mailchimp_list.csv
echo "action,timestamp,url,type,campaign_id,title,parent_campaign,subscriber_id" > mailchimp_list_activity.csv
@brianjking
brianjking / subscribers-count.php
Created Jul 19, 2018 — forked from kovshenin/subscribers-count.php
Get subscribers count via the MailChimp API.
View subscribers-count.php
<?php
/**
* Get subscribers count via the MailChimp API.
*/
function mailchimp_get_subscribers_count() {
$cache_key = 'mailchimp-subscribers';
$api_key = '';
$username = '';
$dc = '';
$list_id = '';
@brianjking
brianjking / woocommerce-composites-variable-container-weight.php Use this snippet to have the weight of composited products added to the container weight when the Non-Bundled Shipping option is unchecked.
View woocommerce-composites-variable-container-weight.php
<?php
/**
* Plugin Name: WooCommerce Composite Products - Variable Container Weight
* Plugin URI: http://woocommerce.com/products/composite-products/
* Description: Use this snippet to have the weight of composited products added to the container weight when the Non-Bundled Shipping option is unchecked.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: http://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@brianjking
brianjking / woocommerce-optimize-scripts.php
Created Feb 23, 2018 — forked from DevinWalker/woocommerce-optimize-scripts.php
Only load WooCommerce scripts on shop pages and checkout + cart
View woocommerce-optimize-scripts.php
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@brianjking
brianjking / install.sh
Created Feb 14, 2018 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
View install.sh
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@brianjking
brianjking / style.css
Created Jan 9, 2018 — forked from mrkdevelopment/style.css
Divi WooCommerce Button Fix
View style.css
body .et_pb_button:hover, .woocommerce a.button.alt:hover, .woocommerce-page a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce-page button.button.alt:hover, .woocommerce input.button.alt:hover, .woocommerce-page input.button.alt:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce-page #respond input#submit.alt:hover, .woocommerce #content input.button.alt:hover, .woocommerce-page #content input.button.alt:hover, .woocommerce a.button:hover, .woocommerce-page a.button:hover, .woocommerce button.button:hover, .woocommerce-page button.button:hover, .woocommerce input.button:hover, .woocommerce-page input.button:hover, .woocommerce #respond input#submit:hover, .woocommerce-page #respond input#submit:hover, .woocommerce #content input.button:hover, .woocommerce-page #content input.button:hover {
color: #fff;
}
.woocommerce a.button.alt, .woocommerce-page a.button.alt, .woocommerce button.button.alt, .woocommerce-page button.button.alt, .woocommerce input.button.alt, .woocommerc
@brianjking
brianjking / 0_reuse_code.js
Created Feb 25, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.