Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View spacedawwwg's full-sized avatar
💻
Tappin' the codes

Paul Welsh spacedawwwg

💻
Tappin' the codes
View GitHub Profile
@spacedawwwg
spacedawwwg / generatePage.ts
Last active July 26, 2022 18:15
Function for generating pages on Netlify using Vite Plugin SSR
// /package/functions/generatePage.ts
// `importBuild.cjs` enables us to bundle our serverless functions, see https://vite-plugin-ssr.com/importBuild.cjs
// File is generated within /package/dist/server/importBuild.cjs
import '../dist/server/importBuild.cjs';
import type { Handler, HandlerEvent } from '@netlify/functions';
import { builder } from '@netlify/functions';
import { fixPathSlashes } from '@unilever/utils-helpers';
@spacedawwwg
spacedawwwg / css-namespaces-cheat-sheet.md
Last active January 8, 2021 10:21
CSS Namespaces Cheat Sheet

CSS Namespaces Cheat Sheet

o-: Object may be used in any number of unrelated contexts to the one you can currently see it in. Making modifications to these types of class could potentially have knock-on effects in a lot of other unrelated places. Tread carefully.

l-: Layout is a superset of Object. It follows the same rules, but clearly identifies it's position in the composition.

c-: Component is a concrete, implementation-specific piece of UI. All of the changes you make to its styles should be detectable in the context you’re currently looking at. Modifying these styles should be safe and have no side effects.

u-: Utility has a very specific role (often providing only one declaration) and should not be bound onto or changed. It can be reused and is not tied to any specific piece of UI.

@spacedawwwg
spacedawwwg / common-dns-prefetch-domains.html
Last active November 14, 2020 17:11
Common DNS Prefetch Domains
<!-- Google CDN -->
<link rel="dns-prefetch" href="//ajax.googleapis.com">
<!-- Google API -->
<link rel="dns-prefetch" href="//apis.google.com">
<!-- Google Fonts -->
<link rel="dns-prefetch" href="//fonts.googleapis.com">
<link rel="dns-prefetch" href="//fonts.gstatic.com">
@spacedawwwg
spacedawwwg / package.json
Last active November 14, 2020 15:09
Use npm-check-updates to upgrade whole mono-repo (with interactive flag)
{
"scripts": {
"upgrade:interactive": "find . -type f -name 'package.json' -not -path './.git/*' -not -path '*/node_modules/*' -execdir ncu --interactive \\;"
},
"devDependencies": {
"npm-check-updates": "^10.0.0",
}
}