Skip to content

Instantly share code, notes, and snippets.

View robatwilliams's full-sized avatar

Robat Williams robatwilliams

View GitHub Profile
@sh1989
sh1989 / typescript-safe-react-props.md
Last active October 20, 2019 21:33
TypeScript safe React props and default props merge

Given an interface definition for a property:

interface MyProps {
  foo: string,
  bar: string
}

And a partial declaring some default props

@addyosmani
addyosmani / README.md
Last active April 2, 2024 20:18 — forked from 140bytes/LICENSE.txt
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@hyle
hyle / ko.utils.2.3.0.signatures.js
Last active September 25, 2018 09:11
KnockoutJS 2.3.0 utils (ko.utils) signatures
// knockout 2.3.0
ko.utils.addOrRemoveItem = function (array, value, included) { /* .. */ }
ko.utils.anyDomNodeIsAttachedToDocument = function (nodes) { /* .. */ }
ko.utils.arrayFilter = function (array, predicate) { /* .. */ }
ko.utils.arrayFirst = function (array, predicate, predicateOwner) { /* .. */ }