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
rvm use ruby-1.9.2-p290@rails3 |
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
rails new gen_simple_doc_json |
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
$.Controller("MyWidget", | |
{ | |
defaults : { | |
message : "Remove Me" | |
} | |
}, | |
{ | |
init : function(rawEl, rawOptions){ | |
this.element.append( | |
"<div>"+this.options.message+"</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
var el = $(".selector"); | |
var controller = new MyWidget(el);//コントローラの生成 | |
console.log(controller.options.message); | |
//"Remove Me"と出力される | |
//パラメータを指定してコントローラ生成 | |
controller = new MyWidget(el, {message : "Don't Remove Me" } ); | |
console.log(controller.options.message); | |
//"Don't Remove Me"と出力される |
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
$.Controller("MyWidget", | |
{ | |
defaults : { | |
targetElement : 'div' | |
} | |
}, | |
{ | |
"{targetElement} click" : function(elm, ev){ | |
console.log(elm); | |
} |
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
steal('jquery/model', function(){ | |
/** | |
* @class Sample.Models.Hoge | |
* @parent index | |
* @inherits jQuery.Model | |
* Wraps backend hoge services. | |
*/ | |
$.Model('Sample.Models.Hoge', | |
/* @Static */ |
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
steal('jquery/model', function(){ | |
/** | |
* @class Sample.Models.Hoge | |
* @parent index | |
* @inherits jQuery.Model | |
* Wraps backend hoge services. | |
*/ | |
$.Model('Sample.Models.Hoge', | |
/* @Static */ |
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
# コマンド入力補助用の環境変数設定 | |
$ export SAKURACLOUD_ACCESS_TOKEN=[さくらのクラウドのアクセストークン] | |
$ export SAKURACLOUD_ACCESS_TOKEN_SECRET=[さくらのクラウドのトークンシークレット] | |
# さくらのクラウド上にサーバ作成 | |
$ docker-machine create -d sakuracloud sakura-token | |
# docker-machineの対象サーバを切り替え | |
$ eval "$(docker-machine env sakura-token)" |
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
$ docker-machine create -d sakuracloud \ | |
--sakuracloud-access-token [アクセストークン] \ | |
--sakuracloud-access-token-secret [トークンシークレット] \ | |
--sakuracloud-connected-switch [さくらのクラウドで作成したスイッチのID] \ | |
--sakuracloud-private-ip [追加NICのIPアドレス] \ | |
--sakuracloud-private-ip-subnet-mask [追加NICのサブネットマスク] \ | |
sakura-dev | |
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
$ docker network create -d overlay [ネットワーク名] |
OlderNewer