Skip to content

Instantly share code, notes, and snippets.

View basham's full-sized avatar

Chris Basham basham

View GitHub Profile
@basham
basham / css-media-queries-best-practices.md
Last active December 16, 2021 08:29
CSS Media Queries: Best Practices

CSS Media Queries: Best Practices

@basham
basham / controller.js
Created May 5, 2023 15:17
Integrate Lit's reactive controllers with React.
import { useEffect, useReducer, useRef } from 'react';
export class Controller {
#host;
constructor (host) {
this.#host = host;
host?.addController(this);
}
@basham
basham / nodejs-rfid.js
Last active July 17, 2023 04:06
Use NodeJS to read RFID ids through the USB serial stream.
/*
DESCRIPTION
-----------
Use NodeJS to read RFID ids through the USB serial stream. Code derived from this forum:
http://groups.google.com/group/nodejs/browse_thread/thread/e2b071b6a70a6eb1/086ec7fcb5036699
CODE REPOSITORY
---------------
https://gist.github.com/806605
@basham
basham / css-units-best-practices.md
Last active April 18, 2024 16:44
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units