See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
// Customisable spacing units. these can be changed and new ones added | |
$spacing-units: ( | |
1: 3px, | |
2: 5px, | |
3: 8px, | |
4: 13px, | |
5: 21px, | |
); | |
// These will not change this is just to help generate the classes with the correct naming |
--- | |
<a id="sources"></a> | |
## Markdown sources | |
**From this point, everything you see is formatted using Markdown syntax.** It will work in every editor that supports Markdown because it's an open standard on the web. There are two ways to find the sources for this page. | |
#### 1. On GitHub |
// https://twitter.com/wesbos/status/1063515277911052290/photo/1 | |
async function soFetch(input, settings = {}) { | |
const response = await fetch(input, { | |
headers: { | |
Accept: 'application/json, text/plain, */*', | |
'Content-Type': 'application/json' | |
}, | |
...settings | |
}); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DOM Injection Performance Testing</title> | |
</head> | |
<body> | |
<div id="app1"></div> | |
<ul id="app2"></ul> |
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'] |
const PIE = 3.14; | |
function f() { | |
console.log('function f inside module a'); | |
} | |
function f123() { | |
//not accessible | |
} |
In HTML5, aside
is only "related to the content around the aside element".
In HTML 5.1 (CR) the definition became more specific: aside
is "related to the content of the parenting sectioning content".
Following the newer definition, the aside element should be inside of the section element to which it is related.
body
header
// from https://twitter.com/Steve8708/status/1504131981444980739 | |
// simplified to a function body of 8 tidy lines | |
// no loop needed, no 2d array of 3-tuples needed | |
// just 2 arrays, a findIndex call, and some indexing :) | |
export function getRelativeTimeString( | |
date: Date | number, | |
lang = "en" | |
): string { | |
const timeMs = typeof date === "number" ? date : date.getTime(); |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Alpine Ajax test</title> | |
</head> | |
<body> | |
<h1>Users API Retrieval Test</h1> |