Skip to content

Instantly share code, notes, and snippets.

View raquo's full-sized avatar

Nikita Gazarov raquo

View GitHub Profile
(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)
@felher
felher / SplitEnum.scala
Created October 18, 2022 15:23
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))
@dacr
dacr / gatling-simple.sc
Last active April 2, 2023 10:12
Just ONE ammonite script file to execute a load performance test using gatling ! / published by https://github.com/dacr/code-examples-manager #ea7a4259-9461-44a8-99fa-1ec6ec3c48ed/6bc5335f1571c83edc6278c55499c9c7ae43a5c0
// summary : Just ONE ammonite script file to execute a load performance test using gatling !
// keywords : scala, gatling, ammonite, scala, load-test, performance
// publish : gist
// authors : David Crosson
// license : Apache NON-AI License Version 2.0 (https://raw.githubusercontent.com/non-ai-licenses/non-ai-licenses/main/NON-AI-APACHE2)
// id : ea7a4259-9461-44a8-99fa-1ec6ec3c48ed
// created-on : 2018-09-22T07:41:07Z
// managed-by : https://github.com/dacr/code-examples-manager
// execution : scala ammonite script (http://ammonite.io/) - run as follow 'amm scriptname.sc'

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.

Jitpack

https://jitpack.io

For testing purposes, the easiest way to go is jitpack:

resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.User" % "Repo" % "Tag"
/**
* jQuery 2.1.3's parseHTML (without scripts options).
* Unlike jQuery, this returns a DocumentFragment, which is more convenient to insert into DOM.
* MIT license.
*
* If you only support Edge 13+ then try this:
function parseHTML(html, context) {
var t = (context || document).createElement('template');
t.innerHTML = html;
return t.content;
@manigandham
manigandham / rich-text-html-editors.md
Last active June 2, 2025 03:59
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

@haasn
haasn / about:config.md
Last active September 25, 2025 20:46
Firefox bullshit removal via about:config

Firefox bullshit removal

Updated: Just use qutebrowser (and disable javascript). The web is done for.