Skip to content

Instantly share code, notes, and snippets.

View EasyG0ing1's full-sized avatar
🚀
Always learning, growing, improving

Michael Sims EasyG0ing1

🚀
Always learning, growing, improving
  • Victorville, CA
  • 09:36 (UTC -07:00)
View GitHub Profile

Compiling Java and JavaFX GraalVM native-images

Build tools

You don't use the Java JDK when building native-images. Instead, you download GraalVM from their web site and it is packaged just like a JDK, complete with all of the usual JDK commands and modules etc. It needs to be set up as your JDK.

Maven of course is also necessary for this discussion but Graal can be compiled with Gradle as well.

Windows

You need some VisualStudio Build tools:

@EasyG0ing1
EasyG0ing1 / CMakeLists.txt
Created May 26, 2023 03:41 — forked from antonagestam/CMakeLists.txt
CLion and Arduino via Platform.io
cmake_minimum_required(VERSION 3.2)
project(YourProject)
add_subdirectory(src)
add_subdirectory(lib)
@EasyG0ing1
EasyG0ing1 / RunBeforeLayer.py
Created November 16, 2022 19:57
Cura Insert Any GCode At Any Layer. Even add multiple lines if you separate them with a comma. From Cura, click on Help, Show Configuration Folder, then copy this file into the scripts folder, restart Cura and you're all done.
from ..Script import Script
import re
class RunBeforeLayer(Script):
def getSettingDataString(self) -> str:
return """
{
"name": "Run Before Layer",
@EasyG0ing1
EasyG0ing1 / Facebook.java
Last active March 16, 2023 09:49
Method to find any repeating patterns inside a String. Output will show each repeating pattern and how many times it repeats.
public class StringPatterns {
//This is used to convert all message contents into original text. It converts the unicode automatically.
private String decodeString(String text) {
Charset targetEncoding = Charset.forName("ISO-8859-1");
String unescapeText = StringEscapeUtils.unescapeJava(text);
return new String(unescapeText.getBytes(targetEncoding), StandardCharsets.UTF_8);
}
}
@EasyG0ing1
EasyG0ing1 / RangeMap.java
Last active March 30, 2022 09:53
A utility class that will take a number and the range that the number belongs in, and re-map it to whatever the equivalent number is in your destination range.It uses the algrebraic method and is flawless. You can literally map any range to any range regardless of where on the number line the range starts and ends.Overloaded methods allow you to…
public class RangeMap {
public static double reMap(double sourceNumber, double fromRangeStart, double fromRangeEnd, double toRangeStart, double toRangeEnd, int decimalPrecision ) {
double deltaA = fromRangeEnd - fromRangeStart;
double deltaB = toRangeEnd - toRangeStart;
double scale = deltaB / deltaA;
double negA = -1 * fromRangeStart;
double offset = (negA * scale) + toRangeStart;
double finalNumber = (sourceNumber * scale) + offset;
int calcScale = (int) Math.pow(10, decimalPrecision);
return (double) Math.round(finalNumber * calcScale) / calcScale;
@EasyG0ing1
EasyG0ing1 / CSSBoxStyles.java
Last active February 18, 2023 17:50 — forked from jewelsea/CSSBoxStyles.java
Applies CSS to a JavaFX pane to create a page turn style shadow effect.
import static javafx.application.Application.launch;
import javafx.application.*;
import javafx.scene.Scene;
import javafx.scene.layout.AnchorPane;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
public class CSSBoxStyles extends Application {
@Override public void start(Stage stage) {
StackPane shadowPane = new StackPane();
@EasyG0ing1
EasyG0ing1 / ListOrganizer.java
Last active June 6, 2022 16:43 — forked from jewelsea/ListOrganizer.java
Use Drag and Drop to reorder items in a JavaFX ListView
import javafx.application.Application;
import javafx.collections.*;
import javafx.geometry.*;
import javafx.scene.Scene;
import javafx.scene.control.*;
import javafx.scene.image.*;
import javafx.scene.input.*;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
@EasyG0ing1
EasyG0ing1 / OffScreenOffThreadCharts.java
Last active November 25, 2021 02:55 — forked from jewelsea/OffScreenOffThreadCharts.java
Render 300 charts off screen and save them to files in JavaFX.
import java.awt.image.BufferedImage;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;
import java.util.logging.*;
import javafx.application.*;
import javafx.beans.binding.*;
import javafx.beans.property.*;
import javafx.beans.value.*;
@EasyG0ing1
EasyG0ing1 / CStringBuilder.java
Last active June 6, 2022 16:02
Custom StringBuilder Class
import java.util.LinkedList;
public class CStringBuilder {
private final StringBuilder masterBuilder = new StringBuilder();
public CStringBuilder() {
}
public CStringBuilder(char[] str) {
@EasyG0ing1
EasyG0ing1 / Router.txt
Last active May 11, 2022 08:13
VLAN Routing Issues
! 24.x.x.x *represents* an ISP assigned public ip address
Current configuration : 15601 bytes
! Last configuration change at 04:18:11 PST Mon Nov 13 2017 by admin
! NVRAM config last updated at 18:01:15 PST Sun Nov 12 2017 by admin
version 15.1