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
kenmori / [Permission denied] fatal: cannot copy '_Library_Developer_CommandLineTools .md
Last active March 11, 2023 09:32
[Permission denied] fatal: cannot copy '/Library/Developer/CommandLineTools

When you install HomeBrew, the console might show you fllowing code

fatal: cannot copy '/Library/Developer/CommandLineTools/usr/share/git-core/templates/hooks/fsmonitor-watchman.sample' to '/usr/local/Homebrew/.git/hooks/fsmonitor-watchman.sample': Permission denied
Failed during: git init -q

You are not permit to copy that directory, so you have to give this directory permision

Run fllowing code as change it

@kenmori
kenmori / viteがなぜESBuildとrollupを使うのか等.md
Last active February 23, 2023 12:12
viteがなぜESBuildとrollupを使うのか等.md

viteがなぜESBuildとrollupを使うのか等.md

※この記事はWIPです。また単なる調査した結果なのでこれをきっかけにご自身で調査することをお勧めします

rollupとviteの関係をまとめる

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

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

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

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
kenmori / PostgreSQLをすぐに始めたい人の環境構築手順方法 on Mac.md
Last active February 3, 2023 06:28
PostgreSQLをすぐに始めたい人の環境構築手順方法 on Mac(Getting start for those who want to start PostgreSQL immediately)

PostgreSQLをすぐに始めたい人の環境構築手順方法 on Mac (Getting start for those who want to start PostgreSQL immediately)

わかりみSQL

  • install Docker App for Descktop
  • start Docker
  • hit command below
@kenmori
kenmori / Function to generate and download PDF as it is by converting components into images once with react.md
Last active January 23, 2023 10:33
Function to generate and download PDF as it is by converting components into images once with react

Function to generate and download PDF as it is by converting components into images once with react

Overview

  • reactでコンポーネントを一回画像にしてそのままPDF生成してダウンロードする機能
  • react-pdfは使わない
  • コンポーネントを画像にしてその画像をpdfとして出力する方法

@kenmori
kenmori / 基調講演をする技術.md
Last active November 20, 2022 01:25
基調講演をする技術

基調講演をする技術

この記事の著者

株式会社TerraceTech 森田賢二

この記事の目的

先日基調講演をした経験から本番に向けてどのように考えていたか、行動していたか、メンタル面の管理はどうしていたか、等、次にはさらに良くなるように記録しておく

@kenmori
kenmori / rust_practice.md
Last active September 24, 2022 04:24
【WIP】Rust練習問題集(Rust practice questions)

【WIP】Rust練習問題集(Rust practice questions)

Author

読み進めるにあたって

- 問題文はfn main{}の中のコンテキストとする
@kenmori
kenmori / Least Common Multiple.md
Last active August 22, 2022 14:25
Least Common Multiple
  • 最小公倍数(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
kenmori / iTerm2setting_to_VSCodeTerminal.md
Last active June 13, 2022 07:40
How to set VSCodeTerminal as same ITerm2

When you lanch terminal on VSCode. you would want the terminal to initialize as same iTerm2.

here is how to set on the setting.json at VSCode.

see your current setting on iTerm

you can see command and send text at start on iTerm2 -> Prefernance -> Profile

@kenmori
kenmori / An Effect function must not return anything besides a function.md
Last active June 12, 2022 05:09
An Effect function must not return anything besides a function

if you occure below cord

index.js:2178 Warning: An Effect function must not return anything besides a function, which is used for clean-up.

It looks like you wrote useEffect(async () => ...) or returned a Promise. Instead, you may write an async function separately and then call it from inside the effect:

async function fetchComment(commentId) {
  // You can await here
}