Skip to content

Instantly share code, notes, and snippets.

View mindbreaker's full-sized avatar

Tom mindbreaker

View GitHub Profile
@mindbreaker
mindbreaker / solbot.py
Last active November 18, 2024 17:17
pip install requests tweepy pandas beautifulsoup4 nltk
import requests
from bs4 import BeautifulSoup
import tweepy
import pandas as pd
import time
import re
import nltk
from collections import Counter
from nltk.corpus import stopwords
@mindbreaker
mindbreaker / find-cards-woocommerce.js
Created November 5, 2024 17:59
find-cards-woocommerce
// Conversion rate from USD to EUR
const usdToEurRate = 1.09;
// Function to fetch and display prices for each product
async function fetchAndDisplayPrices(productTitle, priceContainer) {
// Define the API endpoint with the product title in the search parameter
const apiEndpoint = `https://findstar-api-zegtz.ondigitalocean.app/api/search/1?key=${encodeURIComponent(productTitle)}&country_code=null&limit=50&page=0&filters=%7B%22region%22:%22Europe%22,%22price%22:%7B%22from%22:null,%22to%22:null%7D%7D`;
try {
@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 / 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();
}