転職しました。長らくのご愛顧誠にありがとうございました。
転職先をちょくちょく探しています。
興味ある方は twitter @mizchi へのリプライorDM、または [email protected] まで。
転職しました。長らくのご愛顧誠にありがとうございました。
転職先をちょくちょく探しています。
興味ある方は twitter @mizchi へのリプライorDM、または [email protected] まで。
React Function Component で副作用(状態、ライフサイクル)を表現する
All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.
A number of methods in React are assumed to be "pure".
On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.
| // Usage: | |
| // <div> | |
| // <GlobalKeyListner keyCode={13} handler={() => console.log('Enter')}/> | |
| // </div> | |
| export default class GlobalKeyListner extends React.Component { | |
| type = 'keydown' | |
| componentDidMount() { | |
| const keyCode = this.props.keyCode | |
| this._bound = (ev: SyntheticEvent) => { | |
| if (ev.keyCode === keyCode) { |
| # Description: | |
| # 巻雲がしゃべるだけのbot | |
| # | |
| # Commands: | |
| # hubot | |
| Cron = require('cron').CronJob | |
| JIHOU_MESSAGES = [ | |
| "零時、深夜零時ですよぉ?" |
| http{ | |
| index index.html; | |
| server { | |
| listen 80; | |
| root /gocode/src/personalwebsiteapp; | |
| server_name personal-website.com; |
| from fabric.api import env, run, sudo, local, put | |
| def production(): | |
| """Defines production environment""" | |
| env.user = "deploy" | |
| env.hosts = ['example.com',] | |
| env.base_dir = "/var/www" | |
| env.app_name = "app" | |
| env.domain_name = "app.example.com" | |
| env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name } |