Skip to content

Instantly share code, notes, and snippets.

@DeveloperWil
DeveloperWil / woocommerce-stripe-product-customer-metadata
Created March 30, 2021 22:36
WooCommerce: Stripe product and customer metadata
/**
* Add Stripe metadata along with WooCommerce purchase
*
* @param $metadata
* @param $order
* @param $source
* @return mixed
*/
function wbdc_filter_wc_stripe_payment_metadata( $metadata, $order, $source ) {
@Yatoom
Yatoom / setup.md
Last active April 19, 2024 06:41
Thinkfan configuration

Thinkfan setup

Note: I configured this thinkfan setup for my old Thinkpad w520 on Ubuntu 17.10.

1. Install necessary programs

Install lm-sensors and thinkfan.

sudo apt-get install lm-sensors thinkfan
@cliffordp
cliffordp / functions.php
Last active September 1, 2020 18:15
MT - ET - ET+ - Change email From Address and From Name only when sending ticket emails -- works for RSVP and WooCommerce
<?php
/**
* MT - ET - ET+ - Change email From Address and From Name only when sending ticket emails -- works for RSVP, WooCommerce, and Easy Digital Downloads
*
* From https://gist.github.com/cliffordp/35d3c0a08e53b061920976f80f0f44b4
*
* For https://theeventscalendar.com/support/forums/topic/change-the-sender-email-address-for-all-events-ticket-related-emails/
*/
@bmaupin
bmaupin / pdfedit-docker.md
Last active October 10, 2023 15:37
Run PDFEdit in Docker (was Install PDFEdit on Ubuntu)
@dandye
dandye / install_vmware_vdiskmanager.sh
Last active February 7, 2024 18:34
How to install vmware-vdiskmanager
tar xvf VMware-vix-disklib-6.0.2-3566099.x86_64.tar.gz
cd vmware-vix-disklib-distrib/bin64
sudo ln -s $(pwd)/vmware-vdiskmanager /usr/bin/vmware-vdiskmanager
ls -l /usr/bin/vmware-vdiskmanager
cd ../lib64/
sudo ln -s $(pwd) /usr/lib/vmware
sudo bash -c "echo $(pwd) > /etc/ld.so.conf.d/vmware-vix-disklib.conf"
sudo ldconfig
@pelmered
pelmered / gist:e5633068658e75ba9a80
Last active October 13, 2021 14:55
Cleanup orphaned ACF data
# This might ruin your database and I do not take any responsibility for that. Backup your database before continuing
!
# Check the results throughly
SELECT * FROM `wp_postmeta`
WHERE `meta_key` IN
( SELECT TRIM(LEADING '_' FROM `meta_key`) AS mk
FROM `wp_postmeta`
WHERE `meta_value` regexp '^field_[0-9a-f]+'
AND `meta_value` NOT IN
@anthonyholmes
anthonyholmes / bootstrap-sass-mixin-cheatsheet.scss
Created October 10, 2014 08:13
Bootstrap Sass Mixin Cheatsheet
// Alerts
@include alert-variant($background, $border, $text-color);
// Background Variant
@include bg-variant($parent, $color);
// Border Radius
@include border-top-radius($radius);
@include border-right-radius($radius);
@include border-bottom-radius($radius);
@spivurno
spivurno / gw-gravity-forms-value-exists-validation.php
Last active March 24, 2021 16:08
Gravity Wiz // Gravity Forms // Validate that a Value Exists
<?php
/**
* WARNING! THIS SNIPPET MAY BE OUTDATED.
* The latest version of this snippet can be found in the Gravity Wiz Snippet Library:
* https://github.com/gravitywiz/snippet-library/blob/master/gravity-forms/gw-validate-that-a-value-exists.php
*/
/**
* Gravity Wiz // Gravity Forms // Validate that a Value Exists
*
* Ensure that a value entered in Form A has been previously submitted on Form B. This is useful if you're generating a reference number of some sort
@paulund
paulund / add-option-to-dropdown.js
Created June 25, 2013 18:50
Add and Remove Options in Select using jQuery
$("#selectBox").append('<option value="option6">option6</option>');