Skip to content

Instantly share code, notes, and snippets.

View Accudio's full-sized avatar

Alistair Shepherd Accudio

View GitHub Profile
@Accudio
Accudio / main.css
Created August 20, 2021 17:42
Quick and Dirty 'Dark Mode'
body {
background: black;
}
body, img {
filter: invert(1) hue-rotate(180deg);
}
@Accudio
Accudio / package.json
Created August 3, 2021 10:52
Glyphhanger Usage
{
"name": "glyphhanger-usage",
"version": "0.1.0",
"description": "",
"main": "index.js",
"scripts": {
"convert": "npx glyphhanger --subset=\"*.ttf\" --formats=woff2",
"subset": "npx glyphhanger --subset=\"*.ttf\" --US_ASCII --formats=woff2"
},
"keywords": [],
@Accudio
Accudio / 1-usage.twig
Last active February 19, 2023 15:42
Image macros and functions for Imgix on Daysmart
{# using macro directly #}
{{ image({
url: '/path/to/image.jpg',
alt: 'Image alt attribute',
class: 'mb-30',
imgClass: 'rounded',
lazy: false,
width: 1920,
height: 1080,
ratio: 0.5,
@Accudio
Accudio / service-worker.js
Created February 2, 2021 08:48
Delete all caches from within service-worker
self.addEventListener('activate', event => {
event.waitUntil(
caches.keys().then(allCaches => {
return Promise.all(allCaches.map(cacheToDelete => {
return caches.delete(cacheToDelete);
}));
}).then(() => self.clients.claim())
);
});