Skip to content

Instantly share code, notes, and snippets.

View zaydek's full-sized avatar
🤠
Howdy!

Zaydek MG zaydek

🤠
Howdy!
View GitHub Profile
@zaydek
zaydek / useReducer.js
Last active January 20, 2020 16:40
useReducer with the same API as useMethods https://github.com/pelotom/use-methods
import random from "utils/random/id"
import React from "react"
const initialState = {
todo: "",
todos: null,
}
function init(initialState) {
const imperative = { ...initialState }
import invariant from "invariant"
// A `PerfTimer` represents a performance timer, measured in
// milliseconds as per `Date.now()`.
class PerfTimer {
constructor() {
Object.assign(this, {
_state: {
t1: 0,
t2: 0,
Peace is a lie, there is only passion.
Through passion, I gain strength.
Through strength, I gain power.
Through power, I gain victory.
Through victory, my chains are broken.
The Force shall free me.
@zaydek
zaydek / unicode_emoji_12_1.js
Last active February 2, 2020 16:40
All Unicode 12.1 emojis in JSON form
// https://unicode.org/Public/emoji/12.1/emoji-test.txt
//
// {
// codePoints: [<Number>],
// status: <String>, // component | fully-qualified | minimally-qualified | unqualified
// emoji: <String>,
// description: <String>,
// }
//
const unicode_emoji_12_1 = [
FAIL src/components/Editor/__tests/playwright.test.js (8.955s)
✕ (7056ms)
Evaluation failed: {}
12 | await page.focus("[contenteditable]")
13 | // https://github.com/puppeteer/puppeteer/issues/1313
> 14 | await page.evaluate(() => document.execCommand("selectall", false, null))
import Context from "./Context"
import React from "react"
const TextBackgroundStylesheet = props => (
<style>{
`
.prefers-text-background .em,
.prefers-text-background .strong {
background: hsla(var(--blue-a400), 0.05);
}
This file has been truncated, but you can view the full file.
#marketing-editor{-webkit-transform:perspective(1000px) rotate(2deg) rotateX(6deg) rotateY(-4deg) scale(.95);transform:perspective(1000px) rotate(2deg) rotateX(6deg) rotateY(-4deg) scale(.95);-webkit-transition:-webkit-transform .5s ease-in-out;transition:-webkit-transform .5s ease-in-out;transition:transform .5s ease-in-out;transition:transform .5s ease-in-out,-webkit-transform .5s ease-in-out}@media (max-width:1023px){#marketing-editor{-webkit-transform:none;transform:none}}
/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at validateString (internal/validators.js:118:11)
at Object.join (path.js:1039:7)
at noopServiceWorkerMiddleware (/Users/zaydek/github/codex-app/node_modules/react-dev-utils/noopServiceWorkerMiddleware.js:14:26)
at Layer.handle [as handle_request] (/Users/zaydek/github/codex-app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:317:13)
at /Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:284:7
at Function.process_params (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:335:12)
at next (/Users/zaydek/github/codex-app/node_modules/express/lib/router/index.js:275:10)
at launchEditorMiddleware (/Users/zaydek/github/codex-app/node_modules/react-dev-utils/errorOverlayMiddleware.js:20:7)
// https://material.io/design/color/the-color-system.html#tools-for-picking-colors
const colors = {
"md-red-50": { default: "#ffebee" },
"md-red-100": { default: "#ffcdd2" },
"md-red-200": { default: "#ef9a9a" },
"md-red-300": { default: "#e57373" },
"md-red-400": { default: "#ef5350" },
"md-red-500": { default: "#f44336" },
"md-red-600": { default: "#e53935" },
"md-red-700": { default: "#d32f2f" },
.flex.-r { flex-direction: row; }
.flex.-c { flex-direction: column; }
.flex.-r.\:stretch, .flex.-c.\:stretch { justify-content: stretch; align-items: stretch; }
.flex.-r.\:start, .flex.-c.\:start { justify-content: flex-start; align-items: flex-start; }
.flex.-r.\:center, .flex.-c.\:center { justify-content: center; align-items: center; }
.flex.-r.\:end, .flex.-c.\:end { justify-content: flex-end; align-items: flex-end; }
.flex.-r.\:between, .flex.-c.\:between { justify-content: space-between; align-items: space-between; }
.flex.-r.\:around, .flex.-c.\:around { justify-content: space-around; align-items: space-around; }
.flex.-r.\:evenly, .flex.-c.\:evenly { justify-content: space-evenly; align-items: space-evenly; }