Skip to content

Instantly share code, notes, and snippets.

@megri
megri / app-root: index.html
Last active March 24, 2024 08:29
Simple Indigo config with hot reloading
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'">
<meta charset="UTF-8">
<title>Hello, Indigo!</title>
<style>
body {
padding: 0;
@megri
megri / build.sc
Created March 27, 2024 20:58
Mill-driven hot-reload for Indigo
import mill._, scalalib._, scalajslib._
import scala.collection.mutable
object ElectronModule {
class Worker(val dstBase: os.Path) extends AutoCloseable {
private val updateTimes = mutable.Map[os.Path, Long]()
private var process: os.SubProcess = null
@megri
megri / build.sc
Last active May 10, 2024 11:41
Scala cli-style inline deps declarations for mill
import mill._, scalalib._
object MyModule extends ScalaModule {
def inlineIvyDeps = T {
def parseDep(usingDepClause: String): Dep = {
val part = usingDepClause.drop("//> using dep ".size)
if (part.startsWith("\"")) Dep.parse(part.tail.init.trim)
else Dep.parse(part.trim)
}
@megri
megri / build.mill
Created January 31, 2025 23:37
Mill Tailwind self-managed integration
trait TailwindModule extends ScalaJSModule {
def tailwindVersion: Target[String] = Task("v3.4.14")
/** Tailwindcss download url. By default autodetected from props os.name and os.arch
*/
def tailwindBinUrl = Task {
def nameMatch(prefix: String) =
sys.props("os.name").toLowerCase.startsWith(prefix.toLowerCase)
val platform =
@megri
megri / gist:6e1a986087b88c1e9fd9797e5f6d6a1e
Created September 29, 2025 11:53
Laminar Tailwind CSS IntelliSense integration
{
"files.watcherExclude": {
"**/target": true
},
"tailwindCSS.experimental.classRegex": [
[
"cls\\s*:=\\s*(\"[^\"]*\")",
"\"([^\"]*\")"
],
[