Skip to content

Instantly share code, notes, and snippets.

🌈
⭐️⭐️⭐️⭐️🐴

Zach Leatherman zachleat

🌈
⭐️⭐️⭐️⭐️🐴
Block or report user

Report or block zachleat

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@zachleat
zachleat / img.njk
Created Sep 5, 2019
Experimenting with a Nunjucks shortcode for images in Eleventy
View img.njk
<!-- throws an error, missing [alt] attribute -->
{% img src="img/9a93578a.png", loading="lazy" %}
<!-- local img source, outputs a standard <img> tag -->
{% img src="img/9a93578a.png", alt="zachleat’s Avatar", loading="lazy" %}
<!-- remote img source -->
<!-- download using avatar-local-cache, outputs <picture> with webp and png fallback -->
{% img src="https://www.gravatar.com/avatar/e1899004c71c7043343196103e210be3?default=404", alt="zachleat’s Avatar", loading="lazy" %}
@zachleat
zachleat / .js
Created Aug 29, 2019
Using Eleventy Programmatically
View .js
const Eleventy = require("@11ty/eleventy");
(async function() {
let inst = new Eleventy();
await inst.init();
await inst.write();
})();
@zachleat
zachleat / gist:cda7af65f5d61666e7fa6037c3ede752
Created Jun 12, 2019
This webmention entry made it through sanitize-html
View gist:cda7af65f5d61666e7fa6037c3ede752
{
"type": "entry",
"author": {
"type": "card",
"name": "",
"photo": "",
"url": ""
},
"url": "https://remysharp.com/2019/06/11/ejecting-disqus",
"published": "2019-06-11T00:00:00",
@zachleat
zachleat / font-sizes.js
Last active Jan 11, 2019
Returns a unique sorted array of font-size values on a page.
View font-sizes.js
(function() {
let fontSizes = new Set();
document.querySelectorAll("*").forEach(function(node) {
fontSizes.add(window.getComputedStyle(node).getPropertyValue("font-size"));
});
return Array.from(fontSizes).sort();
})();
View gist:27e61d1a7dc25e6cab40241e05e0239c
;(function ($) {
function Lettering() {}
Lettering.prototype.splitText = function() {};
Lettering.prototype.injector = function() {};
window.LetteringJS = Lettering;
})(jQuery);
View gist:c8638fbfa337f7fe0dfc1d8d90acf89e
Dear Zach Leatherman,
Today the FCC voted to remove net neutrality rules that restricted Internet service providers from throttling specific parts of the Internet, creating "Paid Prioritization" plans, and blocking or reducing access to competitive products.
We at XXX stand committed to Net Neutrality and to treating all customer data as the highest priority and will not throttle, cap, or limit access to any legal site on the Internet. When our data usage gets high on links we increase the speed we can handle instead of trying to reduce the speed you use.
We believe the Internet should remain open and we will do our part for our customers to make sure that happens.
Thanks,
@zachleat
zachleat / gist:c135c079f802934006978e2257086cc3
Last active Aug 28, 2017
Typinator Automations for CSS em and rem values
View gist:c135c079f802934006978e2257086cc3
Ems
---
Abbreviation: ;ems
Formula: {{size=?Size}}{{parentsize=?Parent Size<16>}}{{#size/parentsize}}em; /* {{#size}}px /{{#parentsize}} */
Sample output: 0.75em; /* 12px /16 */
Rems
----
Abbreviation: ;rems
Formula: {{size=?Size}}{{parentsize=?Parent Size<16>}}{{#size/parentsize}}rem; /* {{#size}}px /{{#parentsize}} */
@zachleat
zachleat / any-link.css
Created Aug 1, 2017
Trying to use CSS `:any-link`
View any-link.css
View keybase.md

Keybase proof

I hereby claim:

  • I am zachleat on github.
  • I am zachleat (https://keybase.io/zachleat) on keybase.
  • I have a public key ASALM-rWVUGBxkz91b64U9hfSLAk1RunNYaItxbBr6nc7Ao

To claim this, I am signing this object:

@zachleat
zachleat / gist:96516e8a3bbff53355ba65f0b7732aed
Last active Jan 16, 2017
Installing phantomjs 2.5.0 Beta
View gist:96516e8a3bbff53355ba65f0b7732aed
# First download phantomjs-2.5.0-beta-macos.zip from https://bitbucket.org/ariya/phantomjs/downloads
# I put mine into ~/Code/phantomjs-2.5.0-beta-macos
~/Code/phantomjs-2.5.0-beta-macos/bin ᐅ ./phantomjs
dyld: Library not loaded: /usr/local/opt/webp/lib/libwebp.6.dylib
Referenced from: /Users/zachleat/Code/phantomjs-2.5.0-beta-macos/bin/./phantomjs
Reason: image not found
[1] 33803 abort ./phantomjs
~/Code/phantomjs-2.5.0-beta-macos/bin ᐅ brew install webp
You can’t perform that action at this time.