Skip to content

Instantly share code, notes, and snippets.

View DenWav's full-sized avatar
☂️
Hi

Kyle Wood DenWav

☂️
Hi
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<resourceExtensions />
<wildcardResourcePatterns>
<entry name="!?*.java" />
<entry name="!?*.form" />
<entry name="!?*.class" />
<entry name="!?*.groovy" />
<entry name="!?*.scala" />
@DenWav
DenWav / edify
Created September 18, 2015 17:35
assert(getprop("ro.product.device") == "hammerhead" || getprop("ro.build.product") == "hammerhead" || abort("This package is for device: hammerhead; this device is " + getprop("ro.product.device") + "."););
ifelse(is_mounted("/system"), unmount("/system"));
package_extract_dir("install", "/tmp/install");
set_metadata_recursive("/tmp/install", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0644);
set_metadata_recursive("/tmp/install/bin", "uid", 0, "gid", 0, "dmode", 0755, "fmode", 0755);
mount("ext4", "EMMC", "/dev/block/platform/msm_sdcc.1/by-name/system", "/system", "");
run_program("/tmp/install/bin/backuptool.sh", "backup");
unmount("/system");
show_progress(0.750000, 0);
ui_print("Patching system image unconditionally...");
yamlScalar ::= VALUE
yamlFile ::= yamlDocument*
yamlDocument ::= DOCUMENT_START yamlContent* DOCUMENT_END | DOCUMENT_START yamlContent* | yamlContent*
yamlContent ::= yamlBlock | COMMENT
yamlBlock ::= yamlMap | yamlSequence
yamlMap ::= yamlNormalMap | yamlFlowMap
yamlNormalMap ::= yamlKey MAP_SEPARATOR (CRLF | COMMENT)* (yamlBlock | yamlScalar)
@DenWav
DenWav / Stupid.java
Created September 25, 2015 01:18
wat
public static boolean hasMoreVowels(String s) {
if (s.length() == 1)
return "aeiou".contains(s);
boolean removedVowel = false;
boolean removedCons = false;
StringBuilder sb = new StringBuilder();
for (int i = 0; i < s.length(); i++) {
if ("aeiou".contains(s.substring(i, i + 1))) {
if (!removedVowel) {
@DenWav
DenWav / BoardGUI.java
Created November 3, 2015 04:34
wat.jpg
private Position getPosition(JLabel label) {
// This method is proof I am an idiot
String text = "";
Class<BoardGUI> clazz = BoardGUI.class;
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
if (field.getDeclaringClass() == JLabel.class) {
try {
if (field.get(this) == label) {
@DenWav
DenWav / ApiParser.java
Created November 15, 2015 08:01
Weather
public static String getWeather(String loc) throws IOException {
String city;
String state;
String temp;
String humidity;
String wind;
String conditions;
try {
String json = getTextFromUrl(new URL("/* super secret API key stuff */" + encode(loc) + ".json"));
public static String encode(String input) {
StringBuilder resultStr = new StringBuilder();
for (char ch : input.toCharArray()) {
if (isUnsafe(ch)) {
resultStr.append('%');
resultStr.append(toHex(ch / 16));
resultStr.append(toHex(ch % 16));
} else {
resultStr.append(ch);
}
switch (e.getMessage()) {
case "empty":
message = "<html>Please fill in all required fields</html>";
break;
case "bad":
message = "<html>Please enter author and plugin names as a comma separated list</html>";
break;
default:
message = "<html>Unknown Error</html>";
break;
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>spigot</artifactId>
<version>${project.version}</version>
<scope>system</scope>
<systemPath>${project.basedir}/spigot-1.8.8.jar</systemPath>
</dependency>
plugin.getServer().getScheduler().runTask(plugin, new Runnable() {
@Override
public void run() {
final String response = command.playerStatResponse(player, secondaryArgsList);
if (finalPublicCmd) {
String endResponse = ChatColor.valueOf(plugin.config().colors.public_identifier)
+ "@" + sender.getName() + ChatColor.WHITE + ": " + response;
plugin.getServer().broadcastMessage(endResponse);
} else {