Skip to content

Instantly share code, notes, and snippets.

Avatar
🦎
Focusing

irof irof

🦎
Focusing
View GitHub Profile
@irof
irof / build.gradle
Created Oct 15, 2020
aws-java-sdkを入れたときにruntimeに入るの全部
View build.gradle
plugins {
id 'java'
}
repositories {
jcenter()
}
dependencies {
implementation 'com.amazonaws:aws-java-sdk:latest.release'
@irof
irof / branching-patterns.svg
Last active Jun 18, 2020
ソースコードブランチ管理のパターン https://bliki-ja.github.io/PatternsForManagingSourceCodeBranches/ のパターン関連図。リンクを使うときはRAWで開いてください。
View branching-patterns.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@irof
irof / git-reflog-test.sh
Last active May 31, 2020
gitのreflogでブランチ消しても辿れるって話
View git-reflog-test.sh
git init
git commit --allow-empty -m"1"
git commit --allow-empty -m"2"
git checkout -b test-branch
git commit --allow-empty -m"3"
git commit --allow-empty -m"4"
git checkout master
git branch -D test-branch
git reflog
@irof
irof / pre-commit
Created Nov 7, 2019
CircleCIの設定ファイル検証をコミット前にするやつ
View pre-commit
#!/bin/sh
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
# Initial commit: diff against an empty tree object
against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
fi
@irof
irof / Hoge.java
Created Oct 2, 2016
同じ例外なげれるのね
View Hoge.java
class Hoge extends Exception {
void method() throws Hoge, Hoge, Hoge {
}
}
@irof
irof / Main.java
Created Dec 7, 2015
Springさんのクラススキャンのところを抜粋してみた
View Main.java
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Collections;
import java.util.Enumeration;
import java.util.jar.JarFile;
public class Main {
public static void main(String[] args) throws Exception {
View readCDATA.groovy
def xml = new XmlParser().parseText("""<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="sample.HelloTest" tests="1" skipped="0" failures="0" errors="0" timestamp="2015-12-04T00:11:21" hostname="iProf.local" time="0.22">
<properties/>
<testcase name="test_sayHello" classname="sample.HelloTest" time="0.22"/>
<system-out><![CDATA[system-out-text]]></system-out>
<system-err><![CDATA[system-err-text]]></system-err>
</testsuite>""")
assert xml."system-out".text() == "system-out-text"
View SiinBuilderTest.java
死因 死因 = new SiinBuilder()
.外傷(無し)
.死亡推定時刻(2015-10-20T12:34:56)
.死亡場所(自宅近くの道路)
.add目撃証言(2015-10-18, 近隣住民)
.年齢(98)
.build();
assert 死因 == 交通事故; // => false
View DateAndDateTimeTest.java
import java.time.LocalDateTime;
import java.util.Date;
import static org.junit.Assert.assertFalse;
/**
* @author irof
*/
public class DateAndDateTimeTest {
@org.junit.Test
@irof
irof / JerseyTestを使うときのGradleの依存解決
Last active Aug 29, 2015
JerseyTestを動かすのに要るjarを眺めてみる(2.17)
View JerseyTestを使うときのGradleの依存解決
(https://github.com/irof/sandbox/tree/blog/20150501/jaxrs/jersey をちょっと削ったの)
% gradle dependencies --configuration testCompile :jersey:dependencies
------------------------------------------------------------
Project :jersey
------------------------------------------------------------
testCompile - Compile classpath for source set 'test'.
+--- org.glassfish.jersey.core:jersey-server:2.17
You can’t perform that action at this time.