View .gitconfig_linux
[user] | |
name = [YOUR_NAME] | |
email = [YOUR_EMAIL] | |
[web] | |
browser = firefox | |
[help] | |
format = web | |
[color] | |
ui = auto | |
[color "branch"] |
View printProperties.java
public void printProperties() { | |
RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); | |
List<String> arguments = runtimeMxBean.getInputArguments(); | |
System.out.println(Arrays.toString(arguments.toArray())); | |
} |
View Singleton.java
public final class Singleton { | |
private static final Singleton INSTANCE = new Singleton(); | |
private Singleton() { | |
if (INSTANCE != null) { | |
throw new IllegalStateException("Already instantiated"); | |
} | |
} |
View EnumSingleton.java
public enum EnumSingleton { | |
INSTANCE; | |
private final String[] favoriteSongs = { "Hound Dog", "Heartbreak Hotel" }; | |
public void printFavorites() { | |
System.out.println(Arrays.toString(favoriteSongs)); | |
} | |
View .gitconfig_windows
[user] | |
name = [YOUR_NAME] | |
email = [YOUR_EMAIL] | |
[web] | |
browser = google-chrome | |
[color] | |
ui = auto | |
[color "branch"] | |
current = yellow bold | |
local = green bold |