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() { | |
| 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
| 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() { | |
| // ボタン・クリック時に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
| // http://blog.tojiru.net/article/205007468.html | |
| if (a == null) { | |
| alert("aはundefinedかnull"); | |
| } |
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
| // Don't use: onClick="hoge('id')" | |
| $('.btn').click(function(){ | |
| var id = $(this).attr('id'); | |
| var class = $(this).attr('class'); | |
| var dataHoge = $(this).attr('data-hoge'); | |
| hogeId(id); | |
| hogeClass(class); | |
| hogeDataHoge(dataHoge); | |
| }); |
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
| // ex: separate 2 letters, and add "¥¥x" | |
| var segments = signal.match(/.{2}/g); | |
| var code = "" | |
| for (var i = 0; i < segments.length; i++) { | |
| code += "¥¥x" + segments[i]; | |
| } |
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
| $ open -a textedit file_name | |
| # i don't remenber this command, so... | |
| $ vi ~/.bashrc | |
| + if [ `uname` = "Darwin" ]; then | |
| + alias notepad="open -a textedit" | |
| + fi | |
| # windows like :-) |
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 config user.name 'Kenji' | |
| $ git config user.emai kenji0x02@gmail.com | |
| $ vi .git/config | |
| - url = https://github.com/kenji0x02/marico.git | |
| + url = github:kenji0x02/marico.git |
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
| $ sudo vim | |
| Error detected while processing /Users/user_name/.vim/bundle/neocomplcache/plugin/neocomplcache.vim: | |
| line 37: | |
| "sudo vim" and $HOME is not same to /root are detected.Please use sudo.vim plugin instead of sudo command or set always_set_home in sudoers. | |
| then, set "always_set_home" in visudo as follows: | |
| $ sudo visudo | |
| + Defaults always_set_home |