Skip to content

Instantly share code, notes, and snippets.

View retheviper's full-sized avatar
🏠
Working from home

Youngbin Kim retheviper

🏠
Working from home
View GitHub Profile
@retheviper
retheviper / ScrimageLgtmGifGenerator.ipynb
Created September 1, 2024 12:34
Create LGTM image (GIF) with Scrimage
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@retheviper
retheviper / ScrimageLgtmGenerator.ipynb
Last active September 1, 2024 12:10
Create LGTM image with Scrimage
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@retheviper
retheviper / CoroutineNetworkRequestController.kt
Last active May 5, 2022 13:14
Spring MVC coroutine example
@RestController
@RequestMapping("/requests")
class CoroutineNetworkRequestController {
private val url = "https://en.wikipedia.org/api/rest_v1/page/summary"
private val logger = LogManager.getLogger(CoroutineNetworkRequestController::class.java)
/**
* do request with async and awaitAll
*/
@retheviper
retheviper / GetTen.kt
Last active April 1, 2022 12:27
1, 3, 3, 7 to 10
import kotlin.random.Random
fun main() {
while (true) {
val (result, expression) = calculate()
if (result == 10.0) {
println("${expression.removeSurrounding("(", ")")} = ${result.toInt()}")
break
}
}
@retheviper
retheviper / MontyHall.kt
Created October 23, 2021 03:53
Monty hall problem is kotlin
import kotlin.system.measureTimeMillis
const val GOAT = "goat"
const val CAR = "car"
const val OUT = "out"
val RANGE = (0..2)
/**
* put a car behind one door
*/
@retheviper
retheviper / MimeTypes.kt
Last active August 12, 2024 10:09 — forked from dptsolutions/MimeTypes.kt
Standard MIME type constants ready to use in a Kotlin project
/**
* See [Media Types](https://www.iana.org/assignments/media-types/media-types.xhtml) of IANA.
*/
object MimeTypes {
enum class Application(val extensions: Array<String>, val mimeType: String) {
/** AbiWord document */
ABI_WORD(arrayOf(".abw"), "application/x-abiword"),
/** Archive document (multiple files embedded) */