Skip to content

Instantly share code, notes, and snippets.

@fumokmm
fumokmm / opeOverrideTest.groovy
Created May 28, 2011 16:06
Groovy's operator override Test.
class NumHolder {
int num = 0
def plus(int n) { num += n; println 'puls!'; this }
def minus(int n) { num -= n; println 'minus!'; this }
def negative() { num = -num; println 'negative!'; this }
}
def nh = new NumHolder()
assert 0 == nh.num
nh += 1
@taichi
taichi / code_reading.md
Last active April 10, 2024 13:04
太一のコードの読み方メモ

太一のコードの読み方メモ

全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。

コードを読むとは何か

  • コードを嗜む
  • コードを学ぶ
  • 武器を手に入れる
@carlosedp
carlosedp / httpserver.scala
Last active March 20, 2024 00:57
Scala ZIO-HTTP with logback and GraalVM native-image binary support
// Run with scala-cli httpserver.scala
// Save logback.xml file into ./resources dir
// Before generating native image binary, run first as above and make a real access to the URL
// so the native-image-agent can generate the metadata in ./resources dir.
// Then generate native image binary with: scala-cli package --native-image httpserver.scala
//> using scala "3.3.0"
//> using lib "dev.zio::zio:2.0.15"
//> using lib "dev.zio::zio-http:3.0.0-RC2"
//> using lib "dev.zio::zio-logging-slf4j2::2.1.13"
//> using lib "ch.qos.logback:logback-classic:1.4.8"