This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear control | |
clear mod1 | |
clear mod4 | |
keycode 64 = Control_L NoSymbol Control_L | |
keycode 133 = Alt_L NoSymbol Alt_L | |
keycode 37 = Super_L NoSymbol Super_L | |
keycode 108 = Control_L NoSymbol Control_L | |
keycode 134 = Alt_L NoSymbol Alt_L |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::io; | |
struct Question { | |
ask: String, | |
answers: Vec<String>, | |
} | |
impl Question { | |
fn new(ask: String, answers: Vec<String>) -> Question { | |
Question { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InstanceHolder<T> { | |
private final List<T> instances = new ArrayList<>(); | |
public void add(T instance) { | |
instances.add(instance); | |
} | |
public T get(Class<? extends T> clazz) { | |
return instances.stream().filter(instance -> instance.getClass().equals(clazz)).findFirst().orElse(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class RandomTeleporter { | |
private final LoadingCache<Pair<Location, Location>, List<Pair<Integer, Integer>>> locationCache = CacheBuilder.newBuilder() | |
.expireAfterAccess(1, TimeUnit.MINUTES) | |
.maximumSize(5) | |
.build(new CacheLoader<Pair<Location, Location>, List<Pair<Integer, Integer>>>() { | |
@Override | |
public List<Pair<Integer, Integer>> load(Pair<Location, Location> bounds) throws Exception { | |
final List<Pair<Integer, Integer>> ret = new ArrayList<>(); | |
final Location bounds1 = bounds.getLeft(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class InstanceManager<T> { | |
private final List<T> instances = new ArrayList<>(); | |
public InstanceManager(Class<T> superclass, String packageSearch) { | |
new Reflections(packageSearch).getSubTypesOf(superclass).forEach(clazz -> { | |
try { | |
instances.add(clazz.newInstance()); | |
} catch (InstantiationException | IllegalAccessException e) { | |
e.printStackTrace(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class AbstractInventory { | |
private static final String SERVER_VERSION = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; | |
private static Method handleInventoryCloseEvent; | |
private static Method getHandle; | |
private static Field defaultContainer; | |
private static Field activeContainer; | |
static { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
read -p "What is the file path? " path | |
read -p "What is the groupId? " groupId | |
read -p "What is the artifactId? " artifactId | |
read -p "What is the version? " version | |
mvn install:install-file -Dfile=$path -DgroupId=$groupId -DartifactId=$artifactId -Dversion=$version -Dpackaging=jar -DgeneratePom=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "----------- [ DELETE SCREEN SESSION ] -----------" | |
screen -ls | |
read -p "Please supply the screen id you would like to delete: " id | |
read -p "Are you sure you want to delete screen $id? [y/N]: " des | |
if [[ $des =~ [yY](es)* ]] | |
then | |
echo "Deleting...." | |
screen -S $id -p 0 -X quit | |
echo "Done!" | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public abstract class AbstractInventory { | |
private static final String SERVER_VERSION = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; | |
private static Method handleInventoryCloseEvent; | |
private static Method getHandle; | |
private static Field defaultContainer; | |
private static Field activeContainer; | |
static { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Announcer { | |
private final String[] announcements; | |
private final int secondsBetween; | |
private BukkitTask announcementTask; | |
public Announcer(int secondsBetween, String... announcements) { | |
this.secondsBetween = secondsBetween; | |
this.announcements = announcements; |