Skip to content

Instantly share code, notes, and snippets.

@henshaw
henshaw / mono-system-font-stack.css
Created August 20, 2022 14:59
Mono system font stack
font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
@henshaw
henshaw / serif-system-font-stack.css
Created August 20, 2022 14:59
Serif system font stack
font-family: Iowan Old Style, Apple Garamond, Baskerville, Times New Roman, Droid Serif, Times, Source Serif Pro, serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol;
@henshaw
henshaw / sans-serif-system-font-stack.css
Created August 20, 2022 14:58
Sans-serif system font stack
font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif;
@henshaw
henshaw / icon-full-affiliate.css
Last active June 3, 2022 15:25
External link icon CSS for affiliate links
article a[rel *= "sponsored"]:after {
display:inline-block;content: " " url(/affiliate.svg);width:1rem;padding-left:.3rem;
}
@henshaw
henshaw / icon-full-pdf.css
Last active June 3, 2022 07:30
External link icon for PDFs
article a[href *= ".pdf"]:after {
display:inline-block;content: " " url(/pdf.svg);width:2rem;padding-left:.4rem;
}
@henshaw
henshaw / icon-full-example.css
Last active November 24, 2022 20:50
External Link Icon CSS
article a[href *= "henshaw.social"]:after {
display:inline-block;content: " " url(/fediverse.svg);width:1.2rem;padding-left:.4rem;
}
@henshaw
henshaw / icon-selector.css
Last active November 24, 2022 20:48
Selector for link icon
a[href *= "henshaw.social"]:after
@henshaw
henshaw / native-lazy-loading-image.html
Created May 7, 2022 04:13
Native lazy loading an image
<img src="https://domain.com/image.png" loading="lazy" alt="Image description">
@henshaw
henshaw / before-native-lazy-loading.html
Created May 7, 2022 04:12
Code example before native lazy loading existed
<img class="lazy" data-src="https://domain.com/image.png" alt="Image description">
<noscript>
<img src="https://domain.com/image.png" alt="Image description">
</noscript>
@henshaw
henshaw / remove.sql
Created February 14, 2022 05:12
Remove IPs and User Agents from YOURLS log for privacy
UPDATE `yourls_log` SET `ip_address` = Null;
UPDATE `yourls_log` SET `user_agent` = Null;