I hereby claim:
- I am guersam on github.
- I am guersam (https://keybase.io/guersam) on keybase.
- I have a public key ASCpi4lE8RcuK-hUUr5MFavzikvDnGPrPMjFfpumrW855go
To claim this, I am signing this object:
//> using scala "3.2.2" | |
//> using dep "dev.zio::zio:2.0.10" | |
import zio.* | |
object ResourceAcquisitionTimeoutExample extends ZIOAppDefault { | |
val run = | |
ZIO.debug("Running...") *> | |
ZIO.acquireRelease( | |
ZIO.debug("Acquired") |
//> using scala "3.2.2" | |
//> using dep "dev.zio::zio:2.0.9" | |
//> using dep "dev.zio::zio-test:2.0.9" | |
import zio.* | |
import zio.stream.* | |
import zio.test.* | |
import java.time.temporal.ChronoUnit | |
object ThrottleShapeSpec extends ZIOSpecDefault { |
//> using scala "3.2.1" | |
//> using lib "dev.zio::zio:2.0.3" | |
import zio.* | |
case class AppConfig(root: String) | |
object AppConfig: | |
val layer: ZLayer[Any, Nothing, AppConfig] = |
import { createLogger } from 'vite'; | |
export function monkeyPatchVegaScenegraph() { | |
const name = 'monkey-patch-vega-scenegraph'; | |
const logger = createLogger('info', { prefix: `[${name}]` }); | |
const logOptions = {timestamp: true}; | |
const replaceCriteria = /touchmove\(evt\) \{\s*this\.fire/m; |
#!/usr/bin/env bash | |
# see https://forum.obsidian.md/t/gnome-desktop-installer/499 | |
set -euo pipefail | |
icon_url="https://cdn.discordapp.com/icons/686053708261228577/1361e62fed2fee55c7885103c864e2a8.png" | |
#dl_url=${1:-} | |
dl_url=$( curl -s https://api.github.com/repos/obsidianmd/obsidian-releases/releases/latest \ | |
| grep "browser_download_url.*AppImage" | tail -n 1 | cut -d '"' -f 4 ) |
I hereby claim:
To claim this, I am signing this object:
http4s에서 어떻게 IO#unsafeRunSync
없이 JSON 응답을 반환할 수 있는지 문의가 들어와서 보충설명 드립니다:
슬라이드에서 잠깐 보여드렸던 것처럼 http4s 서버는 Request[F] => F[Response[F]]
형태의 순수 함수입니다. 미들웨어나 루트 합성을 위해 Kleisli
나 OptionT
같은 데이터 타입들이 추가로 쓰이기는 하지만 결국 Request에서 Response로 가는 순수 함수이고, 중간에 데이터베이스 연결 같은 이펙트가 발생할 수 있기 때문에 Request => Response
대신 Request => F[Response]
와 같은 형태를 띄고 있다고 생각하시면 돼요. 아래같은 모듈이라고 생각하셔도 되겠네요.
trait HttpServer[F[_]] {
def handleRequest(req: Request): F[Response]
}
// Using new collection library in Scala 2.13 | |
def nthColumnLabel(n: Int): String = | |
Iterator | |
.unfold(n) { | |
case 0 => None | |
case m => | |
val m2 = m - 1 | |
Some((m2 % 26 + 'A').toChar, m2 / 26) | |
} | |
.mkString |
#!/usr/bin/env amm | |
import $ivy.`org.typelevel::cats-core:1.4.0` | |
import cats.implicits._ | |
import java.net.{URLEncoder, URLDecoder} | |
import scala.util.{Try, Success} | |
val charsets = List("utf-8", "x-windows-949") |
object KoreanJasoDecomposer { | |
/** | |
* 한글 음절 | |
* | |
* @param onset 초성 | |
* @param nucleus 중성 | |
* @param coda 종성 | |
*/ | |
case class Syllable( |