Skip to content

Instantly share code, notes, and snippets.

View Jian-Min-Huang's full-sized avatar
🔥
Go Go Go !

黃健旻 Vincent Huang Jian-Min-Huang

🔥
Go Go Go !
View GitHub Profile
@Jian-Min-Huang
Jian-Min-Huang / OptSample.java
Last active December 18, 2022 15:31
Optional Note Part1
public class OptSample {
public void demoOpt() {
String requestBody = sendPost();
// 頭部
// of -> 確定不為 Null 的值
// ofNullable -> 可能為 Null 的值
Optional.of(requestBody).orElse("Empty Body");
Optional.ofNullable(requestBody).orElse("Empty Body");
@Jian-Min-Huang
Jian-Min-Huang / arrow-ext.kt
Last active July 2, 2022 16:59
Some note from learning Arrow-kt
fun <T> T?.catchErrWhenNull(tw: Throwable): Either<Throwable, T> = Either.Companion.catch { this ?: throw tw }
fun <T> Either<Throwable, T?>.flattenCatchErrWhenNull(tw: Throwable): Either<Throwable, T> =
when (this) {
is Either.Left -> this
is Either.Right -> Either.Companion.catch {
this.value ?: throw tw
}
}
@Jian-Min-Huang
Jian-Min-Huang / brand.md
Last active April 10, 2022 12:45
My Brands

3C

  • Apple
    • iPhone 13 Pro Max
    • MacBook Pro
    • Magic Mouse
    • Magic Trackpad
    • Watch
    • Airpods Pro
@Jian-Min-Huang
Jian-Min-Huang / Pinecone Burn Firmware.md
Last active June 19, 2023 03:58
Pinecone Burn Firmware
@Jian-Min-Huang
Jian-Min-Huang / reinstall_1126.md
Last active May 23, 2023 03:33
Reinstall 1126 Note
@Jian-Min-Huang
Jian-Min-Huang / M1 Mac Reinstall.md
Last active May 23, 2023 03:44
M1 Mac Reinstall
@Jian-Min-Huang
Jian-Min-Huang / buddha.txt
Created August 18, 2021 04:55
Buddha Ascii Art
// _oo0oo_
// o8888888o
// 88" . "88
// (| -_- |)
// 0\ = /0
// ___/`---'\___
// .' \\| |// '.
// / \\||| : |||// \
// / _||||| -:- |||||- \
// | | \\\ - /// | |
fun flux() =
Flux.mergeSequential(getMonoResponse(100), getMonoResponse(200))
.collectList()
.flatMap { v ->
return@flatMap getMonoResponse(300)
.map { v2 ->
v.add(v2)
return@map v
}
}.flatMap { v ->