Skip to content

Instantly share code, notes, and snippets.

View mcgivrer's full-sized avatar

Frédéric Delorme mcgivrer

View GitHub Profile
@mcgivrer
mcgivrer / README.md
Last active February 14, 2026 23:25
Java+Build+Package+JRE to build and package a Java project with Jinput and LWJGL

Build and Package Script

Standalone build script to compile, package and distribute a Java project with natives dependencies like LWJGL and JInput.

Prerequisites

  • Java JDK 25 (or version specified in SOURCE_VERSION)
  • SDKMAN (optional, for automatic Java installation)
  • curl or wget (to download dependencies)
  • zip (to create the distribution archive)

Règles de Codage pour les Scripts Bash

1. Shebang

Commencez chaque script par une ligne shebang pour indiquer l'interpréteur à utiliser :

#!/bin/bash

2. Permissions

Assurez-vous que le script a les permissions d'exécution :

@mcgivrer
mcgivrer / App_Frame_template.java
Last active July 25, 2025 13:34
NJP2 enhanced with frame template a Java Project creator cli command
package ${PACKAGE_NAME};
import java.awt.Color;
import java.awt.Font;
import java.awt.Frame;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
@mcgivrer
mcgivrer / build
Last active January 29, 2026 12:52
java project micro build with libs
#!/bin/bash
#---- project parameters
project_name=[[DEFAULT_APP_NAME]]
project_version=[[DEFAULT_APP_VERSION]]
main_class=[[DEFAULT_MAIN_CLASS]]
vendor_name="[[DEFAULT_VENDOR_NAME]]"
author_name=[[DEFAULT_AUTHOR_NAME]]
JARS=
SOURCE_VERSION="25"
JAR_OPTS="-Xmx512m"
@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,