Skip to content

Instantly share code, notes, and snippets.

@DylanDuff
DylanDuff / load-gtm.js
Created August 12, 2025 06:58
LoadGTM
add_action( 'wp_body_open', function() {
if ( function_exists( 'gtm4wp_the_gtm_tag' ) ) {
gtm4wp_the_gtm_tag();
}
});
delete FROM `wp_posts` where post_type="product" or post_type="product_variation";
delete pm FROM `wp_postmeta` pm left join wp_posts p on pm.post_id = p.ID where p.ID is null;
DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%');
DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%';
DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy);
DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM wp_posts WHERE post_type IN ('product','product_variation');
DELETE pm
@DylanDuff
DylanDuff / Shortcode: MapBox Loader
Last active May 12, 2025 04:06
Registers a new shortcode for creating a mapbox easily in WordPress
<?php
/**
* Mapbox Shortcode Usage
*
* Attributes:
* - lat Latitude (e.g., "40.7128")
* - lng Longitude (e.g., "-74.0060")
* - zoom Zoom level (default: 14)
* - icon_size Marker icon size (e.g., "40,40")
* - logo_url URL to a custom logo (optional)
@DylanDuff
DylanDuff / GTM-SC.js
Last active April 22, 2025 03:18
GTM SureCart Handler
// Define the list of SureCart event names
// GTM Event Regex: scAddedToCart|scRemovedFromCart|scViewedCart|scProductViewed|scCheckoutInitiated|scCheckoutCompleted|scShippingInfoAdded|scPaymentInfoAdded|scTrialStarted|scSubscriptionStarted
var sureCartEvents = [
'scAddedToCart',
'scRemovedFromCart',
'scViewedCart',
'scProductViewed',
'scCheckoutInitiated',
#define PLIST_PATH @"/var/mobile/Library/Preferences/com.dylanduff.nightshadeprefs.plist"
#define THEME_PATH @"/var/mobile/Library/Nightshade/Themes/"
#define DEFAULTS_PATH @"/Library/PreferenceBundles/NightshadePrefs.bundle/defaults.plist"
inline bool GetPrefBool(NSString *key){
return [[[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key] boolValue];
}
inline NSString *GetPrefVal(NSString *key){
return [[NSDictionary dictionaryWithContentsOfFile:PLIST_PATH] valueForKey:key];
%hook Natwest.QLAnimationControllerSwiftWrapper
@interface Natwest.QLAnimationControllerSwiftWrapper {
}@end
%end
%hook CLSAnalyticsMetadataController
-(BOOL)hostJailbroken {
%orig;
return false;
}
%hook CLSAnalyticsMetadataController
-(BOOL)hostJailbroken {
%orig;
return false;
}
//Just putting this here for later
var total = "";
for( var i = 0; i < 100000; i++ ) {
total = total + i.toString();
history.pushState(0,0, total );
}