This is how I like to use webjars in kotlin.
build.gradle.kts dependencies:
dependencies {
// webjars
implementation("org.webjars:webjars-locator:0.46")
implementation("org.webjars.npm:htmx.org:1.9.2")
}
// This is meant to be in a html head script tag | |
// checkboxes are very inconvenient in html and will serialize nothing when the checkbox is unchecked | |
// instead of using hx-vals and writting a bit of JSON each time you have a checkbox I decided to fix it globally: | |
window.onload = function() { | |
document.body.addEventListener('htmx:configRequest', function(evt) { | |
const isInput = evt.detail.elt.tagName == 'INPUT'; | |
const isCheckbox = evt.detail.elt.type == 'checkbox'; | |
const isNotChecked = evt.detail.elt.checked == false; | |
if(isInput && isCheckbox && isNotChecked) { | |
const name = evt.detail.elt.name; |
This is how I like to use webjars in kotlin.
build.gradle.kts dependencies:
dependencies {
// webjars
implementation("org.webjars:webjars-locator:0.46")
implementation("org.webjars.npm:htmx.org:1.9.2")
}
import kotlin.math.pow | |
fun fastInverseSqrt(number: Float): Float { | |
val ieee754FloatBits = number.toBits() // evil floating point bit hack, avoided | |
val invSqrt = Float.fromBits(0x5f3759df - (floatsBits shr 1)) // what the fish | |
return invSqrt * (1.5F - (0.5F * number * invSqrt * invSqrt)) // Newton iteration | |
} |
She has previously taken lessons and recently decided to take them again. Good tone but needs to readjust to the violin a gain more dexterity/confidence. For personal reasons she may also need to stop taking lessons for a while, so resources are being shared for independent practice.
import org.eclipse.jetty.http.HttpStatus | |
import java.time.LocalDateTime | |
fun main(args: Array<String>) { | |
val arg = Args.valueOf(args[0]) | |
val port = System.getenv("PORT") ?: "8080" | |
if (arg.isRegenerate()) { | |
val serverArg = getRequestArg(port) | |
with(EnvContext(serverArg, port, webPlugins)) { | |
generate()// Here I generate my static website |
The MIT License (MIT) | |
Copyright (c) 2014-2015 John Otander | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |
val chapter1 = mapOf( | |
"2 + 2" to "4", | |
"0 + 2" to "2", | |
) | |
val chapters = chapter1// + chapter2 + chapter3 | |
fun main() { | |
while (true) { | |
val shuffledQuestions = chapters.keys.shuffled() |
(G Major)
A
| A3A4 A3A1 A2A3 A2A0 | D3 E12 D3 xx | A2A3 A2A0 A1A2 A1D3 | A0 A#23 D0 xx |
A'
| A3A4 A3A1 A2A3 A2A0 | D3 E12 D3 xx | A1 D3D1 D3 D1G#3 | D0 A#23 D0 xx |
B
Conceptualized by Alistair Cockburn. Also known as "Ports and Adapters".
In a nutshell:
Application Driver -> Primary Adapter -> Primary Port -> Use Case -> Secondary Port -> Secondary Adapter -> External System/Side Effect