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 * as React from 'react'; | |
import * as ReactDOM from 'react-dom'; | |
interface p { | |
name: string; | |
} | |
class Hello extends React.Component<p> { | |
render() { | |
return <div>Hello, {this.props.name}</div> |
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, { Component } from 'react'; | |
export default class App extends Component { | |
handleKeyEnter = (e) => { | |
if(e.key === 'Enter') { | |
alert('enter') | |
} | |
} | |
handleKeySpace = (e) => { |
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
const canvas = document.getElementById('canvas') | |
const ctx = canvas.getContext('2d') | |
/* | |
ctx.fillStyle = "green"; | |
ctx.fillRect(10, 10, 100, 100); | |
*/ | |
const painting = document.getElementById('paint') | |
const paint_style = getComputedStyle(painting) | |
canvas.width = parseInt(paint_style.getPropertyValue('width')) |
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, { Component } from 'react'; | |
import {CopyToClipboard} from 'react-copy-to-clipboard'; | |
import './App.css'; | |
export default class App extends Component { | |
state = { | |
value: '', | |
copied: false | |
} |
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
class CanvasComponent extends React.Component { | |
componentDidMount() { | |
this.updateCanvas(); | |
} | |
updateCanvas() { | |
const ctx = this.refs.canvas.getContext('2d'); | |
ctx.fillRect(0,0, 100, 100); | |
} | |
render() { | |
return ( |
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
# author kamimura | |
# blog https://code-log.net | |
# twitter https://twitter.com/kamimura_dev | |
#エラーページのnginxとバージョンを隠す | |
server_tokens off; | |
#インデックスページを非表示(デフォルトでoff) | |
autoindex off; |
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
const webpack = require('webpack'); | |
const path = require('path'); | |
module.exports = { | |
mode: 'development', | |
entry: './src/index.tsx', | |
output: { | |
path: path.resolve(__dirname, 'dist'), | |
filename: 'bundle.js' | |
} |
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
{ | |
"printWidth": 89, | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": false, | |
"singleQuote": true, | |
"trailingComma": "all", | |
"bracketSpacing": true, | |
"jsxBracketSameLine": false | |
} |
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
Show hidden characters
{ | |
"compilerOptions": { | |
"outDir": "./dist/", | |
"sourceMap": true, | |
"noImplicitAny": true, | |
"module": "commonjs", | |
"target": "es6", | |
"jsx": "react" | |
}, | |
"include": [ |
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 firebase from 'firebase/app'; | |
require('dotenv').config() | |
const Config = { | |
API_KEY: process.env.API_KEY, | |
AUTH_DOMAIN: process.env.AUTH_DOMAIN, | |
DATABASE_URL: process.env.DATABASE_URL, | |
PROJECT_ID: process.env.PROJECT_ID, | |
STORAGE_BUCKET: process.env.STORAGE_BUCKET, |
OlderNewer