Skip to content

Instantly share code, notes, and snippets.

View odornauf's full-sized avatar

Oliver Dornauf odornauf

View GitHub Profile
@odornauf
odornauf / Windows Defender Exclusions for Developer.ps1
Created August 9, 2019 07:14 — forked from nerzhulart/Windows Defender Exclusions for Developer.ps1
Adds Windows Defender exclusions for developers (Visual Studio, JetBrains Rider, IntellIJ Idea, Git, MsBuild, dotnet, mono etc.)
$userPath = $env:USERPROFILE
$pathExclusions = New-Object System.Collections.ArrayList
$processExclusions = New-Object System.Collections.ArrayList
$pathExclusions.Add('C:\Windows\Microsoft.NET') > $null
$pathExclusions.Add('C:\Windows\assembly') > $null
$pathExclusions.Add($userPath + '\AppData\Local\Microsoft\VisualStudio') > $null
$pathExclusions.Add('C:\ProgramData\Microsoft\VisualStudio\Packages') > $null
$pathExclusions.Add('C:\Program Files (x86)\MSBuild') > $null
$pathExclusions.Add('C:\Program Files (x86)\Microsoft Visual Studio 14.0') > $null
@odornauf
odornauf / Enum
Last active July 5, 2018 05:17
Java Enums with String values.
public enum aEnum {
aValue ("value"),
aOtherValue ("string for value"),
aAddValue ("another value");
private final String name;
private aEnum(String name) {
this.name = name;
}
@odornauf
odornauf / Logging.java
Last active July 5, 2018 05:17
Clean log with Apache Log4j2 and Java 8 Lambdas
import lombok.extern.log4j.Log4j2;
@Log4j2
public class CSysFormular {
public void preJava8() {
String parameter1 = "test";
// Log only if log level equal or above debug
if (logger.isDebugEnabled()) {