Skip to content

Instantly share code, notes, and snippets.

@henshaw
henshaw / lazy-loading-image.html
Created October 4, 2023 21:31
Native image lazy loading
<img src="https://domain.com/image.png" loading="lazy" alt="Image description">
@henshaw
henshaw / disallow-genai-bots.txt
Last active April 16, 2024 23:33
Disallow all pages from being trained for LLMs by all major GenAI bots
User-agent: AdsBot-Google
Disallow: /
User-agent: Amazonbot
Disallow: /
User-agent: Anthropic-ai
Disallow: /
User-agent: AwarioRssBot
Disallow: /
User-agent: AwarioSmartBot
Disallow: /
@henshaw
henshaw / google-extended-folder.txt
Created September 29, 2023 05:31
Disallow specific folders from being used to train Google LLMs
User-agent: Google-Extended
Disallow: /folder
@henshaw
henshaw / google-extended-all.txt
Created September 29, 2023 05:30
Disallow all pages from being used to train Google LLMs
User-agent: Google-Extended
Disallow: /
@henshaw
henshaw / rss-feed-link-example.html
Created September 16, 2023 17:25
RSS feed link example
@henshaw
henshaw / gravatar-alt-text.php
Last active September 3, 2023 01:31
Add ALT text to gravatar image in byline
// If you use this Gravatar code in your WordPress templates
<?php echo get_avatar( get_the_author_meta( 'ID' ), 60); ?>
// Add this to functions.php to include ALT text with the image
function gravatar_alt($text) {
$alt = get_the_author_meta( 'display_name' );
$text = str_replace('alt=\'\'', 'alt=\'Headshot for '.$alt.'\'',$text);
return $text;
}
add_filter('get_avatar','gravatar_alt');
@henshaw
henshaw / schema-person.js
Last active August 28, 2023 23:18
Detailed Person Schema example
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Person",
"@id": "https://www.coywolf.news/jon-henshaw#Person",
"name": "Jon Henshaw",
"givenName": "Jonathan",
"familyName": "Henshaw",
"additionalName": "Michael",
"nationality":{
@henshaw
henshaw / close.html
Last active January 14, 2024 03:06
JavaScript and HTML used to show and hide Close icon
<!-- JS for displaying and hiding "Close" icon -->
<script>
function navopen() {
var x = document.getElementById("close");
if (x.style.display === "none") {
x.style.display = "block";
} else {
x.style.display = "none";
}
}
@henshaw
henshaw / menu-link.html
Created July 22, 2023 14:10
Menu jump link
@henshaw
henshaw / breadcrumblist.json
Last active January 14, 2024 03:05
BreadcrumbList Schema example with emoji
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement":
[
{
"@type": "ListItem",
"position": 1,
"item":
{