Skip to content

Instantly share code, notes, and snippets.

View willies952002's full-sized avatar
💻
Working on Code

willies952002 willies952002

💻
Working on Code
View GitHub Profile
@willies952002
willies952002 / PermissionsEx.java
Created September 11, 2015 08:56
so.. I was going through the PermissionsEx source and found this xD
public boolean isDay() {
final Calendar cal = Calendar.getInstance();
return cal.get(Calendar.MONTH) == Calendar.APRIL && cal.get(Calendar.DAY_OF_MONTH) == 1;
}
@Override
public void log(LogRecord record) {
record.setMessage("[" + (isDay() ? "PermissionSex" : "PermissionsEx") + "] " + record.getMessage());
super.log(record);
}
//Old
public static String color(String m) {
return m.replaceAll("(?i)&([a-f0-9])", "\u00A7$1");
}
//New
public static String color(String m) {
return m.replaceAll("(?i)&([0-9a-fk-or])", "\u00A7$1");
}
@willies952002
willies952002 / Util.java
Created October 20, 2015 05:35
Method for Making a String us Proper Case
public static String toProperCase(String s) {
return s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase();
}
@willies952002
willies952002 / TaskChain.java
Created October 20, 2015 05:59 — forked from aikar/TaskChain.java
TaskChain v2 - Java 8 Version - Released Open Source Under MIT
/*
* Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
*
* MIT License:
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to use,
* copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
* Software, and to permit persons to whom the Software is furnished to do so,
public static String getCurrentName(UUID uuid) throws Exception {
final String uuidstr = Util.replace(uuid.toString(), "-", "");
String url = "https://api.mojang.com/user/profiles/" + uuidstr + "/names";
final String result = NetUtil.get(url);
if (result == null || result.isEmpty()) {
throw new IllegalStateException("Mojang API Returned empty response: " + result);
}
JSONArray names = (JSONArray) JSONValue.parse(result);
JSONObject last = (JSONObject) names.get(names.size() - 1);
if (last == null || last.isEmpty()) {
/*
* Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.util;
import com.empireminecraft.config.EmpireConfig;
#!/bin/bash
function xdt {
xdotool "$@"
}
function getobs {
xdotool search --onlyvisible --class obs | head -n 1
}
export xdt
function getcurrentx {
@willies952002
willies952002 / motd.txt
Created October 25, 2015 12:11
IRC MOTD for elmer.spi.gt
[07:20.05] -
[07:20.05] - mmmmmmmm mmmm
[07:20.05] - ##"""""" ""##
[07:20.05] - ## ## ####m##m m####m ##m####
[07:20.05] - ####### ## ## ## ## ##mmmm## ##"
[07:20.05] - ## ## ## ## ## ##"""""" ##
[07:20.05] - ##mmmmmm ##mmm ## ## ## "##mmmm# ##
[07:20.05] - """""""" """" "" "" "" """"" ""
[07:20.05] -
[07:20.05] - My name is Elmer J. Fudd. Miwwionaire.
processor : 0
vendor_id : AuthenticAMD
cpu family : 21
model : 1
model name : AMD FX(tm)-8150 Eight-Core Processor
stepping : 2
microcode : 0x600063d
cpu MHz : 1400.000
cache size : 2048 KB
physical id : 0
@willies952002
willies952002 / CommandCompletions.java
Created October 31, 2015 10:28 — forked from aikar/CommandCompletions.java
Latest Empire Command System
/*
* Copyright (c) 2015. Starlis LLC / dba Empire Minecraft
*
* This source code is proprietary software and must not be redistributed without Starlis LLC's approval
*
*/
package com.empireminecraft.commands;
import com.empireminecraft.config.EmpireServer;