Skip to content

Instantly share code, notes, and snippets.

@7tsuno
7tsuno / file0.txt
Last active June 10, 2017 10:55
Windows環境で静的解析Inferを動かす ref: http://qiita.com/7tsuno/items/f381a918d4688a8574d7
$ curl https://raw.githubusercontent.com/facebook/infer/master/docker/Dockerfile > /c/infer/Dockerfile
$ curl https://raw.githubusercontent.com/facebook/infer/master/docker/run.sh > /c/infer/run.sh
@7tsuno
7tsuno / file0.java
Created May 18, 2017 09:49
流れるようなインタフェースで例外作成 ref: http://qiita.com/7tsuno/items/d0069963b13737e8e3f8
@Getter
public class SampleException extends RuntimeException {
private String code;
private String id;
...
@7tsuno
7tsuno / AllMatch.java
Last active April 26, 2017 01:00
流れるようなインタフェースで条件分岐 ref: http://qiita.com/7tsuno/items/33289d031fcba6952c77
public class AllMatch<T> {
private T obj;
private boolean match;
protected AllMatch(T obj, Predicate<T> checkMethod) {
this.match = checkMethod.test(obj);
this.obj = obj;
}
@7tsuno
7tsuno / Main.java
Created January 28, 2017 02:44
【Java】可変長引数のパラメータを配列にするときの注意 ref: http://qiita.com/7tsuno/items/0c9e52fb3b14e37dbc4c
public class Main {
public static void main(String[] args) {
// 1
test(1, "a", "b", "c");
// 2
test(2, new String[] { "a", "b", "c" });
@7tsuno
7tsuno / Hoge.java
Last active January 18, 2017 00:47
【JMockit1.30】 Expectationsでの引数マッチングをさらに詳しく ref: http://qiita.com/7tsuno/items/2dcebe2fc1533fb68a4d
/**
* DIされるクラス.
*/
public class Hoge {
public String method(UserModel user) {
return "abc";
}
}
@Data
@Dependent
class DependentBean{
private String id;
}
@7tsuno
7tsuno / file4.js
Created December 11, 2016 09:27
【JavaScript】JavaScriptを初めから ref: http://qiita.com/7tsuno/items/4b9c298c4bbf6617137a
var str = "string";
@7tsuno
7tsuno / .bash_profile
Created December 11, 2016 07:27
【Node.js】Windows10でNode.jsの実行環境を作る ref: http://qiita.com/7tsuno/items/e666223d6be22d657542
# Node.js がインストール済みの場合だけ設定を有効化
if [[ -f ~/.nvm/nvm.sh ]]; then
source ~/.nvm/nvm.sh
fi
@7tsuno
7tsuno / BeanCreater.java
Last active December 11, 2016 07:42
【Java】 JavaBeansのメソッドチェーンでの扱いについて ref: http://qiita.com/7tsuno/items/14ca45aa53ce4b98b7f2
public final class BeanCreater<T> {
private BeanCreater() {
}
private T bean;
public static <T> BeanCreater<T> of(Supplier<T> supplier) {
BeanCreater<T> builder = new BeanCreater<T>();