Skip to content

Instantly share code, notes, and snippets.

@thrakt
thrakt / Tool.java
Last active August 25, 2017 15:03
Prepare for instant codes
import java.util.stream.*;
import java.util.*;
public class Tool {
public static Map<Integer, List<Integer>> reverseArrayValue(int[] array) {
Map<Integer, List<Integer>> result = new HashMap<>();
for (int i = 0; i < array.length; i++) {
result.putIfAbsent(array[i], new ArrayList<Integer>());
result.get(array[i]).add(i);
@thrakt
thrakt / index.html
Last active May 5, 2017 13:44
FGO Activity Predictor
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>FGO Activity Predictor</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
crossorigin="anonymous">
<script src="https://unpkg.com/vue"></script>
@thrakt
thrakt / index.html
Last active August 29, 2015 14:05
2-5式索敵値計算機
<html>
<head>
<title>2-5式索敵値計算</title>
<meta charset="UTF-8">
<script src="http://cdnjs.cloudflare.com/ajax/libs/vue/0.10.6/vue.min.js"></script>
<script src="http://code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.6.0/underscore-min.js"></script>
<script type="text/javascript">
//<![CDATA[
window.onload = function(){
OreoreData oreoreData = new OreoreData();
oreoreData.setOreoreDataId(oreoreDataId);
return oreoreDataService.find(oreoreData);
@thrakt
thrakt / file0.txt
Last active April 22, 2016 04:46
Review Board に差分を投稿する時の tips (特にgit) ref: http://qiita.com/thrakt/items/b758a3990560555efb1a
rbt post -o -r xxx --parent=HEAD^^
rbt post -o -r xxx --parent=origin/master
@thrakt
thrakt / crontab
Created May 22, 2014 08:19
gitコマンドの対象リポジトリを指定する ref: http://qiita.com/thrakt/items/92938970ae6503c41db8
*/10 * * * * ls -1 /usr/local/gitrepos/ | xargs -i git --git-dir=/usr/local/gitrepos/{} remote update | logger -t "update repos" -p local0.info
@thrakt
thrakt / CutJsessionidFilter.java
Created May 20, 2014 11:10
初回アクセス時にリンクにjsessionidが入るのをなんとかする ref: http://qiita.com/thrakt/items/f6f31fb13e832e9d710d
package ex.web.interceptor;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
@thrakt
thrakt / file0.java
Created May 19, 2014 11:08
Java8でListをある程度まとめて並列処理 ref: http://qiita.com/thrakt/items/62d05c2ea0675f0f996f
List<Map<String, Object>> rows = new ArrayList<>(); // データ入れる
rows.parallelStream().forEach(row -> {
LOG.info("something to do.");
LOG.info(row);
});
/*
* pixiv Bookmark - Tombloo patches
*
* ピクシブでブックマークするパッチ
*
* 同時に「お気に入りユーザーに追加」する場合は
* 下の BOOKMARK_USER 定義を true にする
*
* Based: http://gist.github.com/318137
* Version 1.03, 2011-03-05 polygon planet <http://polygonplanet.tumblr.com/>