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
| // imports a couple of java tasks | |
| apply plugin: "java" | |
| // List available tasks in the shell | |
| > gradle tasks | |
| // A Closure that configures the sourceSets Task | |
| // Sets the main folder as Source folder (where the compiler is looking up the .java files) | |
| sourceSets { | |
| main.java.srcDir "src/main" |
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
| # Start MongoDB server | |
| > mongod | |
| # Start MongoDB CLI client | |
| > mongodb | |
| # Create or open database "myDatabase" | |
| > use myDatabase | |
| # Show a list of all databases |
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
| // Model a m:n relationship where the corresponding relationship record would be deleted when a entity record is deleted | |
| @Entity | |
| public class Team { | |
| @ManyToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST }, mappedBy="teams") | |
| private List<Match> matches; | |
| } | |
| @Entity | |
| public class Match { | |
| @ManyToMany(cascade = { CascadeType.MERGE, CascadeType.PERSIST }) |
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
| // Enable component-scanning and auto-configuration with @SpringBootApplication Annotation | |
| // It combines @Configuration + @ComponentScan + @EnableAutoConfiguration | |
| @SpringBootApplication | |
| public class FooApplication { | |
| public static void main(String[] args) { | |
| // Bootstrap the application | |
| SpringApplication.run(FooApplication.class, args); | |
| } | |
| } |
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
| # List dependency tree | |
| npm list | |
| npm ls | |
| # List only main dependencies | |
| npm ls --depth=0 | |
| # List outdated dependencies (-l to display dependency type) | |
| npm outdated -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
| # Show status of current changes | |
| git status | |
| # Revert a single file to the last commit | |
| git checkout <filename> | |
| # Checkout pull request from GitHub | |
| git fetch origin pull/<id>/head:<local-branchname-for-pr> | |
| git checkout <local-branchname-for-pr> |
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
| # Show status of current changes | |
| git status | |
| # Revert a single file to the last commit | |
| git checkout <filename> | |
| # Checkout pull request from GitHub | |
| git fetch origin pull/<id>/head:<local-branchname-for-pr> | |
| git checkout <local-branchname-for-pr> |