Skip to content

Instantly share code, notes, and snippets.

@Da9el00
Da9el00 / docker-compose.yml
Created February 7, 2023 09:08
How to create a docker-compose setup with PostgreSQL and pgAdmin4
version: "3.8"
services:
db:
container_name: postgres_container
image: postgres
restart: always
environment:
POSTGRES_USER: root
POSTGRES_PASSWORD: root
POSTGRES_DB: test_db
@Da9el00
Da9el00 / HelloApplication.java
Created September 3, 2022 08:15
JavaFX memory matching game
package com.example.memorymatchinggame;
import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class HelloApplication extends Application {
@Da9el00
Da9el00 / MemoryGame.java
Created August 27, 2022 15:53
Java CLI Memory Game
import java.util.*;
public class MemoryGame {
private int turns = 0;
private int points = 0;
private final int boardLength = 3;
private final int boardSize = boardLength * boardLength;
private final Random random = new Random();
@Da9el00
Da9el00 / resizable.fxml
Created August 1, 2022 07:26
JavaFX - Resizable window using h- and v-boxes
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.AnchorPane?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?>
<VBox maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/15.0.1" xmlns:fx="http://javafx.com/fxml/1">
@Da9el00
Da9el00 / MovementController.java
Created July 21, 2022 10:28
JavaFX Animating sprites
import javafx.animation.AnimationTimer;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.fxml.FXML;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.AnchorPane;
public class MovementController {
@Da9el00
Da9el00 / MovementController.java
Last active January 21, 2023 09:45
Moving Spites in JavaFX
import javafx.animation.AnimationTimer;
import javafx.beans.binding.BooleanBinding;
import javafx.beans.property.BooleanProperty;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.fxml.FXML;
import javafx.scene.image.ImageView;
import javafx.scene.input.KeyCode;
import javafx.scene.layout.AnchorPane;
import javafx.scene.shape.Rectangle;
@Da9el00
Da9el00 / Application.java
Created July 6, 2022 17:34
Memory game in JavaFX
package com.example.memorygame;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class Application extends javafx.application.Application {
@Override
@Da9el00
Da9el00 / HelloController.java
Created June 21, 2022 10:56
Javafx alert repeating every x seconds
import javafx.animation.KeyFrame;
import javafx.animation.Timeline;
import javafx.application.Platform;
import javafx.fxml.Initializable;
import javafx.scene.control.Alert;
import javafx.scene.control.ButtonType;
import javafx.util.Duration;
import java.net.URL;
import java.util.Optional;
import java.util.ResourceBundle;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class Application extends javafx.application.Application {
@Override
public void start(Stage stage) throws IOException {
FXMLLoader fxmlLoader = new FXMLLoader(Application.class.getResource("hello-view.fxml"));
@Da9el00
Da9el00 / Application.java
Last active May 29, 2022 17:44
JavaFX Grid-based draggable nodes
package com.example.gridbaseddraggable;
import javafx.fxml.FXMLLoader;
import javafx.scene.Scene;
import javafx.stage.Stage;
import java.io.IOException;
public class Application extends javafx.application.Application {
@Override