Skip to content

Instantly share code, notes, and snippets.

View brianjking's full-sized avatar
💭
Doin' cool stuff at BrandMuscle AI

Brian J King brianjking

💭
Doin' cool stuff at BrandMuscle AI
View GitHub Profile
@agusmu
agusmu / functions.php
Created October 10, 2016 02:55 — forked from fervous/functions.php
Show shipping by vendor next to item in cart
// SHIPPING IN CART
add_filter( 'woocommerce_cart_item_name', 'wcv_shipping_cart_item', 1, 3 );
function wcv_shipping_cart_item( $title = null, $cart_item = null, $cart_item_key = null ) {
$settings = get_option( 'woocommerce_wcv_pro_vendor_shipping_settings' );
$customer_address = array( 'country' => WC()->customer->get_shipping_country(), 'state' => WC()->customer->get_shipping_state() );
$package = array( 'destination' => $customer_address );
$shipping_rate = WCVendors_Pro_Shipping_Method::get_shipping_rate( $cart_item[ 'product_id' ], $cart_item['data']->post->post_author, $package, $settings );
if( $cart_item_key && is_cart() ) {
echo $title. '<br /><span class=""><br>Shipping : ' . get_woocommerce_currency_symbol(). $shipping_rate->fee . '</span>';
@brianjking
brianjking / Procfile
Created August 16, 2016 02:23 — forked from mabroor/Procfile
Hosting Private password protected Sphinx Docs
web: gunicorn -w4 -b0.0.0.0:$PORT app:app
@moderatorwes
moderatorwes / Category.html
Last active July 21, 2022 14:45
Zendesk: Accordions for Copenhagen theme - Live example(https://zenultra.zendesk.com/)
<!-- Add this code if you would like accordions on your Category Page -->
<div class="container-divider"></div>
<div class="container">
<nav class="sub-nav">
{{breadcrumbs}}
{{search submit=false}}
</nav>
@mrkdevelopment
mrkdevelopment / In your social icons file
Last active July 29, 2022 00:25
Divi social icons extension
<?php if ( 'on' === et_get_option( 'divi_show_linkedin_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-linkedin">
<a href="<?php echo esc_url( et_get_option( 'divi_linkedin_url', '#' ) ); ?>" class="icon">
<span><?php esc_html_e( 'Linked In', 'Divi' ); ?></span>
</a>
</li>
<?php endif; ?>
<?php if ( 'on' === et_get_option( 'divi_show_youtube_icon', 'on' ) ) : ?>
<li class="et-social-icon et-social-youtube">
@KinnaT
KinnaT / sliders-functional-clean.php
Last active May 3, 2016 19:36
Functional selectable sliders as page meta option, uncommented version - accounts for the Revolution Slider and Smart Slider 3 plugins, trivial to add support for more plugins
<?php
// content.php
$config = array(
'title' => __('General Options', 'theme_admin'),
'group_id' => 'general',
'context' => 'normal',
'priority' => 'low',
'types' => array( 'page' )
);
$options = array(
// This would go in $sublime_dir/Packages/User/GitGutter.sublime-settings
{
"live_mode": false,
"focus_change_mode": false
}
#!/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 / speedtest-ifttt.sh
Created March 8, 2016 22:37 — forked from aallan/speedtest-ifttt.sh
Modified version of Henrik Bengtsson's speedtest-cli code which will dispatch the test results to the IFTTT Maker Channel.
#!/usr/bin/env bash
###########################################################################
# Originally written by: Henrik Bengtsson, 2014
# https://github.com/HenrikBengtsson/speedtest-cli-extras
# Modified to use IFTTT by: Alasdair Allan, 2015
# License: GPL (>= 2.1) [http://www.gnu.org/licenses/gpl.html]
###########################################################################
# Character for separating values
# (commas are not safe, because some servers return speeds with commas)
@gnachman
gnachman / iterm.scpt
Last active April 8, 2023 23:42
Replace /Applications/Docker/Docker Quickstart Terminal.app/Contents/Resources/Scripts/iterm.scpt with this.
set itermRunning to (application "iTerm" is running)
set scriptPath to quoted form of POSIX path of ((path to me as text) & "::" & "start.sh")
set user_shell to do shell script "dscl /Search -read /Users/$USER UserShell | awk '{print $2}'"
tell application "iTerm"
activate
if not (exists window 1) or (itermRunning = false) then
reopen
end if
@adeekshith
adeekshith / .git-commit-template.txt
Last active February 21, 2024 12:06 — forked from Linell/.git-commit-template.txt
This commit message template helps you write great commit messages and enforce it across teams.
# <type>: (If applied, this commit will...) <subject> (Max 50 char)
# |<---- Using a Maximum Of 50 Characters ---->|
# Explain why this change is being made
# |<---- Try To Limit Each Line to a Maximum Of 72 Characters ---->|
# Provide links or keys to any relevant tickets, articles or other resources
# Example: Github issue #23