Skip to content

Instantly share code, notes, and snippets.

@razorlegacy
razorlegacy / gtm-maxmind-geoip2-tag.html
Created May 27, 2024 01:25 — forked from keithws/gtm-maxmind-geoip2-tag.html
Google Tag Manager tag to load GeoIP data into the GTM data layer. Helps with GDPR.
<script src="//js.maxmind.com/js/apis/geoip2/v2.1/geoip2.js"></script>
<script>
/*
* get geographical location data by ip address
* uses the free ipify.org services
* and the paid Maxmind GeoIP2 Precision services
*/
(function (geoip2) {
@razorlegacy
razorlegacy / gist:8edceecae67dd962cce0896051594c38
Created December 13, 2018 07:20 — forked from NathanGiesbrecht/gist:972f14f817190f222027
Purge mod_pagespeed cache on WHM server
# This will clear the mod_pagespeed cache on a server that's had it installed via the cPanel script here:
# https://github.com/pagespeed/cpanel
# The location of the cache file may change, it can be found in the pagespeed.conf file located at /usr/local/apache/conf/
# The cache location is set by ModPagespeedFileCachePath variable
touch /var/mod_pagespeed/cache/cache.flush
@razorlegacy
razorlegacy / .htaccess
Created January 24, 2018 16:24
Resize an image on the fly with PHP and cache it (like Drupal's ImageCache)
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z]+)/([^/]*)$ resize.php?size=$1&file=$2