Skip to content

Instantly share code, notes, and snippets.

View raquo's full-sized avatar

Nikita Gazarov raquo

View GitHub Profile
@raquo
raquo / prop.lisp
Created December 28, 2022 05:02 — forked from betzuka/prop.lisp
(define #erpm_passive_brake 600)
(define #active_brake_current -100.0)
(define #start_current 10.0)
(define #max_current (conf-get 'l-current-max))
(define #freq 50.0)
(define #ramp_time 0.2)
(define #range_current (- #max_current #start_current))
(define #current_step (/ #range_current (* #freq #ramp_time)))
(define #output_current 0.0)
@raquo
raquo / SplitEnum.scala
Created October 18, 2022 22:04 — forked from felher/SplitEnum.scala
Sum-Type Splitter for Laminar with Exhaustiveness-Checks
import com.raquo.laminar.api.L.*
import scala.deriving.*
import scala.compiletime.*
object SplitEnum:
final case class Splitter[A, Todo <: Tuple, O](sig: Signal[A], keyer: A => Int, handlers: Array[Any => O]):
inline def close: Signal[O] =
inline erasedValue[Todo] match
case _: EmptyTuple.type =>
sig.splitOne(keyer)((key, _, subSig) => handlers(key)(subSig))

Thread Pools

Thread pools on the JVM should usually be divided into the following three categories:

  1. CPU-bound
  2. Blocking IO
  3. Non-blocking IO polling

Each of these categories has a different optimal configuration and usage pattern.

@raquo
raquo / html-editors.md
Created April 23, 2019 06:42 — forked from manigandham/rich-text-html-editors.md
Rich text / HTML editors and frameworks

Strictly Frameworks

Abstracted Editors

These use separate document structures instead of HTML, some are more modular libraries than full editors

  • ProseMirror - http://prosemirror.net - supports collaborative editing, offers similar options to Mobiledoc for data structure