# CREDENTIAL.pem を使って ec2-user ユーザで xxx ホスト (ec2) の
# ~/path/to/src ファイルをローカルの ~/path/to/dist に落としてくる
$ scp -i "CREDENTIAL.pem" -r ec2-user@xxx.ap-northeast-1.compute.amazonaws.com:~/path/to/src ~/path/to/dist
- node 環境で csv write したいときのやつ
- nextjs (express) の response と組み合わせて streaming 返却で利用した
import type { NextApiRequest, NextApiResponse } from 'next'
$ npm i react-plotly.js plotly.js
$ npm i -D @types/react-plotly.js
import React from 'react'
$ npm i qrcode.react
import { QRCodeSVG } from 'qrcode.react'
$ npm i mathjs
import { mean } from 'mathjs'
- svg ファイルを react component として使えるやつ
- afterInjection から描画後の node 操作が可能
- src の svg ファイルから width, height を読み取って viewBox 指定までやってくれるので、中に svg やら html (foreign object) やら nest してやれば resize 時に全体がよき感じに縮尺される
$ npm i react-svg
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 Phaser from 'phaser' | |
import { ReactNode, useEffect, useRef, useState } from 'react' | |
import { createPortal } from 'react-dom' | |
const PHASER_CONFIG = { /* ... */ } | |
const WIDTH = 1920 / 2 | |
const HEIGHT = 1080 / 2 | |
const LEFT = (screen.width - WIDTH) / 2 | |
const TOP = (screen.height - HEIGHT) / 2 |
- react で open window するやつ
- createPortal を使っているらしい
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
/** | |
* @link https://parashuto.com/rriver/development/img-size-attributes-are-back | |
*/ | |
import { Image } from '@chakra-ui/react' | |
export const myComponent = () => ( | |
// chakra image には元々 max-width: 100%; height: auto があたってる | |
<Image | |
src={'/some-large-image.png'} |
NewerOlder