use alias[key] = "!f() { 〈 command 〉 }; f"
to include complex commands
# .git/config
[alias]
log = log --oneline --graph
lgc = log -l HEAD --stats
caa = commit -a --amend -C HEAD
/** | |
* Defines a color scheme with a text color and a backdrop color. | |
* @type {Object} | |
* @property {string} textColor - The hexadecimal color value for the text. | |
* @property {string} backDropColor - The hexadecimal color value for the backdrop. | |
*/ | |
const COLOR_SCHEME = { | |
textColor: "#000", | |
backDropColor: "#fff", |
//? an easy to follow, abstracted approach | |
/** | |
* Compares first character of string against a character | |
* @param {string} reference | |
* @returns {(character: string) => boolean} | |
*/ | |
function startsWithCharacter(reference) { | |
return character => reference.startsWith( | |
character |
const EMPLOYEE_DATA = [ | |
{ | |
id: "001", | |
name: "Mario", | |
title: "Lead Plummer", | |
underlings: [ | |
{ | |
id: "002", | |
name: "Luigi", | |
title: "Plumbing Assistant", |
<!-- <noscript> --> | |
<input type="radio" id="nojs-dismiss" hidden aria-hidden="true" aria-controls="#nojs-memo" /> | |
<details id="nojs-memo"> | |
<summary> | |
<svg width="24" height="24" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14"> | |
<g stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"> | |
<path d="M7.89 1.0499a1 1 0 0 0-1.78 0l-5.5 11a1 1 0 0 0 .89 1.45h11a1 1 0 0 0 .4866-.1281.999.999 0 0 0 .5095-.83 1 1 0 0 0-.1061-.4919zM7 5v3.25" /> | |
<path d="M7 11a.25.25 0 1 1 0-.5m0 .5a.25.25 0 1 0 0-.5" /> | |
</g> | |
</svg> |
/** | |
* Just an example to showcase some conditional logic | |
* | |
* Nullish coalescing operator (??) | |
* - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing | |
* Nullish coalescing assignment (??=) | |
* - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_assignment | |
* Map object (new Map()) | |
* - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map | |
* Map.getter (Map.get()) |
/** EXAMPLE */ | |
//? start | |
//* legacy | |
var prefix = 'x' | |
var infix = 'y' | |
/** suffix argument */ | |
var affix = 'id="'; | |
affix += prefix + '-'; |
export const { info, log, warn, error, table } = console; | |
export function keys(src = {}) { | |
return Object.keys(src); | |
} | |
export function isArr(src = []) { | |
return Array.isArray(src); | |
} |
import { lazy } from "react"; | |
/** | |
* use dynamic "code-splitting" imports | |
* prevents all components from being bundled and loaded at runtime | |
* only serves what is being utilized at render | |
*/ | |
class DynamicComponent { | |
private _node = { |
/* reset */ | |
*:where(:not(iframe, canvas, img, svg, video):not(svg *, symbol *)) { | |
all: unset; | |
display: revert; | |
} | |
:where([hidden]) { | |
display: none; | |
} |