Skip to content

Instantly share code, notes, and snippets.

View kasparsz's full-sized avatar

Kaspars Zuks kasparsz

View GitHub Profile
@kasparsz
kasparsz / find-font-variants.js
Last active May 31, 2018 11:43
Find all variants of the fonts, font weights and font styles used in the jQuery powered page.
function mapObject (obj, fn) {
const result = [];
for (let key in obj) {
let value = fn(obj[key], key);
if (typeof value !== 'undefined') {
result.push(value);
}
}
return result;
}
@kasparsz
kasparsz / Fonts.html
Created November 3, 2016 19:56
Lazy loading fonts
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:400,300,100%7CRoboto+Slab:400,300,100%7CRoboto+Mono:400,300,100" media="not all" onload="if (media != 'all')media='all'">