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
## Postfix templates for use with Custom Postfix Templates plugin for IntelliJ IDEA | |
# combines .new with .var | |
.nv : new var | |
CLASS → $expr$ $var:suggestVariableName()$ = new $expr$();$END$ |
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 dev.ted.junit; | |
import org.junit.jupiter.api.DisplayNameGenerator; | |
import java.lang.reflect.Method; | |
import java.util.regex.Matcher; | |
import java.util.regex.Pattern; | |
public class ReplaceCamelCase extends DisplayNameGenerator.Simple { | |
private final static Pattern CAMEL_CASE_BOUNDARY = Pattern.compile("(([A-Z]?[a-z]+)|([A-Z]))"); |
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
# justfile (see https://just.systems/man/en/ for docs on "just") | |
goal +MESSAGE: | |
git pull --rebase | |
git commit --allow-empty -m "Goal: {{MESSAGE}}" | |
git push | |
commit: | |
@git add . | |
-@git commit -am "wip" |
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
<templateSet group="surround"> | |
<template name="attb" value="org.assertj.core.api.Assertions.assertThatThrownBy(() -> {$SELECTION$}).isInstanceOf($EXCEPTION$);$END$" shortcut="NONE" description="Surround with assertThatThrownBy" toReformat="true" toShortenFQNames="true" useStaticImport="true"> | |
<variable name="EXCEPTION" expression="descendantClassesEnum("Exception")" defaultValue="" alwaysStopAt="true" /> | |
<context> | |
<option name="JAVA_CODE" value="true" /> | |
</context> | |
</template> | |
<template name="ast" value="assertThat({$SELECTION$}) .$END$" shortcut="NONE" description="Surround with assertThat" toReformat="true" toShortenFQNames="true"> | |
<context> | |
<option name="JAVA_CODE" value="true" /> |
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
flowchart TD | |
app[Application Layer] | |
domain[Domain Layer] | |
agg[Aggregate] | |
entity[Entity] | |
repo[Repository] | |
vo["Value Object"] | |
aggroot["Aggregate Root"] | |
service[Service] | |
factory[Factory] |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
import javax.swing.*; | |
import java.awt.Color; | |
import java.awt.event.*; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileWriter; | |
import java.io.IOException; | |
import java.text.DecimalFormat; | |
import java.util.Scanner; | |
import java.awt.Font; |
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
Take a look at these two classes: | |
``` | |
class Equity { | |
public Equity(String name) { | |
} | |
} | |
class Stock extends Equity { | |
} |
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
import java.util.List; | |
import java.util.Scanner; | |
import java.util.stream.Collectors; | |
class BlockTokens { | |
public static void main(String[] args) { | |
String text = "Block one.\n" + | |
"Still part of block one.\n" + | |
"Yep, still part of block one.\n" + | |
"\n" + |
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
String text = | |
"```\n" + | |
"public class Stock {\n" + | |
"\n" + | |
"}\n" + | |
"```\n"; | |
text = text.replaceAll("(?s)```(.*?)```", "<pre>$1</pre>"); | |
System.out.println(text); |
NewerOlder