Skip to content

Instantly share code, notes, and snippets.

View taichi's full-sized avatar
😸
shaving...

taichi taichi

😸
shaving...
View GitHub Profile
@taichi
taichi / AddressUtil.java
Created January 31, 2011 09:30
convert from IP address text presentation to InetSocketAddress
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* @see <a href="http://tools.ietf.org/html/rfc4291">[RFC4291] IP Version 6
* Addressing Architecture</a>
* @see <a href="http://tools.ietf.org/html/rfc5952">[RFC5952] A Recommendation
@taichi
taichi / main.go
Last active May 19, 2020 08:01
RethinkDB Client code examples written by golang.
package main
import (
r "github.com/dancannon/gorethink"
"log"
"time"
)
func main() {
log.Println("BEGIN")
@taichi
taichi / uBlacklist用ブラックリスト
Last active April 16, 2020 23:05
Personal Blocklist が気が付いたら動かなくなっていたので移行。
https://chrome.google.com/webstore/detail/ublacklist/pncfbmialoiaghdehhbnbhkkgmjanfhe
*://qiita.com/*
*://matome.naver.jp/*
*://kyoko-np.net/*
*://blog.livedoor.com/*
*://dev.classmethod.jp/*
@taichi
taichi / Database_testing.md
Created October 4, 2012 15:35
データベースを使った自動テストについて

データベースを使った自動テストについて

データベースを使った機能テストや単体テストについて要点をまとめておきます。

筆者の経験を強く反映していますので比較的定性的な内容となります事を予めご了承下さい。

テストデータを保守する

テストの実行前に投入するテストデータは、凡そcsvファイルやxmlファイル、エクセルファイル等で管理する事になります。
仕様の変更に伴いテーブルの定義を変更する事で、それらのファイルの内容とデータベースの間に不整合が発生します。

@taichi
taichi / build.gradle
Last active November 29, 2019 03:37
doma-tutorial-1.31.0.zipに含まれるbuild.gradleをより改善したビルドスクリプト。
apply plugin: 'java'
sourceCompatibility = targetCompatibility = 1.6
tasks.withType(AbstractCompile) each { it.options.encoding = 'UTF-8' }
repositories {
mavenCentral()
maven {url 'http://maven.seasar.org/maven2'}
}
@taichi
taichi / posh-git.md
Created September 18, 2019 07:13
powershellのコードをプロファイリングする
--disable-self-update-check false
--child-concurrency 1
--network-timeout 1000000
@taichi
taichi / MemoizeSupplier.java
Created January 9, 2015 08:28
Lazy loading Supplier on Java8
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.function.Supplier;
public class MemoizeSupplier<T> implements Supplier<T> {
final Supplier<T> delegate;
ConcurrentMap<Class<?>, T> map = new ConcurrentHashMap<>(1);
public MemoizeSupplier(Supplier<T> delegate) {
@taichi
taichi / DomainName_GetAtt.yml
Last active July 3, 2019 11:15
this template does not work.
Resources:
MyCustomDomain:
Type: AWS::ApiGatewayV2::DomainName
Properties:
DomainName: api.example.com
DomainNameConfigurations:
- CertificateArn: arn:aws:acm:ap-northeast-1:759044339783:certificate/e17e4147-4f27-4ccb-ab1d-a1d6300f118a
EndpointType: REGIONAL
Outputs:
WayWay:
@taichi
taichi / postgre.gradle
Created August 7, 2013 10:12
enable PostgreSQL configuration to Wildfly using Gradle.
dependencies { runtime 'org.postgresql:postgresql:9.2-1003-jdbc4' }
task installPostgreSQL(type: Copy) {
def postgreJar = configurations.runtime.find { it.name.contains('postgresql') }
def moduleDir = "$jbossHome/modules/system/layers/base/org/postgresql/main"
from postgreJar
into moduleDir
doLast {