Skip to content

Instantly share code, notes, and snippets.

💭
Looking to relocate to the Seattle, WA area!

Brian J King brianjking

💭
Looking to relocate to the Seattle, WA area!
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
@OttoWinter
OttoWinter / 0migrator.md
Last active May 19, 2019
Lovelace Migration Script
View 0migrator.md

Home Assistant Lovelace Migrator

Do you want to try out this experimental (!) new lovelace UI stuff in Home Assistant but don't want to migrate your entire configuration? This script is here to help! It reads in your Home Assistant configuration (specifically the group: section) and creates a matching ui-lovelace.yaml file in your Home Assistant configuration folder (of course backing up any previous file at that path).

To use this script, you first need to have python and home assistant installed where you plan to run this script. Do so using virtual environments and the pip3 install -U homeassistant command. Then copy below file to lovelace_migrate.py (any location should work) and run:

python3 lovelace_migrate.py -c <PATH_TO_HASS_CONFIG_DIR>
@woogists
woogists / wc-export-custom-field-data.php
Created Mar 9, 2018
[ShipStation] Export Custom Field Data to ShipStation
View wc-export-custom-field-data.php
// Add this code to your theme functions.php file or a custom plugin
add_filter( 'woocommerce_shipstation_export_custom_field_2', 'shipstation_custom_field_2' );
function shipstation_custom_field_2() {
return '_meta_key'; // Replace this with the key of your custom field
}
// This is for custom field 3
add_filter( 'woocommerce_shipstation_export_custom_field_3', 'shipstation_custom_field_3' );
@mrkdevelopment
mrkdevelopment / style.css
Created Jun 7, 2017
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
anonymous
anonymous / usps.py
Created Jun 5, 2017
View usps.py
"""
Sensor for USPS packages.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.usps/
"""
from collections import defaultdict
import logging
from datetime import timedelta
@adnan360
adnan360 / https-on-localhost.md
Last active Sep 27, 2019
Use HTTPS on Localhost (XAMPP, Windows)
View https-on-localhost.md

Sometimes some websites require https to work. This can be useful in those cases.

This has been tested with XAMPP (PHP 7.0.8) on Windows 7. Please see the Reference links at the end if in confusion about some step.

STEP 1: Editing Configs

Open:

C:\xampp\php\php.ini
@ziadoz
ziadoz / install.sh
Last active Oct 18, 2019
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`
@franticpsyx
franticpsyx / composites_sale_status_tweak.php
Last active Dec 21, 2017
Use this snippet to prevent composites with component discounts from appearing as on-sale.
View composites_sale_status_tweak.php
<?php
/**
* Plugin Name: WooCommerce Composite Products - Sale Status Tweak
* Plugin URI: http://woocommerce.com/products/composite-products/
* Description: Prevents Composite Products with component discounts from appearing as on-sale.
* Version: 1.0
* Author: SomewhereWarm
* Author URI: http://somewherewarm.gr/
* Developer: Manos Psychogyiopoulos
*
@agusmu
agusmu / functions.php
Created Oct 10, 2016 — forked from fervous/functions.php
Show shipping by vendor next to item in cart
View functions.php
// 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 Aug 16, 2016 — forked from mabroor/Procfile
Hosting Private password protected Sphinx Docs
View Procfile
web: gunicorn -w4 -b0.0.0.0:$PORT app:app
You can’t perform that action at this time.