Skip to content

Instantly share code, notes, and snippets.

View KengoTODA's full-sized avatar

Kengo TODA KengoTODA

View GitHub Profile
@KengoTODA
KengoTODA / how-to-go-shmg.md
Last active August 29, 2015 14:15
How to go サンヒルズ・メモリアルガーデン (Sun hills memorial garden)
@KengoTODA
KengoTODA / unwatch-jenkins-repository.js
Created February 17, 2015 02:42
One liner to unwatch all jenkins repository
$("a[href^='/jenkinsci']").parent().find('button[type="submit"]').each(function(i,e){if (i%2===0) {setTimeout(function(){$(e).click();}, i*1000);}})
@KengoTODA
KengoTODA / gist:3c07239b05a94a78466c
Created November 15, 2014 14:39
The Problem-Definition Process
import java.util.Comparator;
import java.util.SortedSet;
import java.util.TreeSet;
import lombok.Value;
import com.google.common.collect.ComparisonChain;
public class Main {
@Value
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
/**
* @see https://twitter.com/cobot_1/status/403501394528718848
*/
public class Example {
static abstract class Dto {}
static class DtoA extends Dto {}
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /Users/kengo/Documents/github/ec2-plugin-from-morlin/src/test/java/hudson/plugins/ec2/SlaveTemplateTest.java:[59,22] シンボルを見つけられません。
シンボル: コンストラクタ SlaveTemplate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.amazonaws.services.ec2.model.InstanceType,java.lang.String,hudson.model.Node.Mode,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,boolean,java.lang.String,java.util.List<hudson.plugins.ec2.EC2Tag>,<nulltype>,boolean,<nulltype>)
場所 : hudson.plugins.ec2.SlaveTemplate の クラス
[ERROR] /Users/kengo/Documents/github/ec2-plugin-from-morlin/src/test/java/hudson/plugins/ec2/SlaveTemplateTest.java:[82,29] シンボルを見つけられません。
シンボル: コンストラクタ SlaveTemplate(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,c
@KengoTODA
KengoTODA / README.md
Created October 28, 2012 23:39
A way to build FindBugs plugin with Maven3

Use findbugs-slf4j project as an example.

How to include meta file as resource

To build FindBugs plugin, we have to include meta files into package file. But we cannot put meta files into src/main/resources, because it breaks Unit testing like this.

java.lang.ExceptionInInitializerError
        at edu.umd.cs.findbugs.DetectorFactoryCollection.getCoreResource(DetectorFactoryCollection.java:360)
@KengoTODA
KengoTODA / jmap.md
Created September 16, 2012 00:53
Java Profiling Cheat Sheet

Official Page

jmap -dump:[live,]format=b,file=<filename> <pid>

ヒープダンプを指定したファイルに出力する。liveオプションによって生きている(参照されて いる)オブジェクトのみを出力可能。ダンプはjhatやMATで閲覧する。 OutOfMemoryErrorの原因を調べたいなら、jmapより-XX:+HeapDumpOnOutOfMemoryError オプションでヒープダンプを出力することをまず検討しよう。

jmap -histo:[live] <pid>

@KengoTODA
KengoTODA / a part of pom.xml
Created September 4, 2012 04:18
To explain how I use profile to avoid problem of FindBugs plugin
<profiles>
<profile>
<id>release</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<properties>
@KengoTODA
KengoTODA / gcode-migration.diff
Created June 29, 2012 04:26
A patch to migrate partake
Index: src/main/webapp/WEB-INF/internal/header.jsp
===================================================================
--- src/main/webapp/WEB-INF/internal/header.jsp (revision 939)
+++ src/main/webapp/WEB-INF/internal/header.jsp (working copy)
@@ -57,13 +57,13 @@
<b class="caret"></b>
</a>
<ul class="dropdown-menu">
- <li><a href="http://code.google.com/p/partakein/wiki/FAQ">よくある質問</a></li>
- <li><a href="http://code.google.com/p/partakein/issues/list">ご要望・バグ報告</a></li>