Skip to content

Instantly share code, notes, and snippets.

View BFTrick's full-sized avatar

Patrick Rauland BFTrick

View GitHub Profile
#!/usr/bin/env python3
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
from gql.transport.exceptions import TransportQueryError
import json
import time
import os
bearer = "YOURBEARERTOKEN"
@BFTrick
BFTrick / ship-hero-order-status.py
Last active October 21, 2024 16:47
Use the Ship Hero GraphQL API to get all orders & tracking numbers
#!/usr/bin/env python3
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
from gql.transport.exceptions import TransportQueryError
import json
import time
import os
bearer = "YOURBEARERTOKEN"
@BFTrick
BFTrick / ship-hero-access-token.bash
Created October 15, 2024 18:12
Get an access token for Ship Hero's API
#!/usr/bin/env bash
curl -X POST -H "Content-Type: application/json" -d \
'{ "username": "EMAILHERE",
"password": "PWHERE"
}' \
"https://public-api.shiphero.com/auth/token"
@BFTrick
BFTrick / ship-hero-inventory.py
Last active October 18, 2024 21:56
Fetch SKU and available inventory from Ship Hero
#!/usr/bin/env python3
from gql import gql, Client
from gql.transport.requests import RequestsHTTPTransport
from gql.transport.exceptions import TransportQueryError
import json
import time
import os
bearer = ADDYOURTOKENHERE
@BFTrick
BFTrick / functions.php
Created August 27, 2024 23:14
Send Conversion Event via Action Scheduler
<?php
/**
* Example Sending Conversion Event via Action Scheduler
*/
if ( ! function_exists( 'update_event_tracking_software' ) ) {
/**
* Handle order status changes and send events to event tracking software PAP updates.
*/
function update_event_tracking_software( $order_id, $old_status, $new_status ) {
@BFTrick
BFTrick / woocommerce-example-plugin.php
Created April 6, 2024 20:42
Packt Mastering WooCommerce - Example WooCommerce Plugin
<?php
/*
* Plugin Name: WooCommerce Example Plugin
* Requires Plugins: woocommerce
* Plugin URI: http://speakinginbytes.com
* Description: Our custom WooCommerce functionality
* Version: 2.0
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com
* License: GPL2
@BFTrick
BFTrick / woocommerce-accessible-sale-price.php
Last active November 15, 2024 15:52
Make WooCommerce Sale Prices Accessible
<?php
/*
Plugin Name: WooCommerce Make Sale Prices Accessible
Plugin URI: https://gist.github.com/BFTrick/47b0710a6d27332d0c109cfe75c58be6
Description: Make WooCommerce sale prices accessible
Version: 1.0
Author: Patrick Rauland
Author URI: http://speakinginbytes.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@BFTrick
BFTrick / woocommerce-move-product-price.php
Last active January 28, 2024 20:32
A demo plugin to move the WooCommerce sinmple product price lower
<?php
/*
Plugin Name: WooCommerce Move Product Page Price Lower
Plugin URI: https://gist.github.com/BFTrick/e19bd2bb648558ca78279c3d5ba9524e
Description: A demo plugin to move the WooCommerce sinmple product price lower
Version: 1.0
Author: Patrick Rauland
Author URI: http://speakinginbytes.com
License: GPL2
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@BFTrick
BFTrick / pixel-perfect-webinar-css.css
Last active March 22, 2018 17:25
CSS Animations for the Pixel Perfect Webinar
.home .products .product .price {
opacity: 0;
}
.home .products .product:hover .price {
-webkit-animation: fade-in-bottom 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
animation: fade-in-bottom 0.6s cubic-bezier(0.390, 0.575, 0.565, 1.000) both;
}
/* ----------------------------------------------
<?php
/*
Plugin Name: Pixel Perfect Webinar Changes
Description: The changes for the Pixel Perfect Webinar
Version: 1.0.0
Author: Patrick Rauland
Author URI: https://speakinginbytes.com
*/