Skip to content

Instantly share code, notes, and snippets.

View mono-system-font-stack.css
font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace;
View serif-system-font-stack.css
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 Aug 20, 2022
Sans-serif system font stack
View sans-serif-system-font-stack.css
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 Jun 3, 2022
External link icon CSS for affiliate links
View icon-full-affiliate.css
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 Jun 3, 2022
External link icon for PDFs
View icon-full-pdf.css
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 Jun 3, 2022
External Link Icon CSS
View icon-full-example.css
article a[href *= "twitter.com"]:after {
display:inline-block;content: " " url(/twitter.svg);width:1.2rem;padding-left:.4rem;
}
@henshaw
henshaw / icon-selector.css
Created Jun 3, 2022
Selector for link icon
View icon-selector.css
a[href *= "twitter.com"]:after
@henshaw
henshaw / native-lazy-loading-image.html
Created May 7, 2022
Native lazy loading an image
View native-lazy-loading-image.html
<img src="https://domain.com/image.png" loading="lazy" alt="Image description">
@henshaw
henshaw / before-native-lazy-loading.html
Created May 7, 2022
Code example before native lazy loading existed
View before-native-lazy-loading.html
<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 Feb 14, 2022
Remove IPs and User Agents from YOURLS log for privacy
View remove.sql
UPDATE `yourls_log` SET `ip_address` = Null;
UPDATE `yourls_log` SET `user_agent` = Null;