Skip to content

Instantly share code, notes, and snippets.

@relax-more
relax-more / MyClass.java
Created July 24, 2015 07:56
[java] DI data to static field with spring
public Class MyClass{
private static String staticFieldValue;
public static void setStaticField(String staticFieldValue){
this.staticFieldValue = staticFieldValue;
}
}
@relax-more
relax-more / gist:487c5f2c0b80b64aa8de
Created July 24, 2015 06:17
memo: What is different ${...} and #{...} on spring
Linux - ぜんぶTIME_WAITのせいだ! - Qiita /
http://qiita.com/kuni-nakaji/items/c07004c7d9e5bb683bc2
TCP/IP で TIME_WAIT が残る時間を短くする /
http://network.station.ez-net.jp/server/linux/network/time_wait.asp
TCPのTIME_WAITを無くす! | 田舎に住みたいエンジニアの日記 /
http://blog.ybbo.net/?p=128
TIME_WAIT状態のTCPコネクションを早く終了させるべくKernelをリビルド - 元RX-7乗りの適当な日々 /
for i in `ls rev_result*` ; do mv $i ${i/ev_result/messages}
http://motw.mods.jp/shellscript/rename.html
@relax-more
relax-more / shell
Last active August 29, 2015 14:25
native2ascii
for i in `ls *.properties`;do native2ascii -reverse $i rev_$i;done
http://www.javadrive.jp/start/encoding/index3.html
@relax-more
relax-more / Snipets.java
Created July 13, 2015 10:38
Caching by Guava cache and Gava Supplier
import com.google.common.base.Supplier;
import com.google.common.base.Suppliers;
import com.google.common.cache.CacheBuilder;
import com.google.common.cache.CacheLoader;
import com.google.common.cache.LoadingCache;
public class Snipets{
private Supplier<String> sampleSupplier;
private LoadingCache<String, List<Long>> sampleCache;

What is difference between ready() and load() of jQuery/javaScript

According to this page... http://oshiete.goo.ne.jp/qa/8168163.html

> ■質問1
> jQueryの「$(document).ready(function()」と「$(window).load(function()」は何が違うのでしょうか?
readyは「DOM要素の準備が完了した時」に呼び出される「jQueryイベント」であり、loadは生JavaScriptのonloadに相当する「Webブラウザ組み込みJavaScriptイベント」だ。

Truht seems better than hamcrest

https://google.github.io/truth/

  • we do no need using many static import
  • hamcrest does not propose us which is better assertion method
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.0</version>
</dependency>
@relax-more
relax-more / gist:5812a8eeab67a9308f18
Created June 10, 2015 11:36
Java order of modifiers

ModifierOrder

Description

Checks that the order of modifiers conforms to the suggestions in the Java Language specification, sections 8.1.1, 8.3.1 and 8.4.3. The correct order is:

public protected private