Skip to content

Instantly share code, notes, and snippets.

View kenmori's full-sized avatar

KenjiMorita kenmori

View GitHub Profile
@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 / keybordsetting.json
Created October 5, 2019 00:38
keybordsetting.json
[
// サジェストの移動、確定
{
"key": "ctrl+k",
"command": "acceptSelectedSuggestion"
},
{
"key": "ctrl+n",
"command": "selectNextSuggestion",
@kenmori
kenmori / gist:33114b639db7c02fed92442a9037e780
Last active September 26, 2019 07:03
Attempted import error: 'ReactReduxContext' is not exported from 'react-redux'.

Attempted import error: 'ReactReduxContext' is not exported from 'react-redux'.

To fix

@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 / AWS認定ソリューションアーキテクト までの道1.md
Last active September 22, 2019 09:08
AWS認定ソリューションアーキテクト までの道1

AWS認定ソリューションアーキテクト までの道1

index

  • インスタンス生成(EC2インスタンスを作ってpemファイルをダウンロード、その後それをつかってsshする)
  • AWSを使う際に一番最初に対応すべきこと

EC2インスタンスを作ってpemファイルをダウンロード、その後それをつかってsshする

@kenmori
kenmori / test_with_Jest_fails_with_Could_not_locate_module_xxx.md
Last active September 20, 2019 11:33
test with Jest fails with `Could not locate module @/xxx`

Suppose you add async to componentDidmount and start a snapshot test

-  public componentDidMount() {
+  public async componentDidMount() {
     const { setup } = this.props;
     setup();
   }
@kenmori
kenmori / Definition_for_rule_typescript-eslint_no-object-literal-type-assertion_was_not_found_typescript-eslint_eslint-plugin_no-object-literal-type-assertion.md
Last active September 20, 2019 01:47
Definition for rule '@typescript-eslint/no-object-literal-type-assertion' was not found @typescript-eslint/eslint-plugin/no-object-literal-type-assertion

Definition for rule '@typescript-eslint/no-object-literal-type-assertion' was not found @typescript-eslint/eslint-plugin/no-object-literal-type-assertion

1. Update @typescript-eslint/eslint-plugin-tslint,@typescript-eslint/eslint-plugin, @typescript-eslint/parser

-    "@typescript-eslint/eslint-plugin-tslint": "^2.0.0",
-    "@typescript-eslint/eslint-plugin": "^2.0.0",
-    "@typescript-eslint/parser": "^2.0.0",
+    "@typescript-eslint/eslint-plugin": "^2.3.0",
+ "@typescript-eslint/eslint-plugin-tslint": "^2.3.0",
@kenmori
kenmori / saga-effect select return undefined redux-saga.md
Last active September 18, 2019 05:19
[TypeScript] saga-effect select return undefined redux-saga 1.0.0

[TypeScript3.6.3] saga-effect select return undefined redux-saga 1.0.0

If the return type of saga select becomes undefined when you upgrade to TypeScript 3.6.3

const editingEntry: EditingEntry = yield select(editingEntrySelector); // type is undefined. not EditingEntry
const entry = validateEntry(editingEntry); // compile error.  
@kenmori
kenmori / 【Golang初心者が理解する】channelチャネル.md
Last active September 16, 2019 06:03
【Golang初心者が理解するための】channelチャネル

【Golang初心者の自分が理解する】channel(チャネル)

初心者の自分が最初に「ん??」となったchannelを自分自身理解するために順を追って書いていく

全てのソースコードにはこちらが読み込まれているとする

package main

import (
@kenmori
kenmori / Golang_basic_syntax_training.md
Last active September 14, 2019 00:26
Golang初心者の為の基本構文練習帳(Golang basic syntax training)

WIP

Golang初心者の為の構文練習帳(Golang basic syntax training)

シュールさんという男性がGoのキャラクターを抱きながら指をさしてどこかに向かっている様子。Goと掛けている

This is a practice book for myself, a front-end engineer, who decided to golang 3 seconds ago, seriously trying to learn server-side languages

フロントエンドエンジニアのが本気でサーバーサイド言語の習得を目指し、3秒前にGolangにすることに決めて作った自分の為の練習帳です