Skip to content

Instantly share code, notes, and snippets.

@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

@bvaughn
bvaughn / react-lifecycle-cheatsheet.md
Last active March 2, 2023 13:29
React lifecycle cheatsheet

React lifecycle cheatsheet

Method Side effects1 State updates2 Example uses
Mounting
componentWillMount Constructor equivalent for createClass
render Create and return element(s)
componentDidMount DOM manipulations, network requests, etc.
Updating
componentWillReceiveProps Update state based on changed props
@ezfe
ezfe / 1.18.2-arm64.json
Last active October 19, 2022 14:18
1.18.2 on Apple M1
{"id":"1.18.2-arm64","assets":"1.18","javaVersion":{"component":"java-runtime-beta","majorVersion":17},"time":"2022-04-28T02:59:52Z","downloads":{"clientMappings":{"url":"https:\/\/launcher.mojang.com\/v1\/objects\/a661c6a55a0600bd391bdbbd6827654c05b2109c\/client.txt","size":6716693,"sha1":"a661c6a55a0600bd391bdbbd6827654c05b2109c"},"client":{"url":"https:\/\/launcher.mojang.com\/v1\/objects\/2e9a3e3107cca00d6bc9c97bf7d149cae163ef21\/client.jar","size":20259661,"sha1":"2e9a3e3107cca00d6bc9c97bf7d149cae163ef21"},"server":{"url":"https:\/\/launcher.mojang.com\/v1\/objects\/c8f83c5655308435b3dcf03c06d9fe8740a77469\/server.jar","size":46592587,"sha1":"c8f83c5655308435b3dcf03c06d9fe8740a77469"},"serverMappings":{"url":"https:\/\/launcher.mojang.com\/v1\/objects\/e562f588fea155d96291267465dc3323bfe1551b\/server.txt","size":5212964,"sha1":"e562f588fea155d96291267465dc3323bfe1551b"}},"type":"release","libraries":[{"name":"com.mojang:logging:1.0.0","downloads":{"artifact":{"path":"com\/mojang\/logging\/1.0.0\/logging-
@developit
developit / purecomponent.js
Created April 25, 2017 11:43
PureComponent for preact
import { Component } from 'preact';
export default class PureComponent extends Component {
shouldComponentUpdate(props, state) {
return !(shallowEqual(props, this.props) && shallowEqual(state, this.state));
}
}
function shallowEqual(a, b) {
for (let key in a) if (a[key]!==b[key]) return false;
@eyecatchup
eyecatchup / material-design-breakpoints.css
Last active December 4, 2020 20:08
CSS media queries based on the breakpoint guidance published by the Material Design team. http://www.google.com/design/spec/layout/adaptive-ui.html#adaptive-ui-breakpoint
/* Material Design Adaptive Breakpoints */
/*
Below you'll find CSS media queries based on the breakpoint guidance
published by the Material Design team. You can choose to use, customise
or remove these breakpoints based on your needs.
http://www.google.com/design/spec/layout/adaptive-ui.html#adaptive-ui-breakpoints
*/
/* mobile-small */