Skip to content

Instantly share code, notes, and snippets.

@malteneuss
malteneuss / build.sbt
Created April 27, 2021 10:01
sbt multi-project Scala with Scalajs and sbt-web-scalajs-bundler plugin example
ThisBuild / organization := "com.org"
ThisBuild / scalaVersion := "2.13.5"
ThisBuild / version := "0.1.0-SNAPSHOT"
cancelable in Global := true
lazy val root = (project in file("."))
.aggregate(server, client, sharedJvm, sharedJs)
lazy val server = (project in file("server"))
@malteneuss
malteneuss / Dockerfile
Created April 28, 2022 19:43
Nextjs + Prisma DB (query and migrations) in Docker
# Adapted from https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
# Install dependencies only when needed
FROM node:16-alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
# Rebuild the source code only when needed
@malteneuss
malteneuss / Plantuml-Watchexec-Live-edit-command
Last active December 20, 2022 18:38
Live-edit plantuml with auto-reload within single line of watchexec
SOURCE="test.puml"; TARGET="test.png"; watchexec -f $SOURCE "plantuml $SOURCE && ristretto $TARGET"
# We need an app to trigger a rebuilds our sourcecode file into a target image file whenever our source file changes:
# watchexec
# Source https://github.com/watchexec/watchexec
#
# We need a light-weight,fast, non-flashing image-viewer that auto-reloads what we see whenever the target image file changes:
# ristretto
# Source https://github.com/xfce-mirror/ristretto but you could also try out other like
# feh
@malteneuss
malteneuss / Pandoc-Revealjs-slides-with-plantuml-and-math.sh
Last active December 27, 2022 13:54
How to create rapid programming slides in Markdown with support for PlantUML, Math and two column layout using Pandoc.
pandoc --to revealjs --filter pandoc-plantuml --standalone slides.md --output out.html --katex
# Needs the "pandoc-plantuml" filter installed.
# Uses "katex" for rendering math in html
# (fastest and works reliably for Latex syntax,
# "Mathjax" has support for Asciimath syntax but this syntax seems dead and has bad alignment support,
# "MathML" converter doesn't work for many Latex symbols).
#
@malteneuss
malteneuss / auto-upgrade
Created July 8, 2023 21:36
NixOS daily self-upgrading server config module for flake from different server
# Server module that checks itself daily for new config from Github flake
# source https://github.com/tfc/nixos-configs/blob/9dafd84c6de87835ca6966dae1c4c0603020c517/system-modules/auto-upgrade.nix
{ ... }:
{
system.autoUpgrade = {
enable = true;
flake = "github:tfc/nixos-configs";
flags = [ " --no-write-lock-file" ];
allowReboot = true;
@malteneuss
malteneuss / github-action-periodic-bump-flake-lock.yml
Last active July 22, 2023 08:56
Github Action Periodic Bump flake.lock
# after https://github.com/reckenrode/nixos-configs/blob/f61d83e56ed7569c31ca67591bcf7856f1b8ac4a/.github/workflows/main.yml
name: Bump flake.lock
on:
schedule:
- cron: "0 6 * * *"
# Manually
workflow_dispatch: