Skip to content

Instantly share code, notes, and snippets.

View IdelsTak's full-sized avatar
🖥️
Porting Swing to JavaFX

Hiram Kamau IdelsTak

🖥️
Porting Swing to JavaFX
View GitHub Profile
@IdelsTak
IdelsTak / netbeans-project-types-overview.md
Created July 16, 2024 00:49
Comparison of Gradle and Maven project types for building a Java application

NetBeans Project Types Overview

Gradle Project Types

  1. Java Application
    • Pros: Easy setup, benefits from Gradle's performance optimizations, suitable for simple projects.
    • Cons: Less manageable for large projects, limited structure.
  2. Java Class Library
    • Pros: Ideal for reusable libraries, modular development, efficient dependency management.
  • Cons: Not for standalone applications, requires integration.
@IdelsTak
IdelsTak / image-comparator.md
Created July 3, 2024 15:26
Java class for basic pixel-by-pixel image comparison

Description:

A simple Java class for comparing two images pixel-by-pixel. Determines if the images are visually identical.

Notes:

  • This class relies on java.nio.*; and javafx.scene.image.* functionalities.
  • It performs a strict comparison based on individual pixel values.

Further Considerations:

@IdelsTak
IdelsTak / synchronizing_checkboxes_selections_JavaFX.md
Last active July 2, 2024 21:19
Synchronizing multiple checkboxes with a master checkbox

JavaFX: Batch Selection with Checkboxes

This code shows how to synchronize a master checkbox with detail checkboxes for intuitive batch selection/deselection.

import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.fxml.FXML;
@IdelsTak
IdelsTak / create-mariadb-mysql-database.md
Last active June 24, 2024 15:58
Create Mariadb/MySQL database

Create MariaDB/MySQL database

Given user monty ensure that he has the requisite privileges to create a database

Has privileges

$ mariadb -u monty -p
MariaDB [(none)]> CREATE DATABASE some_db;
@IdelsTak
IdelsTak / ServiceLoader-using-serviceloader-maven-plugin.md
Last active February 4, 2024 12:19
ServiceLoader auto service discovery using serviceloader-maven-plugin in a Maven Project

ServiceLoader auto discovery (that works!) in a maven multi-module project using serviceloader-maven-plugin

Demonstrating how to use the serviceloader-maven-plugin to simplify the ServiceLoader auto service discovery mechanism in a Maven project with loosely coupled modules. (code repo here)

Project Structure

The project is organized into three modules: service, provider, and consumer.

Service Module

@IdelsTak
IdelsTak / generate-serialversionuid.md
Created January 2, 2024 13:26
Generate serialVersionUID Script for Java Classes

Generate serialVersionUID Script for Java Classes

#!/bin/bash

# Check if class file exists
if [ ! -f "$1.class" ]; then
  echo "Error: Class file $1.class not found."
  exit 1
fi
@IdelsTak
IdelsTak / javafx-enable-preview-maven-config.md
Last active January 2, 2024 13:18
Enable java preview features in JavaFX maven project

Enabling Java Preview Features in JavaFX Maven Configuration

Overview

This gist provides a configuration snippet to enable Java preview features when running a JavaFX application using Maven.

Maven Plugin Configuration

To ensure that the preview features are enabled, add the following configuration to the pom.xml file under the appropriate Maven plugin for JavaFX:

@IdelsTak
IdelsTak / project-status-field-settings.md
Created November 30, 2023 03:11
Project Status Field Settings
  • Todo: Not started.
  • In Progress: Actively being worked on.
  • Done: Completed.
  • In Review: Undergoing review.
  • Blocked: Hindered, unable to progress.
  • Bug: Needs fixing.
  • Enhancement: Improving existing features.
  • Feature Request: Suggests new features.
  • Documentation: Tasks related to documentation.
  • Help Wanted: External contributors can help.
@IdelsTak
IdelsTak / simple-java-maven-project.md
Last active October 12, 2023 06:29
Create a simple Java project using Maven on the terminal

Creating a Simple Java Project Using Maven in Terminal

In this tutorial, we will walk through the process of creating a simple Java project using Maven from the terminal.

Prerequisites

  • Java Development Kit (JDK) installed on your system
  • Maven installed on your system

Steps