% gem install pre-commit
% mkdir work
% cd work
% git init
% pre-commit install
% git config "pre-commit.checks" "jshint"
% echo "var x = 1" > error.js
% git add .
% git commit -m "add error.js"
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
| public static String getStackTrace(Throwable e) { | |
| StringWriter sw = null; | |
| PrintWriter pw = null; | |
| try { | |
| sw = new StringWriter(); | |
| pw = new PrintWriter(sw); | |
| e.printStackTrace(pw); | |
| return sw.toString(); | |
| } finally { | |
| try { |
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
| [mysqld] | |
| long_query_time=1 | |
| slow_query_log=1 | |
| slow-query-log-file=~/mysqld-slow-query.log | |
| log-queries-not-using-indexes |
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
| sed -n '開始行,終了行p' ファイル名 | |
| %cat hoge.txt | |
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| %sed -n '3,4p' hoge.txt |
$ curl https://raw.github.com/hokaccha/nodebrew/master/nodebrew | perl - setup
$ nodebrew install latest
$ nodebrew use v0.9.10
$ node -v
$ npm install -g jshint
$ echo "var x = 1" > error.js
$ jshint error.js
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
| class String | |
| def colorize(color_code); "\e[#{color_code}m#{self}\e[0m"; end | |
| def red; colorize(31); end | |
| def yellow; colorize(33); end | |
| def pink; colorize(35); end | |
| end |
%mysql_secure_installation
Change the root password? [Y/n] Y
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
- rootパスワードを設定する