Skip to content

Instantly share code, notes, and snippets.

@AlecRust
AlecRust / gist:4bc7b92cc6dff08193f4
Created April 23, 2015 19:33
[WordPress] Request assets from live server if fails locally
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wp-content/uploads/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) http://yourlivesite.com/wp-content/uploads/$1 [L,P]
</IfModule>

Keybase proof

I hereby claim:

  • I am AlecRust on github.
  • I am alecrust (https://keybase.io/alecrust) on keybase.
  • I have a public key whose fingerprint is 03A2 F5EB DE68 0297 469B A142 5363 9C2A BD44 9581

To claim this, I am signing this object:

@AlecRust
AlecRust / functions.php
Last active August 22, 2023 10:53
Add latest WooCommerce order product name as Mailchimp tag
/**
* Add customer's last order product name as Mailchimp member tag on sync
*/
function product_mailchimp_tag($tags, $email)
{
$new_tags = [];
$query = new WC_Order_Query();
$query->set('customer', $email);
$customer_orders = $query->get_orders();
@AlecRust
AlecRust / daily_backup.yaml
Created March 5, 2023 15:08
Daily partial Home Assistant backup
alias: Daily Partial Backup
description: Create a partial backup (everything but media) every day at 02:00.
trigger:
platform: time
at: '02:00:00'
action:
# Stop all addons
- service: hassio.addon_stop
data:
all: true