These examples are not completely compatible about whether to call next(action)
.
function incrementAsync() {
# 私が考える安全なプログラムを書くために必要なこと | |
今も昔も「入力によって挙動が大幅に変わるAPI」が世の中には多数存在していて、プログラマが本来意図した挙動と異なる動作を引き起こしている。 | |
- ファイルを開こうとしたらコマンドを実行できてしまったり | |
- CSSセレクタを書いてるつもりがHTMLタグを生成してしまったり | |
- SELECT文を発行するつもりがDELETE文を発行できてしまったり | |
こういったときに | |
- 入力値検証をしないと危険になる |
start_server --status-file=/path/to/app/log/start_server.stat \ | |
--port=10080 --signal-on-hup=CONT --dir=/path/to/app -- \ | |
bundle exec --keep-file-descriptors unicorn -c config/unicorn.conf.rb config.ru |
# Homebrew のインストール | |
# 公式 (http://brew.sh/) に載っているコマンドです | |
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Ruby のビルドに必要なものをインストール | |
brew install openssl readline rbenv ruby-build # 時間がかかります | |
# rbenv 用の設定を .bash_profile に書き込む | |
echo 'export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-readline-dir=$(brew --prefix readline) $RUBY_CONFIGURE_OPTS"' >> ~/.bash_profile | |
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile |
// Explicit in-out of side-effect actions. | |
function epic(action$, store) { | |
const fooReq$ = action$.ofType('FOO') | |
.map(action => call('FOO_REQ', webapi.getFoo, action.payload.id)); | |
const foo$ = action$.ofType('FOO_REQ') | |
.map(foo => ({ type: 'FOO_FETCHED', payload: { foo } })); | |
return Observable.merge( | |
fooReq$, | |
foo$ |
function* relay(request, relayChannel, nextChannel) { | |
const result = yield call(request) | |
yield put(relayChannel, [result, nextChannel]) | |
} | |
function* runSequencially(requestChannel, resultChannel) { | |
let head = channel() | |
let tail = head | |
while (true) { | |
const { request, relayResult } = yield race({ |
'use strict' | |
import pluralize from 'pluralize' | |
import ApiRequest from 'lib/ApiRequest' | |
import { SubmissionError } from 'redux-form' | |
const ADD_API_RESOURCE = '@api/ADD_RESOURCE' | |
const REMOVE_API_RESOURCE = '@api/REMOVE_RESOURCE' |
These examples are not completely compatible about whether to call next(action)
.
function incrementAsync() {
// for文内のcontinueはNG | |
const abc = (arg: (string | number)[]) => { | |
for (let i=0;i<arg.length;i++) { | |
if (typeof arg[i] === 'string') continue; | |
const abc: number = arg[i]; | |
} | |
} | |
// if文のearly returnはOK | |
const abc2 = (arg: (string | number)[]) => { |
https://gist.github.com/azu/d5e92de127f76545ffc2 の続き
index.js
をおき、そこにコンポーネントを定義するコンポーネントの分類(TODO: 気に入ってない)
Thanks for all the stars.
Due to unexpected demand, I move this to a proper github repo, see here: https://github.com/chroth7/reactD3resources
I would very much like to get your PRs there, thank you!