Skip to content

Instantly share code, notes, and snippets.

View deanveloper's full-sized avatar
💥

Dean deanveloper

💥
View GitHub Profile
### Keybase proof
I hereby claim:
* I am unon1100 on github.
* I am unon1100 (https://keybase.io/unon1100) on keybase.
* I have a public key whose fingerprint is 32B9 F13D C3B0 9018 4ADA F7E0 35E6 612C 78E9 D1E1
To claim this, I am signing this object:
@deanveloper
deanveloper / ProxyRunnable.java
Last active April 25, 2020 14:44
Easy way to create runnable stuff in BungeeCord, compatible with lambdas as well.
//JAVA 8
import net.md_5.bungee.api.ProxyServer;
import net.md_5.bungee.api.scheduler.ScheduledTask;
import java.util.concurrent.TimeUnit;
@FunctionalInterface
public interface ProxyRunnable extends Runnable{
default ScheduledTask runAsync(){
@deanveloper
deanveloper / Mouse Tester
Created March 19, 2015 03:46
Idk my mouse wheel seems broken so I made this to test it
import javax.swing.*;
public class Tests{
public static void main(String[] args){
JFrame frame = new JFrame("mouse wheel test");
frame.setBounds(30, 30, 300, 300);
JLabel status = new JLabel("nothing");
frame.add(status);
status.setLocation(50, 50);
frame.addMouseWheelListener(e -> {
@deanveloper
deanveloper / Problem.java
Last active August 29, 2015 14:17
A problem that I will give to my AP computer science class to solve
import java.text.NumberFormat;
import java.util.Locale;
public class Problem{
static int test = 0;
static boolean complete = false;
public static void main(String[] args){
new Thread(){
@Override
@deanveloper
deanveloper / Tests.java
Created April 12, 2015 14:36
2 Tests involving the speeds of Streams, Parallel Streams, with and without lambdas, and comparing it to doing it the normal way (without streams). It's also worth noting that this only compares .filter() and .map() operations. TL;DR Streams w/o lambdas are fastest on a smaller scale, Streams w/ lambdas are faster on a large scale, doing it the …
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collectors;
public class Tests{
static Random rand = new Random();
package net.mcpz.splatoon.weapons;
import net.mcpz.pzcore.api.inventory.InteractiveItem;
import net.mcpz.splatoon.Splatoon;
import net.mcpz.splatoon.utils.TeamColor;
import org.bukkit.Material;
import org.bukkit.entity.EnderPearl;
import org.bukkit.entity.Player;
import org.bukkit.entity.Projectile;
import org.bukkit.entity.Snowball;
dance: while(!person.isDancing()) {
break dance;
}
person.dance();
@deanveloper
deanveloper / MainClass.java
Created January 20, 2016 17:29
Check efficiency of a bogosort
package me.dean;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class MainClass {
private static List<Byte> deck = new ArrayList<>();
public static void main(String[] args) {
@deanveloper
deanveloper / Test.java
Created January 23, 2017 20:28
Boy howdy do you have to love iteration in Java.
package com.deanveloper;
import java.util.ArrayList;
import java.util.List;
/**
* @author Dean B <dean@deanveloper.com>
*/
public class Test {
public static void main(String[] args) {
// the A in front of the file name is just to keep this on top in the gist lol
inline fun <reified T> testReified(obj: T) {
// None of these are possible in Java because of Type Erasure
if (obj is Int) {
println(5 + obj)
} else {
println(obj)
}
val x = 5