Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
Howdy!

Zaydek zaydek

🤠
Howdy!
View GitHub Profile
@zaydek
zaydek / useReducer.js
Last active Jan 20, 2020
useReducer with the same API as useMethods https://github.com/pelotom/use-methods
View useReducer.js
import random from "utils/random/id"
import React from "react"
const initialState = {
todo: "",
todos: null,
}
function init(initialState) {
const imperative = { ...initialState }
View PerfTimer.js
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,
View gist:b2e90d937fd605eb7e93ecd153c56af5
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 Feb 2, 2020
All Unicode 12.1 emojis in JSON form
View unicode_emoji_12_1.js
// 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 = [
View output.txt
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))
View Stylesheet.js
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);
}
View help.css
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}}
View TypeError
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)
View material-design-tailwind.js
// 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" },
View flexbox.css
.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; }
You can’t perform that action at this time.