Skip to content

Instantly share code, notes, and snippets.

@relax-more
relax-more / gist:487c5f2c0b80b64aa8de
Created July 24, 2015 06:17
memo: What is different ${...} and #{...} on spring
@relax-more
relax-more / gist:4202133
Created December 4, 2012 09:22
正規表現メモ
【半角英字】^[a-zA-Z]+$
abcdefghijklmnopqrstuvwxyz
【半角数字】^[0-9]+$
0-9
【半角記号】^[ -/:-@\[-\`\{-\~]+$
半角空白!”#$%&’()*+-.,/:;<=>?@[\]^_`{|}~
【半角英数字】^[a-zA-Z0-9]+$
abcdefghijklmnopqrstuvwxyz0123456789
【半角英数字記号】^[a-zA-Z0-9 -/:-@\[-\`\{-\~]+$
abcdefghijklmnopqrstuvwxyz0123456789半角空白!”#$%&’()*+-.,/:;<=>?@[\]^_`{|}~
@relax-more
relax-more / gist:7365752
Created November 8, 2013 03:14
[java] @VisibleForTesting が気になったのでメモ
@VisibleForTesting
com.google.common.annotations
4つ提供されていますが、普段使いできそうなのは1つかな。
VisibleForTestingは、メソッドやフィールドに付与するもので、テストをしやすくするためにアクセス修飾子のレベルを緩くしているということを明示するために付与する。テストのためにprivateをパッケージプライベートに変更したりってことはよくするので、このアノテーションを利用するのはよさそう。
参照: http://d.hatena.ne.jp/mtoyoshi/20100725/1280040233
@relax-more
relax-more / gist:5167100
Last active June 8, 2018 01:57
[nginx] 設定変更・適用
[hogehoge@ ~]$ sudo /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
[hogehoge@ ~]$ sudo /usr/local/nginx/sbin/nginx -s reload
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@relax-more
relax-more / nginx.conf
Created April 14, 2014 05:31
[nginx] configuration of apple-touch-icon
+ location ~ /apple-touch-icon(|-\d+x\d+)(|-precomposed).png {
+ return 204;
+ log_not_found off;
+ }
@relax-more
relax-more / log
Last active March 20, 2018 12:30
[java] GCの調査をしたのでメモ
2013-03-12T17:29:32.875+0900: [GC [ParNew: 105726K->658K(118016K), 0.0036680 secs] 940860K->835893K(1035520K), 0.0038120 secs] [Times: user=0.04 sys=0.00, real=0.01 secs]
2013-03-12T17:29:33.937+0900: [GC [ParNew (promotion failed): 105618K->105610K(118016K), 0.0631610 secs][CMS: 835245K->259864K(917504K), 1.8827850 secs] 940853K->259864K(1035520K), [CMS Perm : 53618K->53373K(83968K)], 1.9461600 secs] [Times: user=1.98 sys=0.02, real=1.94 secs]
2013-03-12T17:29:35.952+0900: [GC [ParNew: 104960K->4540K(118016K), 0.0079190 secs] 364824K->264404K(1035520K), 0.0080600 secs] [Times: user=0.07 sys=0.00, real=0.01 secs]
2013-03-12T17:29:36.076+0900: [GC [ParNew: 109500K->4641K(118016K), 0.0096710 secs] 369364K->264505K(1035520K), 0.0098120 secs] [Times: user=0.03 sys=0.00, real=0.01 secs]
[
{
"data": "JP",
"key": "test"
},
{
"data": "TH",
"key": "test"
}
]
@relax-more
relax-more / TestClass.java
Last active October 6, 2017 09:12
[java] generate random MD5 string (very naive...)
public class TestClass{
private String generateToken(){
MessageDigest md;
try {
md = MessageDigest.getInstance("MD5");
} catch (NoSuchAlgorithmException e) {
// coding error.
LOGGER.error("codeing error. ", e);
throw new RuntimeException(e);
}
@relax-more
relax-more / gist:95edafe64bd12d9abbc32c4eaeb0d431
Created July 21, 2017 06:05
shell related tool or some tools
https://github.com/robbyrussell/oh-my-zsh
http://qiita.com/mollifier/items/0b618f9e969193ccf5c8
https://github.com/zsh-users/antigen