Skip to content

Instantly share code, notes, and snippets.

Julian König jkoenig134

Block or report user

Report or block jkoenig134

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View RateLimiter.java
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;
View AnimatedTitle.java
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 {
@stnwtr
stnwtr / HiddenKeyListener.java
Last active Mar 1, 2019
HiddenKeyListener for JavaFX
View HiddenKeyListener.java
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> {
@JohnnyJayJay
JohnnyJayJay / EventExpecter.java
Last active Sep 2, 2019
Event Waiter für Spigot und faule Menschen, die Inventar Menüs wollen
View EventExpecter.java
import org.bukkit.event.Event;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
@JohnnyJayJay
JohnnyJayJay / TableBuilder.java
Last active Apr 10, 2019
A util class to build table-like Strings in Java.
View TableBuilder.java
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>
* ------------------------------------
@DarkSeraphim
DarkSeraphim / SkinChanger.java
Last active Dec 30, 2018
Notchifier - Thou shall be Notch
View SkinChanger.java
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;
@soheilhy
soheilhy / nginxproxy.md
Last active Oct 18, 2019
How to proxy web apps using nginx?
View nginxproxy.md

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@darkhelmet
darkhelmet / balance.go
Created Jun 16, 2013
Simple TCP load balancer in Go.
View balance.go
package main
import (
"flag"
"io"
"log"
"net"
"strings"
)
You can’t perform that action at this time.