Skip to content

Instantly share code, notes, and snippets.

View LaurentLegrand's full-sized avatar

Laurent Legrand LaurentLegrand

View GitHub Profile
@LaurentLegrand
LaurentLegrand / build.sc
Created April 5, 2024 12:26
[mill] build.sc frontend/shared/backend
import mill._
import mill.scalalib._
import mill.scalajslib._
import mill.util.Jvm
import $ivy.`io.github.nafg.millbundler::jsdeps::0.1.0-44-2b55ad-SNAPSHOT`,
io.github.nafg.millbundler.jsdeps._
import $ivy.`io.github.nafg.millbundler::millbundler::0.1.0-44-2b55ad-SNAPSHOT`,
io.github.nafg.millbundler._
@LaurentLegrand
LaurentLegrand / CodeGenApp.sc
Created April 5, 2024 12:14
[scala-cli][jooq][testcontainers] Call JOOQ scala code generator with scala-cli and testcontainers
//> using dep org.testcontainers:postgresql:1.19.3
//> using dep org.postgresql:postgresql:42.6.0
//> using dep org.jooq:jooq-codegen:3.19.4,
//> using resourceDir db/resources
import org.testcontainers.containers.*
import org.jooq.codegen.GenerationTool
import org.jooq.meta.jaxb.*
@LaurentLegrand
LaurentLegrand / fstab
Created March 16, 2015 08:03
cygwin /etc/fstab
# /etc/fstab
#
# This file is read once by the first process in a Cygwin process tree.
# To pick up changes, restart all Cygwin processes. For a description
# see https://cygwin.com/cygwin-ug-net/using.html#mount-table
# This is default anyway:
none /cygdrive cygdrive binary,noacl,posix=0,user 0 0
c: /c some_fs binary,noacl,posix=0,user 0 0
@LaurentLegrand
LaurentLegrand / sbtopts
Created March 16, 2015 08:01
SBT configuration file
# ------------------------------------------------ #
# The SBT Configuration file. #
# ------------------------------------------------ #
# Disable ANSI color codes
#
#-no-colors
# Starts sbt even if the current directory contains no sbt project.
@LaurentLegrand
LaurentLegrand / remove-empty-dirs.bash
Last active December 31, 2015 04:29
Removing empty directories
find . -type d -empty -print0 | xargs -0 rm -rvf
@LaurentLegrand
LaurentLegrand / ExtensionLoader.java
Last active December 18, 2015 16:59
A simple method that load extensions provided by eclipse plug-ins.
class ExtensionLoader {
/**
* Load instances of an extension point
*
* @param id the extension point id
* @param type the class or interface the instances conform to
* @param instances the collection in which instances will be added
*
* @return the instances collection
@LaurentLegrand
LaurentLegrand / EPackageToJson.xtend
Last active December 18, 2015 16:09
Generating a JSON document with XTend and the Java API for JSON Processing.
class EPackageToJSon {
def render(EPackage self) {
val List<EClass> nodes = newArrayList
self.EClassifiers.filter(typeof(EClass)).forEach[fill(nodes, it)]
val out = new StringWriter
val graph = Json::createGenerator(out)
graph.writeStartObject