This file contains hidden or 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 TestToggleEnum { | |
enum TestEnum { | |
A, | |
B, | |
C | |
} | |
@Test | |
public void incrementEnum() { |
This file contains hidden or 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 static StackTraceElement getCallingClass() { | |
Class c = new Object(){}.getClass().getEnclosingClass(); | |
String q = Arrays.stream(new Object(){}.getClass().getEnclosingClass().getName().split("\\.")) | |
.limit(2) | |
.collect(Collectors.joining(".")); | |
return Arrays.stream(Thread.currentThread().getStackTrace()) | |
.filter((s) -> s.toString().startsWith(q) && !s.toString().startsWith(c.getName())) | |
.collect(Collectors.toList()) | |
.get(0); | |
} |
This file contains hidden or 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
Windows Registry Editor Version 5.00 | |
[HKEY_CLASSES_ROOT\Directory\shell\powershell] | |
@="Open PowerShell Here" | |
[HKEY_CLASSES_ROOT\Directory\shell\powershell\command] | |
@="powershell -NoExit -Command Set-Location -LiteralPath '%L'" | |
This file contains hidden or 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
package me.joeychor.test; | |
import java.util.function.Supplier; | |
/** | |
* Created by joeychor on 11/16/2015. | |
*/ | |
public class Main { | |
@FunctionalInterface |
This file contains hidden or 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
import sys, argparse, time, telnetlib | |
try: | |
import socks | |
except ImportError: | |
print("Proxy support is disabled.") | |
parser = argparse.ArgumentParser() | |
parser.add_argument("-e", "--email", help="The email to check") | |
parser.add_argument("-n", "--nameserver", help="The email server") | |
parser.add_argument("-p", "--nsport", help="The server port", type=int) | |
parser.add_argument("-t", "--timeout", help="The timeout in seconds", type=int) |