var name = "soplana";
var user = {
getName : function(){
var name = "javascript";
return (eval)("name");
}
}
This file contains hidden or 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
| # 少し凝った zshrc | |
| # License : MIT | |
| # http://mollifier.mit-license.org/ | |
| ######################################## | |
| # 環境変数 | |
| export LANG=ja_JP.UTF-8 | |
| # 色を使用出来るようにする |
This file contains hidden or 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
| FROM ubuntu | |
| MAINTAINER soplana "[email protected]" | |
| # turn on universe packages | |
| RUN apt-get update | |
| # basics | |
| RUN apt-get install -y nginx openssh-server git-core openssh-client curl | |
| RUN apt-get install -y nano | |
| RUN apt-get install -y vim |
This file contains hidden or 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
| FROM ubuntu | |
| MAINTAINER soplana "[email protected]" | |
| # turn on universe packages | |
| RUN apt-get update | |
| # basics | |
| RUN apt-get install -y nginx openssh-server git-core openssh-client curl | |
| RUN apt-get install -y nano | |
| RUN apt-get install -y vim |
This file contains hidden or 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
| @date = Date.today | |
| (1..23).to_a.inject() do |times, i| | |
| hour = "%02d" % i | |
| times["#{hour}:00"] = DateTime.parse("#{@date.to_s}T#{hour}:00")..DateTime.parse("#{@date.to_s}T#{hour}:59:59") | |
| times | |
| end | |
| #=> | |
| { |
This file contains hidden or 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
| // widgetを管理するモデル | |
| cookiy.factory('Widget', function($resource){ | |
| var Widget = $resource('/admin/widgets/:type', {type: '@type'}) | |
| // instance propertyを設定できるっぽい | |
| angular.extend(Widget.prototype, { | |
| name: 'hoge' | |
| }) | |
| return Widget; | |
| }); |
This file contains hidden or 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
| "use strict"; | |
| function test(args) { | |
| var hoge = "test" | |
| eval(args); | |
| console.log(hoge); // hello | |
| } | |
| test("a = 'hello';"); | |
This file contains hidden or 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
| "use strict"; | |
| function test(args) { | |
| var hoge = "test" | |
| eval(args); | |
| console.log(hoge); // hello | |
| } | |
| test("hoge = 'hello';"); | |
| function test2() { |
This file contains hidden or 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
| /**************************** | |
| * LimitedList | |
| ****************************/ | |
| var LimitedList = {}; | |
| LimitedList.property = {}; | |
| (function(property){ | |
| // argumetns等の配列っぽい何かを受け取ってlenghtを返す | |
| function getSize(l){ |
This file contains hidden or 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
| context "未公開記事の場合" do | |
| let!(:rec) { FactoryGirl.create(:recommend, :temporary) } | |
| before do | |
| controller.stub(:current_user).and_return(access_user) | |
| get :show, id: rec.id | |
| end | |
| context "記事ユーザ == アクセスユーザ" do | |
| let(:access_user) { User.find(rec.user_id) } | |
| it { response.status.should eq(302) } |
NewerOlder