I hereby claim:
- I am exah on github.
- I am exah (https://keybase.io/exah) on keybase.
- I have a public key ASC_9SV4OWQ-PDFzWqiA5ALleoi73WU0vILNn4yJgvy9Dwo
To claim this, I am signing this object:
| import { useState } from "react"; | |
| const PLAYERS = ["O", "X"]; | |
| const NEXT_PLAYER = { | |
| [PLAYERS[0]]: PLAYERS[1], | |
| [PLAYERS[1]]: PLAYERS[0], | |
| }; | |
| function generateBoard(size) { | |
| return Array(Math.pow(size, 2)).fill(null); |
| import { mq } from '@revolut/ui-kit' | |
| import { size } from 'polished' | |
| import { css } from 'styled-components' | |
| const AVATAR_S = css` | |
| ${size(40)} | |
| font-size: 1.25rem; | |
| font-weight: 500; | |
| line-height: 1.2; |
| const FRACTION = 10n ** 2n | |
| const INPUT = 3333333n | |
| const WHOLE = INPUT / FRACTION | |
| const REMAINDER = INPUT % FRACTION | |
| const NUMBER = Number(`${WHOLE}.${REMAINDER}`) | |
| const FORMATTED = NUMBER.toLocaleString('en', { style: 'currency', currency: 'GBP' }) |
| const toISO = (date) => new Date( | |
| date.getUTCFullYear(), | |
| date.getUTCMonth(), | |
| date.getUTCDate(), | |
| date.getUTCHours(), | |
| date.getUTCMinutes(), | |
| date.getUTCSeconds(), | |
| ).toISOString().slice(0, -1) |
| # Base | |
| FROM node:8-alpine AS base | |
| ENV APP_DIR /app/ | |
| ENV NODE_ENV production | |
| WORKDIR $APP_DIR | |
| ADD package.json yarn.lock $APP_DIR | |
| RUN yarn | |
| CMD [] |
| .container { | |
| display: flex; | |
| justify-content: space-between; | |
| &::before { content: ''; } | |
| &::after { content: ''; } | |
| } | |
| .el { | |
| width: 100px; |
I hereby claim:
To claim this, I am signing this object:
| // Compact version | |
| const promisify = (fn, ...args) => new Promise((resolve, reject) => | |
| fn(...args, (error, result) => error && reject(error) || resolve(result)) | |
| ) | |
| // Example | |
| // function myAsyncFn(options = Object, callback = Function) {} | |
| // Like Promise | |
| promisify(myAsyncFn, { msg: 'test' }).then(result => console.log(result)) |
| // Based on https://davidwalsh.name/global-variables-javascript | |
| (function logGlobals() { | |
| var iframe = document.createElement('iframe'); | |
| iframe.onload = function() { | |
| var iframeKeys = Object.keys(iframe.contentWindow); | |
| var windowKeys = Object.keys(window); | |
| windowKeys.forEach(function(key) { | |
| if (iframeKeys.indexOf(key) === -1) { |
| import { bindActionCreators } from 'redux'; | |
| export default ( | |
| store, | |
| actions, | |
| stateKey = 'state', | |
| actionsKey = '$actions' | |
| ) => { | |
| const getFrozenState = () => Object.freeze( store.getState() ); |