Skip to content

Instantly share code, notes, and snippets.

@xerial
xerial / karabiner-cursor-mode.json
Last active June 9, 2023 03:37
Karabiner Cursor Mode Setting. Put this file in ~/.config/karabiner/assets/complex_modifications/
{
"title": "Cursor-mode layout for saving your little fingers",
"rules": [
{
"description": "Cursor-mode: Enter the cursor mode with left command click. i/j/k/l to arrows. Exit when ctrl/esc/enter/backspace or command+(any) is pressed.",
"manipulators": [
{
"conditions": [
{
"name": "cursor_layout",
@xerial
xerial / ijkl-toggle-mode.json
Last active April 28, 2022 18:44
Karabinar Settings
{
"title": "i/k/k/l Arrows Layer",
"rules": [
{
"description": "Enter i/j/k/l arrow mode with left_command (on) control (off)",
"manipulators": [
{
"conditions": [
{
"name": "ijkl_mode",
@xerial
xerial / README.md
Last active October 18, 2020 04:34
ScalaMatsuri 2020 Unconference: Scala無双 実践編: AirframeとScala + Scala.jsでライブコーディング

Contents

@xerial
xerial / td-spark-usage.md
Last active September 20, 2022 11:19
td-spark usage notes

td-spark usage notes

What You Can Do With td-spark

  • Reading and writing tables in TD through DataFrames of Spark.
  • Running Spark SQL queries against DataFrames.
  • Submitting Presto SQL queries to TD and reading the query results as DataFrame.
  • If you use PySpark, you can use both Spark's DataFrames and Pandas DataFrames interchangeably.
val testDesign = d
.bind[DB].to[InMemoryDB]
.bind[HttpClient].to[InMemoryLogger]
testDesign.build[A] { a => ... }
import wvlet.airframe._
val d = newDesign
.bind[DB].toSingleton
.bind[FluentdLogger].toSingleton
d.build[A] { a => ... }
new A(new DBClient(new ConnectionPool(new DB(…)))
new A(new DBClient(new ConnectionPool(new MemoryDB(…))
package serde
import java.io.{ByteArrayInputStream, ByteArrayOutputStream, ObjectInputStream, ObjectOutputStream}
sealed trait Color
case object RED extends Color
case class A(colors:Seq[Color])
object SerdeTest {
@xerial
xerial / build.sbt
Last active September 23, 2018 04:22
libraryDependencies += "org.wvlet.airframe" %% "airframe-http-finagle" %% "0.66"
import wvlet.airframe.http.finagle._
import com.twitter.finagle.http.Request
// Define API routes. This will read all @Endpoint annotations in MyApi
val router = Router.of[MyApi]
val design =
finagleDefaultDesign
.bind[MyApi].toSingleton // Register API impl
.bind[Router].toInstance(router) // Register http routes