This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub, sup { | |
/* Specified in % so that the sup/sup is the | |
right size relative to the surrounding text */ | |
font-size: 75%; | |
/* Zero out the line-height so that it doesn't | |
interfere with the positioning that follows */ | |
line-height: 0; | |
/* Where the magic happens: makes all browsers position |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Option 1 | |
let var1, var2, var3; | |
if (someCondition) { | |
var1 = 'value1'; | |
var2 = 'value2'; | |
var3 = 'value3'; | |
} else { | |
var1 = "other1"; | |
var2 = "other2"; | |
var3 = "other3"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useState, useRef } from 'react'; | |
// Can't use React State because setting the constant to a function will execute that function in `useState` | |
// const useConstant = value => useState(value)[0]; | |
const useConstant = value => useRef(value).current; | |
const myConst = useConstant('foo'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// POST INTERVIEW VERSION | |
// NOTE Rado, Yi: I took the code where I left off and got it working in this second Gist file. It's probably not | |
// the most elegant solution, but it works. The code as of the end of the interview is in the other Gist. | |
// Given a binary tree, how would you serialize it into a string? | |
//Example input | |
var input = { | |
value: "a", | |
left: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { isEqual } = require('lodash'); | |
const { bold, yellow, red, green } = require('chalk'); | |
/** | |
* List of test outcomes | |
* @type {[('PASS' | 'FAIL'), string][]} | |
*/ | |
const outcomes = []; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const prop = key => obj => obj[key]; | |
// Action Types | |
const MY_ACTION = '{my}-app/{module}/MY_ACTION'; | |
// Action Creators | |
export const myAction = (value) => ({ | |
type: MY_ACTION, | |
payload: value, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>a11y for HTML</title> | |
<style> | |
/** | |
* Visually hide an element, but leave it available for screen readers | |
* @link https://github.com/h5bp/html5-boilerplate/blob/master/dist/css/main.css | |
* @link http://snook.ca/archives/html_and_css/hiding-content-for-accessibility |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "simple-model", | |
"version": "1.0.0", | |
"main": "index.js", | |
"license": "MIT", | |
"dependencies": {}, | |
"scripts": { | |
"start": "watch 'yarn run test' src", | |
"test": "tape -r esm src/*.test.js" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const builtInErrorTypes = [ | |
Error, | |
EvalError, | |
RangeError, | |
ReferenceError, | |
SyntaxError, | |
TypeError, | |
URIError, | |
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Shrug ¯\_(ツ)_/¯ | |
Googley shrug ¯\(º_o)/¯ | |
Flip all tables ┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻ | |
Reset table ┬─┬ ノ( ゜-゜ノ) | |
Cthulhu /|\(;,;)/|\ |