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
package jp.ponko2.android.os; | |
import android.os.AsyncTask; | |
public abstract class AsyncTask1<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> { | |
@Override | |
protected Result doInBackground(Params... params) { | |
return doInBackground(params.length > 0 ? params[0] : null); | |
} |
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
package jp.ponko2.tddbook.xunit | |
object Main extends App { | |
val suite = new TestSuite() | |
suite.add(new TestCaseTest("testTemplateMethod")) | |
suite.add(new TestCaseTest("testResult")) | |
suite.add(new TestCaseTest("testFailedResult")) | |
suite.add(new TestCaseTest("testFailedResultFormatting")) | |
suite.add(new TestCaseTest("testSuite")) | |
val result = new TestResult() |
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
# zmvを使えるようにする | |
autoload -Uz zmv |
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
function git-root() { | |
if git rev-parse --is-inside-work-tree > /dev/null 2>&1; then | |
cd `git rev-parse --show-toplevel` | |
fi | |
} |
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
if zle -la | grep -q '^history-incremental-pattern-search'; then | |
# zsh 4.3.10 以降でのみ有効 | |
bindkey '^R' history-incremental-pattern-search-backward | |
bindkey '^S' history-incremental-pattern-search-forward | |
fi |
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
## 準備 | |
# zmv を使用する前には `autoload zmv` する必要がある | |
# `man zshexpn` の PARAMETER EXPANSION とかも見ておくと捗る | |
# zmv の使用例については `man zsh-lovers` にたくさんあります | |
## 便利なオプション | |
## zmv のオプションについては `man zshcontrib` で調べることができる。 | |
# zmv -n (実際にリネームする前に結果を確認) | |
zmv -n '*' '$f[5,-1]' # 例は頭4文字削除 | |
# zmv -W ('(*)' '$1' を '*' で済ませられる) |
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
# ファイル情報(Exif情報など)を削除して上書き保存 | |
mogrify -strip -verbose *.jpg |
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
# 画像を90度回転して上書き保存 | |
# +で時計回り、-で反時計回り | |
mogrify -rotate +90 -verbose *.jpg |
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
# pngファイルをグレースケールへ変換して上書き保存 | |
mogrify -colorspace grayscale -verbose *.png |
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
ssh user@host cat /path/to/remotefile | diff /path/to/localfile - |
OlderNewer