#一応更新
$ brew update
#インストール
$ brew install mysql
#起動
$ mysql.server start
#接続できるか確認
$ mysql -u root
#とりあえず最低限の設定
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
createInQuery = (column, list) -> | |
max = 1000 | |
queries = [] | |
i = 0 | |
while i < Math.ceil list.length / max | |
end = if list.length < (i + 1) * max then list.length else (i + 1) * max | |
val = list | |
.slice i * max, end | |
.join "','" | |
queries.push "#{column} IN('#{val}')" |
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
#Add getter-setter | |
_prop = (initValue) -> | |
do (val = initValue) -> | |
_val = val | |
(val) -> | |
return _val if val is undefined | |
_val = val | |
#Example | |
myValue = _prop 'hello' |
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
var _ = require('underscore'); | |
var Backbone = require('backbone'); | |
// 動作確認用にBackboneのModelを作ってみる | |
var MyModel = Backbone.Model.extend({ | |
hello: function() { | |
console.log('hello!!'); | |
} | |
}); |
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
var webpack = require('webpack'); | |
module.exports = { | |
entry: { | |
// 起点となるファイルを指定 | |
'bundle-hello' : './app-hello.js', | |
'bundle-backbone': './app-backbone.js' | |
}, | |
output: { | |
// 出力先のパスを指定 |
{
"env": {
"browser": true,
"commonjs": true
},
"extends": "eslint:recommended"
}
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
# Emoji list | |
# 🎨 :art: UI | |
# 🐛 :bug: バグ | |
# 💄 :lipstick: リファクタリング | |
# 📝 :memo: ドキュメント | |
# 👔 :necktie: テストコード | |
# 📦 :package: ライブラリ | |
# ✨ :sparkles: 機能追加 |
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
// @flow | |
import { AutoSizer, WindowScroller } from 'react-virtualized' | |
import React, { Component } from 'react' | |
import ReactDOM from 'react-dom' | |
type Props = { | |
children?: (args: { | |
height: number, | |
isScrolling: boolean, | |
onChildScroll: Function, |
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
// @flow | |
export default class FirebaseUtils { | |
static logEvent(name: string, parameters: Object = {}): void { | |
if (!name) { | |
return | |
} | |
if (FirebaseUtils.isAndroid) { | |
window.AnalyticsWebInterface.logEvent(name, JSON.stringify(parameters)) | |
return |
OlderNewer