Skip to content

Instantly share code, notes, and snippets.

@brandonweis
brandonweis / reset.css
Created June 21, 2022 20:52 — forked from EllyLoel/reset.css
CSS Reset
/*
Made by Elly Loel - https://ellyloel.com/
With inspiration from:
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/
- Adam Argyle - https://unpkg.com/open-props@1.3.16/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE
Notes:
- `:where()` is used to lower specificity for easy overriding.
*/
const error_handler = (property) => {
throw new Error(`Error: ${property} is required!`);
}
const monitor_roads = (car=error_handler('Car'), speed=error_handler('Speed')) => {
console.log(`Your ${car} was going at a speed of ${speed}mph.`);
}
monitor_roads('Ferrari', 240); // Your Ferrari was going at a speed of 240mph.
monitor_roads('Ferrari'); // Error: Speed is required!
@brandonweis
brandonweis / 0_reuse_code.js
Created July 2, 2014 17:51
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console