Skip to content

Instantly share code, notes, and snippets.

View mundizzle's full-sized avatar
🏠
Working from home

mundi morgado mundizzle

🏠
Working from home
View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active July 2, 2026 03:20
Listen to your web pages
@willmendesneto
willmendesneto / a11y-dev-mode.css
Last active March 2, 2026 03:20
Using CSS for highlight errors in HTML - A11Y Linting HTML with CSS
/* Highliting accessibility errors in HTML */
/* highlight HTML element with invalid value for lang attribute */
html:not([lang]),
html[lang=""] {
border: 2px dotted red !important;
}
/* highlight images missing alt text */
img:not([alt]) {
Seven different types of CSS attribute selectors
// This attribute exists on the element
[value]
// This attribute has a specific value of cool
[value='cool']
// This attribute value contains the word cool somewhere in it
[value*='cool']
@tomsoderlund
tomsoderlund / ExampleComponent.js
Last active May 13, 2021 01:50
Shared state using React Hooks and Context, to allow sharing of state between multiple components or hooks
import React, { useContext } from 'react'
import { UserContext, UserContextProvider } from './UserContext'
export default (props) => {
const [user, setUser] = useContext(UserContext)
return (
<UserContextProvider user={null}>
<div>User name: {user && user.name}</div>
</UserContextProvider>
@mundizzle
mundizzle / subscriptions.xml
Created June 9, 2019 16:08
front-end feed
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>RSS subscriptions for mundizzle@gmail.com</title>
<dateCreated>Sun, 09 Jun 2019 11:05:23 -0500</dateCreated>
<ownerEmail>mundizzle@gmail.com</ownerEmail>
</head>
<body>
<outline text="A List Apart: The Full Feed" title="A List Apart: The Full Feed" type="rss" xmlUrl="http://feeds.feedburner.com/alistapart/main" htmlUrl="&#10; https://alistapart.com "/>
<outline text="Cognition by Happy Cog" title="Cognition by Happy Cog" type="rss" xmlUrl="http://feeds.feedburner.com/cognitionfeed" htmlUrl="http://cognition.happycog.com/feed"/>
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active August 2, 2026 10:41
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@whoisryosuke
whoisryosuke / prettier.sh
Created April 13, 2019 19:08
Prettier - Format or unminify code (single file or any folder of certain files)
# Quickly fix one file
npx prettier --write your-file.html
# Quickly fix all files of one type
npx prettier --write src/**/*.{js,jsx}
/**
* Pass in an element and its CSS Custom Property that you want the value of.
* Optionally, you can determine what datatype you get back.
*
* @param {String} propKey
* @param {HTMLELement} element=document.documentElement
* @param {String} castAs='string'
* @returns {*}
*/
const getCSSCustomProp = (propKey, element = document.documentElement, castAs = 'string') => {
@matthewp
matthewp / decorate-element.js
Last active April 23, 2020 07:57
decorate-element
function decorate(tag, template) {
customElements.define(tag, class extends HTMLElement {
constructor() {
super();
this.attachShadow({ mode: 'open' });
}
connectedCallback() {
let root = this.shadowRoot;
if(!root.firstChild) {