Skip to content

Instantly share code, notes, and snippets.

View WesJD's full-sized avatar

Wesley Smith WesJD

View GitHub Profile

Keybase proof

I hereby claim:

  • I am WesJD on github.
  • I am wesjd (https://keybase.io/wesjd) on keybase.
  • I have a public key whose fingerprint is 2D4E 5102 FB35 F44A 5F87 8E31 CC84 19FE 13F1 707C

To claim this, I am signing this object:

@WesJD
WesJD / Properties.java
Last active March 13, 2021 22:31
Simple class for changing Minecraft server properties easily.
public class Properties {
public static void savePropertiesFile() {
((DedicatedServer) MinecraftServer.getServer()).propertyManager.savePropertiesFile();
}
public static void setServerProperty(ServerProperty property, Object value) {
((DedicatedServer) MinecraftServer.getServer()).propertyManager.setProperty(property.getPropertyName(), value);
}
@WesJD
WesJD / removecovid.js
Last active August 31, 2020 03:10
Removes the Covid banner from ELMS
// ==UserScript==
// @name Remove Covid Banner
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Removes the covid banner from on top of Canvas
// @author You
// @match *umd.instructure.com*
// @grant none
// ==/UserScript==

Slap Definitions

Service to slap definitions of words in a sentence together. Let's call a completed sentence a slap.

Problem

Very rarely you'll end up with a nice slap:

input: you're awesome
output: you are extremely impressive or daunting
@WesJD
WesJD / spigot-install-file.sh
Last active March 20, 2019 02:10
Useful for AnvilGUI and its dependencies.
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
@WesJD
WesJD / mapsections.md
Created February 5, 2019 21:49
super craft brothers map sections

scb maps

  • DragonsDescent
  • ClockWork
  • LostTemple
  • NightDragon
  • CandyLand
  • Icefall
  • CherryGrove
  • TreeHouse
MariaDB [(none)]> use michelle;
MariaDB [michelle]> create table items (type VARCHAR(75) NOT NULL, broken BOOL NOT NULL, used BOOL NOT NULL DEFAULT TRUE, got_date TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, last_used TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP);Query OK, 0 rows affected (0.01 sec)
MariaDB [michelle]> DESCRIBE items;
+-----------+-------------+------+-----+-------------------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+-------------------+-------+
| type | varchar(75) | NO | | NULL | |
| broken | tinyint(1) | NO | | NULL | |
| used | tinyint(1) | NO | | 1 | |
import javax.swing.JOptionPane;
public class CarRental {
private CarRental() {
final String make = JOptionPane.showInputDialog("What is the car make?");
final String model = JOptionPane.showInputDialog("What is the car model?");
final String licensePlate = JOptionPane.showInputDialog("What is the license plate value?");
final int digits = Integer.parseInt(licensePlate.substring(4));
@WesJD
WesJD / RandomTeleporter.java
Created August 3, 2016 03:27
Teleport players to random locations with efficiency from Guava
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();
@WesJD
WesJD / instructions.md
Last active March 14, 2017 23:44 — forked from exception/instructions.md
Ubuntu screnshoting for Pxl.lt

Instructions

After creating the screenshot.sh file you shoud:

  • Assign a Key to the screenshot.sh file