Skip to content

Instantly share code, notes, and snippets.

View spacedawwwg's full-sized avatar
👨‍💻
Tappin' codes.

Paul Welsh spacedawwwg

👨‍💻
Tappin' codes.
View GitHub Profile
----------------------------------SANITY RULES----------------------------------
When creating sanity schema make sure to include an appropriate icon for the schema using lucide-react or sanity icons as a fallback. Make sure it's always a named export, make sure you're always using the Sanity typescript definitions if it's a ts file. Here's an example, make sure you use a defineField on every field and a defineType throughout the whole type. If you don't see any arrayMembers, don't import it:
import {defineField, defineType, defineArrayMember} from 'sanity' if it's a .ts file.
defineType({
type: 'object',
name: 'custom-object',
fields: [
defineField({
@spacedawwwg
spacedawwwg / an-alphabet-of-accessibility-issues.md
Created November 29, 2024 15:01
An Alphabet of Accessibility Issues – by Anne Gibson

An Alphabet of Accessibility Issues

by Anne Gibson
Originally Posted on 31 Jul 2014

https://www.perpendicularangel.com/

Note: The original post was removed from it's original URL, so I just wanted to make sure I saved this somewhere.


@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",
}
}