Skip to content

Instantly share code, notes, and snippets.

@Da9el00
Da9el00 / pom.xml
Last active March 3, 2025 15:28
Plugin to make JavaFX executable jar with Maven
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
@jeszy75
jeszy75 / jshell_en.md
Last active February 28, 2025 08:21
Working with JShell

Working with JShell

What is JShell?

JShell is a tool that lets you execute Java code interactively. It is part of the JDK, starting with Java SE 9.

Commands

JShell commands control the environment and display information within a session.

@HanSolo
HanSolo / Detector.java
Last active March 27, 2025 15:44
Detector: A plain Java class that offers some utility methods to detect dark theme on MacOS and Windows
import javafx.scene.paint.Color;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.StringWriter;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
@mrtcmn
mrtcmn / workaround.css
Created November 27, 2020 15:04
firefox backdrop-filter workaround
@supports (-webkit-backdrop-filter: none) or (backdrop-filter: none) {
.blurred-container {
-webkit-backdrop-filter: blur(10px);
backdrop-filter: blur(10px);
}
}
/* slightly transparent fallback for Firefox (not supporting backdrop-filter) */
@supports not ((-webkit-backdrop-filter: none) or (backdrop-filter: none)) {
.blurred-container {
@Anon-Exploiter
Anon-Exploiter / .zshrc
Created September 17, 2020 12:31
.zshrc of Kali Linux 2020.3 including the lit prompt
# ~/.zshrc file for zsh non-login shells.
# see /usr/share/doc/zsh/examples/zshrc for examples
setopt autocd # change directory just by typing its name
#setopt correct # auto correct mistakes
setopt interactivecomments # allow comments in interactive mode
setopt ksharrays # arrays start at 0
setopt magicequalsubst # enable filename expansion for arguments of the form ‘anything=expression’
setopt nonomatch # hide error message if there is no match for the pattern
setopt notify # report the status of background jobs immediately
@speratus
speratus / commands.sh
Created May 29, 2020 13:46
An example of a systemd service for starting and stopping a postgres server installed from Homebrew.
#!/bin/bash
# Run these commands after creating your service file to get it installed and running.
# Once the service file is finished, copy it to the correct directory.
# In Ubuntu based systems, this is usually /etc/systemd/system.
sudo cp postgres.service /etc/systemd/service
# Now try starting the service:
sudo systemctl start postgres.service
@chronitis
chronitis / jupyter_kernel_list.md
Last active May 28, 2025 10:58
Updated Jupyter Kernels page

What is a kernel?

The kernel lets you run code in a particular programming language using one of the Jupyter tools, such as the Notebook, Jupyterlab or nteract. Installing additional kernels will let you run code in more languages using your existing jupyter installation.

Technically, the kernel is an application which speaks the Jupyter Messaging Protocol, to receive code input from the frontend and respond with the results.

Which kernels do I have installed?

In the Notebook or JupyterLab, the list of available kernels will be shown when trying to create a new notebook.

@dirkarnez
dirkarnez / InterceptorConfig.java
Created March 22, 2019 16:12
Java Spring Boot - enable xml declaration tag
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
@Bean
public MappingJackson2XmlHttpMessageConverter mappingJackson2XmlHttpMessageConverter(
Jackson2ObjectMapperBuilder builder) {
ObjectMapper mapper = builder.createXmlMapper(true).build();
((XmlMapper) mapper).enable(ToXmlGenerator.Feature.WRITE_XML_DECLARATION);
return new MappingJackson2XmlHttpMessageConverter(mapper);
@rponte
rponte / XmlSerializer.java
Last active March 27, 2025 23:42
Example of how to serialize/deserilize an Object to XML using JAXB
package br.com.rponte.util.xml;
import java.io.File;
import java.io.FileInputStream;
import java.io.InputStreamReader;
import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import javax.xml.bind.JAXBContext;

The PATH is an important concept when working on the command line. It's a list of directories that tell your operating system where to look for programs, so that you can just write script instead of /home/me/bin/script or C:\Users\Me\bin\script. But different operating systems have different ways to add a new directory to it:

Windows

  1. The first step depends which version of Windows you're using:
  • If you're using Windows 8 or 10, press the Windows key, then search for and