Skip to content

Instantly share code, notes, and snippets.

@williamyeny
williamyeny / wait-for-element.ts
Created December 14, 2022 00:02
Writen for a Chrome extension. It checks for a specific element on the page and calls a callback when it's found.
// Writen for a Chrome extension. It checks for a specific element on the page and calls a callback when it's found.
// Returns an element and all its child elements.
const getAllElements = (node: Node): Element[] => {
if (!(node instanceof Element)) {
return [];
}
const nodes = [node];
if (node.childNodes) {
nodes.push(...[...node.childNodes].flatMap(getAllElements));

This is a truncated mirror of the "Interviewing at Amazon — Leadership Principles" article for those who want to avoid putting in their email to view the article.

Interviewing at Amazon — Leadership Principles

Understanding the Leadership Principles

When I have friends or relatives (or friends of friends, or friends of friends of relatives) ask how to prepare for an interview, I always suggest they read the description of the Amazon Leadership Principles, and think hard about each of them. More than any company I’ve worked with or heard about, we use those principles on a daily basis.

We obviously hire based on the principles. We give both positive and negative feedback which reference the principles. We are encouraged to be aware of our own successes and failures in relation to the leadership principles. I know I’ve certainly referenced a leadership principle or two while talking about p

{"keyboard":"crkbd/rev1","keymap":"crkbd","layout":"LAYOUT","layers":[["KC_ESC","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSLS","LCTL_T(KC_TAB)","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","MO(2)","KC_LALT","MO(1)","KC_SPC","KC_BSPC","KC_ENT","KC_LGUI"],["KC_MINS","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_TILD","KC_GRV","KC_EQL","KC_UNDS","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_PLUS","KC_HOME","KC_LEFT","KC_DOWN","KC_UP","KC_RGHT","KC_END","KC_LPRN","KC_RPRN","KC_LBRC","KC_RBRC","KC_LCBR","KC_RCBR","KC_LALT","KC_NO","KC_SPC","KC_DEL","KC_ENT","KC_LGUI"],["KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_F12","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_NO","KC_NO","KC_MPRV","KC_MPLY",
{"keyboard":"keebio/iris/rev2","keymap":"keebio_iris_rev2_default","layout":"LAYOUT","layers":[["KC_ESC","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_GRV","KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_BSLS","KC_LCTL","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SCLN","KC_QUOT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_MINS","KC_EQL","KC_N","KC_M","KC_COMM","KC_DOT","KC_SLSH","MO(2)","KC_LALT","MO(1)","KC_SPC","KC_BSPC","KC_ENT","KC_LGUI"],["KC_F12","KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_MRWD","KC_MPLY","KC_MFFD","KC_LCBR","KC_RCBR","KC_NO","KC_NO","KC_MINS","KC_EQL","KC_NO","KC_NO","KC_NO","KC_MUTE","KC_VOLD","KC_VOLU","KC_LPRN","KC_RPRN","KC_NO","KC_LEFT","KC_DOWN","KC_UP","KC_RGHT","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_LBRC","KC_RBRC","KC_NO","KC_HOME","KC_END","KC_NO","KC_UNDS","KC_PLUS","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_NO","KC_DEL","KC_NO"
{"keyboard":"contra","keymap":"willye","layout":"LAYOUT_ortho_4x12","layers":[["KC_TAB","KC_Q","KC_W","KC_E","KC_R","KC_T","KC_Y","KC_U","KC_I","KC_O","KC_P","KC_DEL","KC_ESC","KC_A","KC_S","KC_D","KC_F","KC_G","KC_H","KC_J","KC_K","KC_L","KC_SLSH","KC_ENT","KC_LSFT","KC_Z","KC_X","KC_C","KC_V","KC_B","KC_N","KC_M","KC_COMM","KC_DOT","KC_SCLN","KC_QUOT","KC_LCTL","KC_NO","KC_LGUI","KC_LALT","MO(1)","KC_SPC","KC_BSPC","MO(2)","KC_LEFT","KC_DOWN","KC_UP","KC_RGHT"],["KC_F1","KC_F2","KC_F3","KC_F4","KC_F5","KC_F6","KC_F7","KC_F8","KC_F9","KC_F10","KC_F11","KC_F12","KC_1","KC_2","KC_3","KC_4","KC_5","KC_6","KC_7","KC_8","KC_9","KC_0","KC_MINS","KC_EQL","KC_EXLM","KC_AT","KC_HASH","KC_DLR","KC_PERC","KC_CIRC","KC_AMPR","KC_ASTR","KC_LPRN","KC_RPRN","KC_UNDS","KC_PLUS","KC_NO","KC_NO","KC_NO","KC_NO","KC_TRNS","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO"],["KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_NO","KC_LBRC","KC_RBRC","KC_LCBR","KC_RCBR","KC_LP