Skip to content

Instantly share code, notes, and snippets.

View felixarntz's full-sized avatar

Felix Arntz felixarntz

View GitHub Profile
@westonruter
westonruter / slow-content-images.php
Created June 12, 2020 01:23
Development plugin to test slow-loading images in content
<?php
/**
* Slow Content Images plugin bootstrap.
*
* @package Google\Mini_Plugin_Template
* @author Weston Ruter, Google
* @license GPL-2.0-or-later
* @copyright 2020 Google Inc.
*
* @wordpress-plugin
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active March 28, 2024 01:45
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@glueckpress
glueckpress / jquery.inline.anchor.navigation.js
Last active April 28, 2019 12:23
[JavaScript][jQuery] Inline Anchor Navigation: Adds a smooth scroll effect to URLs containing a hash (#). Excludes single hashes, #respond (WordPress comment forms), and orphaned hash characters at the end of a URL.
/**
* jQuery Inline Anchor Navigation
*
* Adds a smooth scroll effect to URLs containing a hash (#).
* Excludes single hashes, #respond (WordPress comment forms), and orphaned
* hash characters at the end of a URL.
*/
(function($) {
$('a[href*="#"]')
.not('a[href="#"]') // Excemption #1: dummy hrefs
@jdevalk
jdevalk / .htaccess
Last active November 28, 2023 20:28
These three files together form an affiliate link redirect script.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteRule (.*) ./index.php?id=$1 [L]
</IfModule>