Skip to content

Instantly share code, notes, and snippets.

View mcgivrer's full-sized avatar
🌐
Work onto a Platform !

Frédéric Delorme mcgivrer

🌐
Work onto a Platform !
View GitHub Profile
@mcgivrer
mcgivrer / build
Created May 7, 2025 16:17
java micro build with libs
#!/bin/bash
project_name=jdemo
project_version=1.0.0
main_class=App
JARS=
vendor_name=DEMO
author_name="Frédéric Delorme"
#----
GIT_COMMIT_ID=$(git rev-parse HEAD)
JAVA_BUILD=$(java --version | head -1 | cut -f2 -d' ')
@mcgivrer
mcgivrer / build.sh
Created May 7, 2025 16:16
java mini build
#!/bin/bash
# build scripts (c) 2025 Frederic Delorme
#
# Please adapt the `project_name`, `project_version` and `main_class` variables to fit your own project.
# The generated JARs will be named as target/build/[project_name]-[main_class]-[project_version].jar
#
# NOTE: `main_class` is a list of space separated classes to generate as many JAR as listed classes.
#
project_name=javabuildmini
project_version=1.0.0
@mcgivrer
mcgivrer / template_batch_app_class.java
Last active March 7, 2025 19:32
Java Application creation template
package $APP_PACKAGE_NAME;
import java.io.IOException;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Arrays;
import java.util.List;
import java.util.Properties;
import java.util.ResourceBundle;
/**
@mcgivrer
mcgivrer / generateSlideBookCoverFromSheet.gs
Last active December 30, 2024 01:10
Google Apps script to generate slide from spreadsheet data
function generateBookSlideFromDataSheet() {
var presentationTemplateId = '[SLIDE_GOOGLE_DOC_ID]';
var spreadSheetDataId = '[SPREADSHEET_GOOGLE_DOC_ID]';
var dataRange="[DATA_RANGE:'A2:J10']"
var generatedBooksFolderId='[FOLDER_OUTPUT_GOOGLE_DOC_ID]';
var bookdata = Sheets.Spreadsheets.Values.get(spreadSheetDataId,dataRange);
@mcgivrer
mcgivrer / ConfigAttribute.java
Last active October 29, 2024 11:09
Configuration (V2)
public enum ConfigAttribute {
CONFIG_FILE_PATH("configFile",
"cf",
"app.config.filepath",
"The properties file path to be loaded as configuration",
(v) -> v,
"/config.properties"),
TEST_MODE_EXIT("exit", "x",
"app.exit",
"Test mode only auto exit after initialization",
@mcgivrer
mcgivrer / JavaSimpleAppTemplate.java
Last active April 5, 2024 22:15
Java Simple Application Template (batch like)
package com.java.simple.app;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Function;
/**
* Main class for project JavaSimpleAppTemplate
*
@mcgivrer
mcgivrer / README.md
Last active March 7, 2025 21:35
The Java init script gives the opportunity to create simple java project with some build script.

Java init 1.4

The Java init script gives the opportunity to create simple java project with some build script.

UPDATE: add some example usages in help and fix anoying bug.

The created project

  • is a git repository, initialized by default, with global git configured username and email,
  • has its java environment maintained through the sdkman installation tool with a .sdkmanrc file,
@mcgivrer
mcgivrer / BUILD_5.2_README.md
Last active December 31, 2024 14:28
Build v5.2 with properties file to define project.
title version description createdAt author tag
Java Project Build script
5.2
bring a very simple tool to compile java project to a jar file with JAR dependencies, execute unit test and check quality code.
2023-10-23
name email
Frédéric Delorme
<fredericDOTdelormeTgmailDOTcom>
java, build, unit-test, javadoc, doc, wrapjar, zip
@mcgivrer
mcgivrer / Configuration.java
Last active April 8, 2023 16:21
Pure Java implementation for Configruation
/**
* {@link Configuration} loads a properties file and
* let user gather converted value to
* <ul>
* <li>Integer,</li>
* <li>Double,</li>
* <li>Boolean,</li>
* <li>String.</li>
* <li>{@link Dimension} </li>
* <li>{@link Rectangle2D}</li>
@mcgivrer
mcgivrer / BoundingBox.java
Created March 17, 2023 20:43
A Quadtree implementation
/**
* Bounding Box for any object managed by the system.
*
* @author Frédéric Delorme
*/
public class BoundingBox {
/**
* position for the boundingbox.
*/