Skip to content

Instantly share code, notes, and snippets.

View mindbreaker's full-sized avatar

Tom mindbreaker

View GitHub Profile
@mindbreaker
mindbreaker / CookieBot.html
Created April 18, 2024 10:48
Cookie Bot integration with GTM only loads statistics or marketing
<!-- Google Consent Mode -->
<script data-cookieconsent="ignore">
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments)
}
gtag("consent", "default", {
ad_personalization: "denied",
ad_storage: "denied",
ad_user_data: "denied",
@mindbreaker
mindbreaker / matomo-debug.js
Last active May 7, 2020 10:04
Show and hide matomo debug console. Bookmarklet here: [Bookmarklet](https://codepen.io/mindbreaker/full/abvqPeX)
var x = document.getElementById("mtmDebugFrame");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
@mindbreaker
mindbreaker / keybase.md
Created September 11, 2019 09:44
keybase.md

Keybase proof

I hereby claim:

  • I am mindbreaker on github.
  • I am mindbreaker (https://keybase.io/mindbreaker) on keybase.
  • I have a public key ASBSlMziIrh08_hgtBR4XAYwZ235c50gY2oRJUzf486M1go

To claim this, I am signing this object:

Robots Exclusion Protocol

  • Seit 25 Jahren ist REP als Draft-Mode verfügbar
  • Google möchte REP zum Internet-Standard machen
  • Jede Suchmaschine hat hierzu unterschiedliche Varianten implementiert

Im allgemeinen geht es darum, nicht dokumentierte Szenarien festzuhalten:

  • Jedes Übertragungsprotokoll, das auf URIs (Uniform Resource Identifiern) basiert, kann eine robots.txt verwenden. Dazu gehört nicht nur HTTP, sondern zum Beispiel auch FTP oder CoAP.
  • Entwickler / Suchmaschinen müssen mindestens 500 Kilobytes einer robots.txt parsen.
  • Eine neue maximale Obegrenze für das Caching von 24 Stunden gibt Webseitenbetreibern die Möglichkeit, ihre robots.txt flexibel anzupassen. Gleichzeitig überfordern Crawler die Websites nicht mit Anfragen an die robots.txt.
@mindbreaker
mindbreaker / jquery.scrolldepth.js
Created March 30, 2016 15:40
jquery-scrolldepth for jQuery 1.6.x
/*!
* @preserve
* jquery.scrolldepth.js | v0.8
* Copyright (c) 2015 Rob Flaherty (@robflaherty)
* Licensed under the MIT and GPL licenses.
*/
;(function ( $, window, document, undefined ) {
"use strict";
@mindbreaker
mindbreaker / gsc-url-export.js
Last active June 14, 2018 11:58
Fast export URLs from new GSC
document.querySelectorAll("content .zRhise span").forEach(function(e) {
var title = e.getAttribute("title");
if(title)
console.log(e.getAttribute("title"));
});
{"uses":100}
var BounceBooster={debug:false,ref:"",rules:[{id:"google",condition:function(){return/www\.google\./i.test(BounceBooster.ref)}},{id:"yahoo",condition:function(){return/search\.yahoo\.com/i.test(BounceBooster.ref)}},{id:"bing",condition:function(){return/www\.bing\.com/i.test(BounceBooster.ref)}},{id:"facebook",condition:function(){return/facebook\.com/i.test(BounceBooster.ref)}},{id:"twitter",condition:function(){return/t\.co/i.test(BounceBooster.ref)}},{id:"google_plus",condition:function(){return/plus\.url\.google\.com/i.test(BounceBooster.ref)}},{id:"youtube",condition:function(){return/youtube\.com/i.test(BounceBooster.ref)}},{id:"tumblr",condition:function(){return/tumblr\.com/i.test(BounceBooster.ref)}},{id:"instagram",condition:function(){return/instagram\.com/i.test(BounceBooster.ref)}},{id:"default",condition:function(){if(BounceBooster.ref.length>0){var a=new RegExp("^"+location.protocol+"//"+location.host,"i");return !a.test(BounceBooster.ref)}return true}}],init:function(b){BounceBooster.findRefer
@mindbreaker
mindbreaker / file-extension.js
Last active July 26, 2017 10:03
Google Tag Manager Variablen fürs Download-Tracking: Dateiname (katalog.pdf) und Dateierweiterung (pdf)
function() {
return {{Click URL}}.split('.').pop();
}
@mindbreaker
mindbreaker / onpage-copy-urls-bookmarklet.js
Last active July 20, 2017 12:18
Copy URLs from Ryte.com (formerly OnPage.org)
javascript:void function(){$("table").prepend("<textarea id='copyurls' cols='100' rows='20' style='height:auto; max-width: none'></textarea>"),$("table tbody tr").each(function(){$("textarea#copyurls").append($(this).data("url")+"\n")})}();