This file contains 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
My Hero Pool: Ranged Assasin(Chromie, Hanzo, Ming) Brawler (Arthas, Chen, Blaze) Healer(Uther, Deckard, Rehgar, Stukov, brightwing, lili), Specalist(Medivh, The Lost Vikings, Murky, Abathur) |
This file contains 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
find . -name '*\$*' -print |
This file contains 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
kibana stack | |
bin/logstash -ftest-conf.conf -w1 > "../stack-logs/logstash.log" 2>&1 & | |
bin/kibana > "../stack-logs/kibana.log" 2>&1 & | |
bin/elasticsearch -d -p pid | |
sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist | |
sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist |
This file contains 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
<?xml version="1.0" encoding="UTF-8"?> | |
<Configuration status="WARN" xmlns="http://www.w3schools.com"> | |
<Appenders> | |
<!-- TODO: parameterize the pattern and the log level --> | |
<Console name="SysOut" target="SYSTEM_OUT"> | |
<PatternLayout | |
pattern="%d{yyyy-MM-dd HH:mm:ss:sss} %-5p %c{1}:%L - %m%n" /> | |
<Filters> | |
<ThresholdFilter level="warn" onMatch="DENY" |
This file contains 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 CleanUserInputUnitTests{ | |
private static final Pattern HAS_MORE_THAN_SINGLE_SLAHES_PATTERN = Pattern.compile("([^:])\\/+"); | |
@Test | |
public void regexPatternForRemovingSlashesFromBadUrlsWorksCorrectly() { | |
String input = "https://www.google.com//we////super///love/slashes//////in//generated/urls"; | |
String expectedOutput = "https://www.google.com/we/super/love/slashes/in/generated/urls"; | |
Assert.assertEquals(Pattern.compile(HAS_MORE_THAN_SINGLE_SLAHES_PATTERN).matcher(input).replaceAll("$1/"), expectedOutput); |
This file contains 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
# Directories # | |
/build/ | |
/bin/ | |
target/ | |
test-output/ | |
tmp/ | |
screenshots/ | |
# OS Files # | |
.DS_Store |
This file contains 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
@Test | |
public void showJSON(){ | |
String json = "{\"innerObject\":{\"myObjectProp1\":\"prop1\"}, \"myArray\" : [\"one\", \"two\", 1]}"; | |
JsonElement jsonElement = new JsonParser().parse(json); | |
assertTrue(jsonElement.getAsJsonObject().get("innerObject").isJsonObject()); | |
assertTrue(jsonElement.getAsJsonObject().get("myArray").isJsonArray()); | |
assertEquals("one", jsonElement.getAsJsonObject().get("myArray").getAsJsonArray().get(0).getAsString()); | |
assertEquals("two", jsonElement.getAsJsonObject().get("myArray").getAsJsonArray().get(1).getAsString()); | |
assertEquals(1, jsonElement.getAsJsonObject().get("myArray").getAsJsonArray().get(2).getAsInt()); |
This file contains 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
If this is expected to be a non trivial application I would probably use the strategy pattern. | |
public class CommandLineCalculator{ | |
public static void main(String[] args){ | |
CommandLineCalculator commandLineCalculator = new CommandLineCalculator(); | |
int total = 0; | |
int lastValue = 0; |
This file contains 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 com.clinkworks.neptical; | |
import java.io.File; | |
import java.util.Map; | |
import com.clinkworks.neptical.data.file.FileData; | |
import com.clinkworks.neptical.data.loaders.json.JsonDataLoader; | |
import com.clinkworks.neptical.util.PathUtil; | |
import com.google.common.collect.Maps; |
This file contains 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 com.clinkworks.neptical.maven; | |
import org.apache.maven.plugin.AbstractMojo; | |
import org.apache.maven.plugin.MojoExecutionException; | |
import org.apache.maven.plugin.MojoFailureException; | |
import org.apache.maven.plugins.annotations.Mojo; | |
import com.clinkworks.neptical.Data; | |
import com.clinkworks.neptical.DataRegistry; |
NewerOlder