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
function checkGameIndex (checkedIndexesCache, list, index) { | |
const offset = list[index]; | |
const is0 = list[index] === 0; | |
const is0ToLeft = list[index - offset] === 0; | |
const is0ToRight = list[index + offset] === 0; | |
if (is0 || is0ToLeft || is0ToRight) { | |
return true; | |
} |
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
/** @jsxImportSource @emotion/react */ | |
import { jsx } from '@emotion/react'; | |
import { ReactElement, useState, useEffect } from 'react'; | |
import { Animator, AnimatorGeneralProvider } from '@arwes/animator'; | |
import { Animated } from '@arwes/animated'; | |
const AnimatedItem = (props: { color: string }): ReactElement => { | |
return ( | |
<Animated |
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 { isBrowser } from './browser'; | |
type TOSchedulerId = number | string; | |
type TOSchedulerCallback = () => unknown; | |
const timeoutTask = (delay: number, callback: TOSchedulerCallback): () => void => { | |
const scheduleId = setTimeout(() => callback(), delay); | |
return () => clearTimeout(scheduleId); | |
}; |
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 React, { useEffect, useState } from 'react'; | |
import { render } from 'react-dom'; | |
const ProductionProfiler = ({ children }) => { | |
const [mount, setMount] = useState(false); | |
useEffect(() => { | |
if (!mount) { | |
console.time('profile'); | |
setMount(true); | |
} |
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 { isBrowser } from './browser'; | |
type RAFSchedulerId = number | string; | |
type RAFSchedulerCallback = () => unknown; | |
// TODO: How to handle suspended schedules on suspended window? | |
const raf = (delay: number, callback: RAFSchedulerCallback): () => void => { | |
let scheduleId: number | undefined; |
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 React, { useState, useEffect } from 'react'; | |
import { render, act, cleanup } from '@testing-library/react'; | |
import { EXITED, EXITING, ENTERED, ENTERING } from '../constants'; | |
import { useAnimator } from '../useAnimator'; | |
import { Component as Animator } from './Animator.component'; | |
jest.useFakeTimers(); | |
afterEach(cleanup); |
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 isLength from 'validator/lib/isLength'; | |
import isEmail from 'validator/lib/isEmail'; | |
import isInt from 'validator/lib/isInt'; | |
import isFloat from 'validator/lib/isFloat'; | |
import matches from 'validator/lib/matches'; | |
const required = value => !!value; | |
const isLengthMin = (value, min) => isLength(value, { min }); | |
const isLengthMax = (value, max) => isLength(value, { max }); |
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
# backup | |
mongodump --db=mydb --archive=./backups/mydb.mongodump --authenticationDatabase=mydb -u username -p | |
# restore | |
mongorestore --drop --archive=./backups/mydb.mongodump --authenticationDatabase=mydb -u username -p | |
# export | |
mongoexport --db mydb --collection users --out ./test/fixtures/users.json --pretty --jsonArray | |
# import |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title>Kuwy</title> | |
<link rel="stylesheet" href="./kuwy.css"> | |
<style> | |
body { margin: 20px; font-family: sans-serif; } |
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
# Your keymap | |
# | |
# Atom keymaps work similarly to style sheets. Just as style sheets use | |
# selectors to apply styles to elements, Atom keymaps use selectors to associate | |
# keystrokes with events in specific contexts. Unlike style sheets however, | |
# each selector can only be declared once. | |
# | |
# You can create a new keybinding in this file by typing "key" and then hitting | |
# tab. | |
# |
NewerOlder