Skip to content

Instantly share code, notes, and snippets.

View Karendev's full-sized avatar
🏠
Working from home

Karen Johnstone Karendev

🏠
Working from home
  • Gold Coast, Australia
View GitHub Profile
<?php
//* Append directives to the virtual robots.txt
//* Siteground adds crawl-delay: 10 to robots.txt. Don't use physical robots.txt on SiteGround
add_filter( 'robots_txt', 'robots_mod', 10, 2 );
function robots_mod( $output, $public ) {
$output .= "Sitemap: https://victorfont.com/sitemap_index.xml";
return $output;
}
@Karendev
Karendev / media-query.css
Created August 30, 2021 06:00 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@Karendev
Karendev / form.html
Created February 22, 2021 06:57
MailChimp for WordPress: HTML for a <select> box containing all possible country codes.
<select name="ADDRESS[country]">
<option value="AF">Afghanistan</option>
<option value="AX">Åland Islands</option>
<option value="AL">Albania</option>
<option value="DZ">Algeria</option>
<option value="AS">American Samoa</option>
<option value="AD">Andorra</option>
<option value="AO">Angola</option>
<option value="AI">Anguilla</option>
<option value="AQ">Antarctica</option>
document.addEventListener("DOMContentLoaded", function() {
var lazyBackgrounds = [].slice.call(document.querySelectorAll(".lazy-bg"));
if ("IntersectionObserver" in window && "IntersectionObserverEntry" in window && "intersectionRatio" in window.IntersectionObserverEntry.prototype) {
let lazyBackgroundObserver = new IntersectionObserver(function(entries, observer) {
entries.forEach(function(entry) {
if (entry.isIntersecting) {
entry.target.classList.add("bg-visible");
lazyBackgroundObserver.unobserve(entry.target);
}
<?php
/**
* Add skip-lazy class to first image in content.
*/
add_filter( 'the_content', function( $content ) {
// Check if we have no content.
if ( empty( $content ) ) {
return $content;
}
@Karendev
Karendev / GDPR.md
Created April 11, 2019 06:18
(Data) Protection Racket
@Karendev
Karendev / Three Wise Monkeys.md
Created April 11, 2019 06:15
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@Karendev
Karendev / Contract Killer 3.md
Created April 11, 2019 06:01
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post