Skip to content

Instantly share code, notes, and snippets.

View Dilden's full-sized avatar
🏠
Working from home

Dylan Hildenbrand Dilden

🏠
Working from home
View GitHub Profile
@Dilden
Dilden / ddns.sh
Last active February 12, 2021 02:22
DDNS via Cloudflare API
#/usr/bin/env sh
# Date
DATE=`date +%Y-%m-%d_%H:%M:%S`
# Get the ZoneID from: https://www.cloudflare.com/a/overview/<your-domain>
DNS_ZONE=YOUR_ZONE_ID_HERE
# Get the existing identifier for DNS entry:
# https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
@Dilden
Dilden / custom_plugin_WC_templates.php
Created September 28, 2016 19:39
Useful snippet for overriding WooCommerce templates in your custom WordPress plugin. Just follow the same directory structure as if you were overriding the templates from a theme.
// Override woocommerce templates with the templates in my plugin
add_filter( 'woocommerce_locate_template', 'custom_plugin_templates');
function custom_plugin_templates ( $template, $template_name, $template_path ) {
$check_dis = str_replace('woocommerce', 'your-plugin-name-goes-here/woocommerce', $template);
if(file_exists($check_dis)) {
$template = $check_dis;
}
return $template;
};
@Dilden
Dilden / wpbak.sh
Last active March 3, 2023 15:51
WordPress Backup script
#!/bin/sh
THESITENAME=""
THEDB=""
THEDBUSER=""
THEDBPW=""
THEDATE=`date +%d%m%y%H%M`
# There is a space between the first `/` and the rest of the path in this variable
# It needs to be there for the TAR command to work for some reason
SITE_PATH="/ var/www/"