Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
FILE=wp-config.php
for d in */; do
# Just... yeah
if [ "$d" != "ottersbusinesshub.co.uk/" ]; then
if [ "$d" != "lilymaehomecare.com/" ]; then
echo ""
echo "Entering $d..."
@Glis
Glis / whitelabel-share-clientid.js
Last active December 15, 2021 03:55
[LOCAL][WL-PARENT] Share GA ClientID script
(function() {
// Universal Analytics tracking ID whose _ga cookie to use.
// If using GA4, you can leave this setting untouched.
var trackingId = 'UA-209071318-1';
// Maximum time in milliseconds to wait for GA tracker to load.
// Again, irrelevant for GA4.
var maxGATime = 2000;
// Set to the origin ("https://www.domain.com") of the iframe you want to communicate with
@trey8611
trey8611 / import-svi-variations-gallery-images.md
Created October 19, 2021 20:48
[WP All Import SVI Variations Gallery]
@shmidtelson
shmidtelson / nginx.conf
Last active November 10, 2024 22:36
Wordpress paranoid safe settings
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@gengor-git
gengor-git / Backup-Settings.ps1
Last active June 13, 2024 09:00
Backup script to store my Windows configs in a 7-zip archive incl. scripts for chocolatey and VS Code.
<#PSScriptInfo
.AUTHOR
Martin Palmowski
.SYNPOSIS
Backup settings and configs for my Windows 10 environment.
.DESCRIPTION
Backup the most relevant settings and configs in a 7-zip archive.
Requires 7-zip to be installed an in the path.
Paths are based on Windows 10 defaults.
#>
<?php
function return_canon () {
$canon_page = get_pagenum_link( 1 );
return $canon_page;
}
function canon_paged() {
if ( is_paged() ) {
add_filter( 'wpseo_canonical', 'return_canon' );
}
@ArtemSites
ArtemSites / timeMoreThenSpecifiedTime.js
Last active May 18, 2022 06:27
Событие: пользователь провёл на сайте заданное время | Event: the user spent the specified time on the site
/**
* @description: Событие: пользователь провёл на сайте заданное время | Event: the user spent the specified time on the site
* @version: v1.1, 09.08.2021
* @author: Artem Kuznecov, web.master-artem.ru
* @cacher: https://snippets.cacher.io/snippet/4a2daee81c7ea7033007
**/
(function(){
var targetMoreThenS = 30;
var nameEvent = 'timeMoreThen30s';
@PetraMotz
PetraMotz / code.php
Last active September 21, 2024 21:02
PHP #wordpress #import #php
public function execute() {
/** @var Connection $connection */
$connection = GeneralUtility::makeInstance(ObjectManager::class)->get(ConnectionPool::class)->getConnectionByName(ConnectionPool::DEFAULT_CONNECTION_NAME);
if ($this->initialize() === false) {
return false;
}
<!-- lazy load metrika and jivosite -->
<script>
function appendScriptMetrika() {
const metrikaScript =
`(function (m, e, t, r, i, k, a) { m[i] = m[i] || function () { (m[i].a = m[i].a || []).push(arguments) }; m[i].l = 1 * new Date(); k = e.createElement(t), a = e.getElementsByTagName(t)[0], k.async = 1, k.src = r, a.parentNode.insertBefore(k, a)}) (window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym"); ym(61222240, "init", { clickmap: true, trackLinks: true, accurateTrackBounce: true});`
const scriptTag = document.createElement('script');
scriptTag.innerHTML = metrikaScript;
document.head.appendChild(scriptTag)
}
@ShuvoHabib
ShuvoHabib / linker.js
Created July 17, 2021 21:10
GA Linker
ga(function() {
var trackers = ga.getAll();
var linker = trackers[0].get('linkerParam');
console.log(linker);
});