Simple class to measure process time in Ruby. Please use this class, when you don't need to use profile library.
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
| $(function() { | |
| // ボタン・クリック時に1度だけ反映 | |
| $('#btn').one('click', | |
| function(e) { | |
| window.alert('クリックされました!'); | |
| $('.social-btn').append('<div class="hatena"><a>はてなのソーシャルボタンの設定</a></div>'); | |
| } | |
| ); | |
| }); |
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
| openssl rsa -in server.key -out server.key |
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
| (function() { | |
| var Task = Backbone.Model.extend({ | |
| defaults: { | |
| completed: false | |
| }, | |
| toggle: function() { | |
| this.set('completed', !this.get('completed')); | |
| } | |
| }); |
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
| isEmptyObject: function(obj){ | |
| if (Object.keys(obj).length === 0) { | |
| // or if(!Object.keys(obj).length) | |
| return true; | |
| } | |
| return false; | |
| } |
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
| #!/bin/sh | |
| curl -d 'mode=warm&temperature=20&windSpeed=1&power=false' localhost:4567/aircon |
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
| git "/usr/local/rbenv" do | |
| repository "git://github.com/sstephenson/rbenv.git" | |
| reference "master" | |
| action :sync | |
| end | |
| # 各バージョンのrubyはversions/以下におかれる | |
| # 使用中のrubyがshims/以下におかれる | |
| %w{/usr/local/rbenv/shims /usr/local/rbenv/versions}.each do |dir| | |
| directory dir do |
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
| git "/usr/local/nvm" do | |
| repository "git://github.com/creationix/nvm.git" | |
| reference "master" | |
| action :sync | |
| end | |
| template "/etc/profile.d/nvm.sh" do | |
| source "nvm.sh.erb" | |
| mode 00644 | |
| 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
| ruby -e "p [*1..9, *'a'..'z'].sample(12).join" |