Skip to content

Instantly share code, notes, and snippets.

View jkoenig134's full-sized avatar
:octocat:

Julian König jkoenig134

:octocat:
View GitHub Profile
@darkhelmet
darkhelmet / balance.go
Created June 16, 2013 05:05
Simple TCP load balancer in Go.
package main
import (
"flag"
"io"
"log"
"net"
"strings"
)
@DarkSeraphim
DarkSeraphim / SkinChanger.java
Last active May 5, 2020 18:37
Notchifier - Thou shall be Notch
package net.darkseraphim.test;
import com.comphenix.protocol.PacketType;
import com.comphenix.protocol.ProtocolLibrary;
import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.wrappers.EnumWrappers;
import com.comphenix.protocol.wrappers.PlayerInfoData;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
@drmalex07
drmalex07 / README-setup-tunnel-as-systemd-service.md
Last active March 15, 2024 15:56
Setup a secure (SSH) tunnel as a systemd service. #systemd #ssh #ssh-tunnel #ssh-forward

README

Create a template service file at /etc/systemd/system/secure-tunnel@.service. The template parameter will correspond to the name of target host:

[Unit]
Description=Setup a secure tunnel to %I
After=network.target
@JohnnyJayJay
JohnnyJayJay / TableBuilder.java
Last active April 25, 2023 10:53
A util class to build table-like Strings in Java. Free to use (see UNLICENSE)
import java.util.Arrays;
import java.util.Objects;
/**
* A utility class that can be used to easily create String tables in Java without any extra frameworks.
* This can be useful to display table-like structures in Discord codeblocks, for example.
*
* <p>If framing is activated, the tables usually look like this (but with box drawing characters):
* <code>
* ------------------------------------
@JohnnyJayJay
JohnnyJayJay / EventExpecter.java
Last active September 12, 2022 03:40
Event Waiter für Spigot und faule Menschen, die Inventar Menüs wollen
package com.github.johnnyjayjay.testplugin;
import org.bukkit.Bukkit;
import org.bukkit.event.Event;
import org.bukkit.event.EventPriority;
import org.bukkit.event.HandlerList;
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
import java.util.function.Consumer;
@stnwtr
stnwtr / HiddenKeyListener.java
Last active March 1, 2019 18:00
HiddenKeyListener for JavaFX
import javafx.event.Event;
import javafx.event.EventHandler;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import java.util.Collections;
import java.util.Optional;
import java.util.Set;
class HiddenKeyListener<T extends Event> implements EventHandler<T> {
import javafx.application.Platform;
import javafx.stage.Stage;
import javafx.stage.WindowEvent;
import java.util.Timer;
import java.util.TimerTask;
public class AnimatedTitle {
public interface Animation {
import java.util.concurrent.TimeUnit;
import java.util.Map;
import java.util.HashMap;
import java.util.function.Function;
public class RateLimiter<T> {
private final long rateLimit;
private final Function<T, ?> keyMapper;
private final Map<?, Long> timestamps;
@Benargee
Benargee / rainbowLog.js
Last active January 1, 2022 17:24
A console.log with a little more... flair.
console.rainbow = function (str) {
const colors = [
"red",
"orange",
"yellow",
"green",
"blue",
"indigo",
"violet",//white in VS Code