Instantly share code, notes, and snippets.
Software engineer.I'm interested in Web applications (Kotlin, Java, TypeScript, JavaScript, Ruby, Perl, etc.), Android apps, UWP apps.
nobuoka /generic_test_coverage.ja.markdown
Last activeMarch 24, 2021 08:27
generic_test_coverage.rb (fastlane action)nobuoka /fizzbuzz.kt
Last activeFebruary 16, 2019 05:31
See :https://vividcode.hatenablog.com/entry/software-design/fizz-buzz-usecase 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
// === ドメインレイヤ === | |
sealedclassFizzBuzzValue { | |
abstractval expression:String | |
data classNumber(overridevalexpression:String) : FizzBuzzValue() | |
object Fizz : FizzBuzzValue() {overrideval expression:String="Fizz" } | |
object Buzz : FizzBuzzValue() {overrideval expression:String="Buzz" } | |
object FizzBuzz : FizzBuzzValue() {overrideval expression:String="FizzBuzz" } | |
} |
nobuoka /ExceptionWithEither.kt
Last activeFebruary 10, 2023 06:56
Kotlin における、呼び出し側に処理して欲しい例外の扱い方を検討する。 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
importjavax.ws.rs.WebApplicationException | |
importjavax.ws.rs.core.Response | |
// 使う側の例。 | |
funmain(args:Array<String>) { | |
FooApplicationService.fetchFoo("taro","").then { | |
when (it) { | |
isEither.Right->Response.ok().entity(it.value) | |
isEither.Left->when (it.value) { |
nobuoka /CommandProcessRunner.java
CreatedSeptember 29, 2016 07:58
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
packageinfo.vividcode; | |
importjava.io.BufferedInputStream; | |
importjava.io.ByteArrayOutputStream; | |
importjava.io.IOException; | |
importjava.util.List; | |
importjava.util.concurrent.TimeUnit; | |
/** | |
*すぐに実行終了するコマンド (外部プロセス)を実行するクラス。 |
nobuoka /commit-built-files-to-gh-pages-branch.markdown
Last activeNovember 22, 2019 15:38
The way to commit built files in subdirectory to gh-pages branch from an arbitrary branch 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
Install-Package : パッケージ 'XXX 1.0.0' をインストールできませんでした。 | |
このパッケージを 'Windows,Version=v0.0' を対象とするプロジェクトにインストールしようとしていますが、 | |
そのフレームワークと互換性があるアセンブリ参照またはコンテンツ ファイルがパッケージに含まれていません。 | |
詳細については、パッケージの作成者に問い合わせてください。 |
nobuoka /eclipse_setup.markdown
Last activeAugust 29, 2015 14:27
Eclipse setup for Java EE developmentnobuoka /GoogleHttpJavaClientExample.java
CreatedNovember 8, 2014 11:20
google-http-java-client を使用するサンプルコード 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
importjava.io.IOException; | |
importcom.google.api.client.http.GenericUrl; | |
importcom.google.api.client.http.HttpRequest; | |
importcom.google.api.client.http.HttpRequestFactory; | |
importcom.google.api.client.http.HttpResponse; | |
importcom.google.api.client.http.HttpTransport; | |
importcom.google.api.client.http.javanet.NetHttpTransport; | |
publicclassGoogleHttpJavaClientExample { |
nobuoka /proxychains
CreatedJuly 6, 2014 15:59
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
$ proxychains ssh xxx.xxx | |
ProxyChains-3.1 (http://proxychains.sf.net) | |
|DNS-request| xxx.xxx | |
|S-chain|-<>-127.0.0.1:1080-<><>-X.X.X.X:XX-<><>-OK | |
|DNS-response|: xxx.xxx is not exist | |
ssh: Could not resolve hostname xxx.xxx: Unknown error |
NewerOlder