Skip to content

Instantly share code, notes, and snippets.

View kenmori's full-sized avatar
Working from home

KenjiMorita kenmori

Working from home
View GitHub Profile
kenmori / viteがなぜESBuildとrollupを使うのか等.md
Last active February 23, 2023 12:12
View viteがなぜESBuildとrollupを使うのか等.md




viteはdev build時にESBuildを使っている

viteはproduction build時にrollupを使っている

kenmori / typed DnDDroppable, DnDDraggable DnDDragDropContext, hack by
Last active February 7, 2023 12:39
typed DnDDroppable, DnDDraggable DnDDragDropContext, hack by styled-components
View typed DnDDroppable, DnDDraggable DnDDragDropContext, hack by

TypeScript x DnD.Droppable x DnD.Draggable x DnD.DragDropContext, hack by styled-components

If you get a type error from react-beautiful-dnd and have to fix it when you raise it to React18, you can solve it by wrapping it in styled-components and typedefing it.

const LibButton = styled(Lib.Button)<{children: React.ReactNode}>''

const DnDDroppable = styled(DnD.Droppable)<{children: (provided: DnD.Droppable Provided, snapshot:DnD.DroppableStateSnapshot) => React.ReactElement<HTMLElement, string | React.JSXElementConstructor<any>>}>''

const DnDDraggable = styled(DnD.Draggable)&lt;{index: number, draggableld: string, children: (provided: DnD.DraggableProvided, snapshot: DnD.DraggableStateSnapshot) =&gt; React. ReactElement&gt;}&gt;''
kenmori / 基調講演をする技術.md
Last active November 20, 2022 01:25
View 基調講演をする技術.md
kenmori / Least Common
Last active August 22, 2022 14:25
Least Common Multiple
View Least Common
  • 最小公倍数(lcm)は二つの数を掛けて最大公約数(gcd)で割る
// 最小公倍数
let lcm = function () {
  let args = [...arguments]
  if(args.length === 0) return 1
  if(args.filter(e => e !== 0).length === 0) return 0
  return args.reduce((a, c, i) => {
 return (a * c) / gcd(a, c)
kenmori /
Last active November 19, 2021 13:04
[解決] react-router-dom v5 to v6 移行に伴いやること
kenmori /
Last active August 1, 2021 14:21


import { add, addString, toNumber, filterOrange } from "./index";

it('adds 1 + 2 to equal 3', () => {
  expect(add(1, 2)).toBe(3);
View gist:7b96d6336e3069a19141db0c415a29e5
"use strict";

const modal = document.getElementById("js-modal");
const modalWrapper = document.getElementById("js-modalWrapper");
const checkbox = document.getElementById("js-checkbox");
const closeButton = document.getElementById("js-close");

const form = document.getElementById("js-form");
const term = document.getElementById("js-term");
kenmori /
Created May 30, 2021 01:59
kenmori / Win-nvm-md
Created May 30, 2021 01:59
View Win-nvm-md
# Windows 10 Fall Creators Update - Installing Node.js on Windows Subsystem for Linux (WSL)
Windows just released the [windows subsystem for linux]( feature to the public with its latest windows fall creator update, if you are not familiar with this feature it allows you to run linux binaries natively on windows - [F.A.Q](
## Enabling WSL
The feature is not enabled by default and you need to activate it, you can do it via powershell (with admin rights):