This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example from https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html | |
import scala.collection.mutable.ListBuffer | |
import scala.util.chaining.* | |
class Transaction: | |
private val log = ListBuffer[String]() | |
private var aborted = false | |
private var committed = false | |
def println(s: String): Unit = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> { } }: | |
(pkgs.buildFHSUserEnv { | |
name = "DungeonDraftFhs"; | |
targetPkgs = pkgs: | |
with pkgs; [ | |
alsaLib | |
libglvnd | |
pulseaudioLight | |
] ++ (with xlibs; [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {}}: | |
(pkgs.buildFHSUserEnv { | |
name = "OtherWorldMapper-FHS"; | |
targetPkgs = pkgs: with pkgs; [ | |
gtk2-x11 | |
xorg.libX11 | |
expat | |
util-linux | |
pango |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.ByteArrayOutputStream | |
import java.nio.charset.StandardCharsets | |
import java.nio.file.{Path, Paths} | |
import java.util.zip.{ZipEntry, ZipOutputStream} | |
import akka.NotUsed | |
import akka.actor.ActorSystem | |
import akka.stream.{ActorMaterializer, IOResult} | |
import akka.stream.scaladsl.{FileIO, Flow, Keep, Source} | |
import akka.util.ByteString |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: with pkgs.dockerTools; | |
let | |
someBaseImage = pullImage { | |
imageName = "nixos/nix"; | |
imageDigest = "sha256:1b97dc98b599779d80271d4203275627c0749d8bd5e9b9c868154249395cbc1b"; | |
sha256 = "134h20xgpqchcvgv0f13knsi2p7jfl4m9mk8hkvdgh8hnz0hj3hc"; | |
}; | |
in | |
buildImage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {} }: with pkgs.dockerTools; | |
let | |
someBaseImage = pullImage { | |
imageName = "nixos/nix"; | |
imageDigest = "sha256:1b97dc98b599779d80271d4203275627c0749d8bd5e9b9c868154249395cbc1b"; | |
sha256 = "134h20xgpqchcvgv0f13knsi2p7jfl4m9mk8hkvdgh8hnz0hj3hc"; | |
}; | |
in | |
buildImage { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgs ? import <nixpkgs> {}}: with pkgs; | |
let | |
libPath = stdenv.lib.makeLibraryPath (with pkgs.xorg; [ | |
alsaLib | |
atk | |
cairo | |
cups | |
dbus_daemon.lib | |
expat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run this command to build the pdf: | |
# > nix-shell --pure shell.nix --command 'cd src; make' | |
{ pkgs ? import <nixpkgs> {} }: with pkgs; | |
mkShell { | |
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ inconsolata-lgc libertine libertinus ]; }; | |
buildInputs = [ | |
(texlive.combine { | |
inherit (texlive) | |
fvextra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// -*- compile-command: "scalafmt Code.scala && amm Code.scala" -*- | |
/* | |
Code for the Java-Magazin Article | |
Author: Markus Hauck, codecentric AG | |
You can execute this using ammonite (http://ammonite.io/#Ammonite-REPL) | |
> amm Code.scala | |
Alternatively, you can take all $ivy imports and build an sbt project yourself | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Nix build file for Desktop Dungeons | |
# nix-build --argstr savesDir ~/DDSaves DesktopDungeons.nix | |
{ pkgs ? import <nixpkgs> { system = "i686-linux";} | |
, savesDir | |
}: with pkgs; | |
assert lib.pathExists savesDir; | |
stdenv.mkDerivation rec { | |
name = "desktop-dungeons"; |
NewerOlder