This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This program is free software. It comes without any warranty, to | |
* the extent permitted by applicable law. You can redistribute it | |
* and/or modify it under the terms of the Do What The Fuck You Want | |
* To Public License, Version 2, as published by Sam Hocevar. See | |
* http://sam.zoy.org/wtfpl/COPYING for more details. */ | |
/** | |
* 明示的な開放が必要なリソースクラスが使用する。 | |
* | |
* finalizeメソッドにより、開放されていないリソースがあった場合標準エラー出力に警告を出す。 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
PREFIX="from now" | |
MESSAGE="[${PREFIX}] `date`" | |
if [ $# -eq 0 ] | |
then | |
git add -u |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum NamedParam { | |
A(new Param1(1), new Param2("hoge")), B(new Param1(10), new Param2("fuga")); | |
X(Param1 p1, Param2 p2) { | |
this.p1 = p1.value; | |
this.p2 = p2.value; | |
} | |
public final int p1; | |
public final String p2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
addBatch(new Batch("hogehoge",new Batch.Serial() {{ | |
add(HogeJob.class); | |
add(FugaJob.class); | |
add(new Batch.Parallel() {{ | |
add(FooJob.class); | |
add(BarJob.class); | |
}}; | |
}}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __show_errorcode() { | |
ERR=$? | |
if [ $ERR != 0 ]; then | |
echo -en "\033[31m\$?=$ERR" | |
fi | |
} | |
function __show_jobs() { | |
JOBS=$(jobs|sed 's/ \+/\t/g'|cut -f1,3|tr \\t :|tr \\n ','|sed 's/,$//'|sed 's/,/, /g') | |
if [ "$JOBS" != "" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 自分で定義したDateRange型から、where条件を生成したい */ | |
-- before | |
select * from table | |
where | |
update_time between /*range.getStart()*/'2011-01-01' and /*range.getEnd()*/'2011-12-31' | |
-- after | |
select * from table | |
where |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public enum A { | |
Hoge(CONST); // Cannot reference a field before it is defined | |
private static int CONST = 1; | |
private A(int x) { | |
} | |
} | |
public enum B { // Syntax error on token "{", ; expected after this token | |
private static int CONST = 1; | |
Hoge(CONST); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
alias = !git config --list | grep 'alias\\.' | sed 's/alias\\.\\([^=]*\\)=\\(.*\\)/\\1\\\t => \\2/' | sort | |
a = add | |
a-i = add -i | |
a-p = add -p | |
co = checkout | |
b = branch | |
k = !gitk --all --max-count=200 & | |
s = status -sb | |
ci = commit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
def hsv_to_rgb(h, s, v) | |
h_i = (h*6).to_i | |
f = h*6 - h_i | |
p = v * (1 - s) | |
q = v * (1 - f*s) | |
t = v * (1 - (1 - f) * s) | |
r, g, b = v, t, p if h_i==0 | |
r, g, b = q, v, p if h_i==1 | |
r, g, b = p, v, t if h_i==2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding:utf-8 -*- | |
raise <<EOS | |
MOVED: https://github.com/todesking/svn-cherry-pick | |
EOS |