Skip to content

Instantly share code, notes, and snippets.

{
"ride": {
"free_for_limited_time": false,
"content_availability": "available",
"content_availability_level": "digital_and_above",
"is_limited_ride": false,
"availability": { "is_available": true, "reason": null },
"class_type_ids": ["c87e20095d80463db5ce04df7fe2b989"],
"content_provider": "peloton",
"content_format": "video",
@ChuckMac
ChuckMac / youtube_channel_watch.py
Created May 4, 2023 14:08
Watch and auto-download new episodes of a YouTube channel and rename to Plex friendly format
"""
This script can be used to attempt to download new videos from a
YouTube channel and rename them to a Plex friendly format.
ex: s01e01 - Video Title[ID].mp4
s01e01 - Video Title.json
s01e01 - Video Title.webp
It will skip any videos that are shorter than the specified
minimum length (in seconds) to avoid downloading shorts.
@ChuckMac
ChuckMac / Node Red Alexa Home Skill with Compose.md
Last active December 23, 2022 13:44
Deploy your own Node Red Alexa Home Skill with Compose / Traefik

Pyle PLRV1725 Overhead Car Media Player Video Conversion Settings

Straight conversion to XVID

`ffmpeg -i "input.file" -sn -c:a libmp3lame -ar 48000 -ab 128k -ac 2 -c:v mpeg4 -vtag xvid -qscale:v 6 -preset slow "output.file"

Change qscale as desired. It is a number from 1-31, with 1 being highest quality/largest filesize and 31 being the lowest quality/smallest filesize.

The monitor only supports up to 1080p so you might want to downscale higher resolution content.

Downscale to 1080 XVID but maintain aspect ratio

@ChuckMac
ChuckMac / wp_log.php
Created June 28, 2017 12:23
Simple Debugging With WordPress error log
if(!function_exists('log_it')){
function log_it( $message ) {
if( WP_DEBUG === true ){
if( is_array( $message ) || is_object( $message ) ){
error_log( print_r( $message, true ) );
} else {
error_log( $message );
}
}
}
@ChuckMac
ChuckMac / gist:62ee5c0bcfc0eb8d6780
Created April 13, 2015 14:16
WooCommerce - Order Tax Report By State / Date
SELECT i.order_id as "Order #", pm4.meta_value as "Order Completed Date", tm.name as "Order Status", pm.meta_value as "Billing State", pm2.meta_value as "Order Total", pm3.meta_value as "Order Tax"
FROM wp_woocommerce_order_items i
INNER JOIN wp_postmeta pm
on pm.post_id = i.order_id
INNER JOIN wp_postmeta pm2
on pm2.post_id = i.order_id
INNER JOIN wp_postmeta pm3
on pm3.post_id = i.order_id
INNER JOIN wp_postmeta pm4
on pm4.post_id = i.order_id
@ChuckMac
ChuckMac / gist:3694d5a7d7696e386968
Last active June 1, 2017 17:28
WooCommerce Subscriptions Stats Export
SELECT i.order_id as "Order #", tm.name as "Order Status", pm.meta_value as "Customer", i.order_item_name as "Subscription Type", m3.meta_value as "Subscription Status", m.meta_value as "Start Date", m2.meta_value as "End Date", m4.meta_value as "Expiry Date", m5.meta_value as "Trial Expiry Date", m6.meta_value as "Completed Payments"
FROM wp_woocommerce_order_items i
INNER JOIN wp_woocommerce_order_itemmeta m
on m.order_item_id = i.order_item_id
INNER JOIN wp_woocommerce_order_itemmeta m2
on m2.order_item_id = i.order_item_id
INNER JOIN wp_woocommerce_order_itemmeta m3
on m3.order_item_id = i.order_item_id
INNER JOIN wp_woocommerce_order_itemmeta m4
on m4.order_item_id = i.order_item_id
@ChuckMac
ChuckMac / gist:49b8b1b48523d9a7d85c
Created February 17, 2015 19:05
WooCommerce - Update Coupon Except With Note For Specific Types
UPDATE wp_posts p
INNER JOIN wp_postmeta m2
ON m2.post_id = p.id
AND m2.meta_key = 'product_ids'
SET p.post_excerpt='groupon'
WHERE p.post_type='shop_coupon'
AND ( m2.meta_value='xxx' OR m2.meta_value='yyyy' )
@ChuckMac
ChuckMac / gist:910f4250c26737bb4694
Last active August 29, 2015 14:10
Create WooCommerce Coupon Automagically
add_filter( 'woocommerce_coupon_code', 'create_coupon' );
function create_coupon ( $coupon ) {
if ( '' != $coupon ) {
//$the_coupon = new WC_Coupon( $coupon );
if ( ! $the_coupon->id ) {
$coupon_data = array(

Keybase proof

I hereby claim:

  • I am chuckmac on github.
  • I am chuckmac (https://keybase.io/chuckmac) on keybase.
  • I have a public key whose fingerprint is 9832 7B29 F502 68AC FE80 DD00 8A6A 56D0 94F3 A97F

To claim this, I am signing this object: