Skip to content

Instantly share code, notes, and snippets.

@kuneo
kuneo / 0_reuse_code.js
Created June 21, 2016 14:59
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@kuneo
kuneo / import.html
Last active June 23, 2016 14:53
bootstrap-table getstart
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="bootstrap-table.min.js"></script>
<link rel="stylesheet" href="bootstrap.min.css">
<link rel="stylesheet" href="bootstrap-table.min.css">
@kuneo
kuneo / hop.html
Created June 23, 2016 15:06
bootstrap-table hop
<table data-toggle="table" data-url="http://kuneo.org/sandbox/bootstrap-table/json/getstart.json">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">名前</th>
<th data-field="price">価格</th>
</tr>
</thead>
</table>
@kuneo
kuneo / step.html
Created June 23, 2016 15:10
bootstrap-table step
<table id="table"></table>
<script>
$('#table').bootstrapTable({
url: 'http://kuneo.org/sandbox/bootstrap-table/json/getstart.json',
columns: [{
field: 'id',
title: 'ID'
}, {
field: 'name',
title: '名前'
@kuneo
kuneo / table-classes.html
Created June 28, 2016 13:34
bootstrap-table table[classes]
<table data-toggle="table" data-url="http://kuneo.org/sandbox/bootstrap-table/json/getstart.json" data-classes="table table-hover table-no-bordered">
<thead>
<tr>
<th data-field="id">ID</th>
<th data-field="name">名前</th>
<th data-field="price">価格</th>
</tr>
</thead>
</table>
@kuneo
kuneo / bidimapサンプルコード
Last active September 29, 2016 15:24
apache commonsのBidiMap(双方向マップ)の使い方
// 通常のマップを生成
Map<String, Integer> map = new HashMap<>();
map.put("suzuki", 1);
map.put("tanaka", 2);
// 生成した通常のマップを双方向マップに挿入
BidiMap<String, Integer> bidiMap = new DualHashBidiMap<>(map);
// getKey()でvalueからkeyを取得できる
System.out.println(bidiMap.getKey(1));
// 当然、get()でkeyからvalueも取得できる
@kuneo
kuneo / bidimap出力結果
Created September 29, 2016 15:25
bidimapの出力結果
suzuki
1
--- 拡張for文を回してみる ---
key:suzuki
value:1
key:sato
value:3
key:yamada
value:2
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-collections4</artifactId>
<version>4.1</version>
</dependency>
@kuneo
kuneo / mockito_RepositoryIF
Last active September 30, 2016 14:41
mockito説明用、試験対象クラス
public interface LoginRepository {
String findHashPassword(String loginId);
}
@kuneo
kuneo / mockito_試験クラス
Last active September 30, 2016 14:56
mockito説明用試験クラス
package kuneo.org.sample.mockito;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import javax.naming.AuthenticationException;