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
| #!/bin/bash | |
| python -m SimpleHTTPServer |
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
| #!/bin/bash | |
| # Run tests | |
| mvn clean test --fail-never | |
| # Print header | |
| echo | |
| echo "TEST NAME, TESTS COUNT, FAILURES COUNT, ERRORS COUNT, SKIPPED COUNT, TIME ELAPSED" | |
| # Prepare report |
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
| #!/bin/bash | |
| # DESCRIPTION | |
| # ----------- | |
| # | |
| # Produces CSV output like this: | |
| # | |
| # LAST CHANGE TIME, TIME ELAPSED, AUTHOR, BRANCH | |
| # 2017-01-16 14:56:26 +0000, 3 months ago, john.doe@example.com, origin/bug-fix-1 | |
| # 2017-01-23 18:27:53 +0300, 2 months ago, john.doe@example.com, origin/new-feature-1 |
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
| // Use HttpComponentsClientHttpRequestFactory to fix the issue | |
| import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; | |
| ... | |
| RestTemplate restTemplate = new RestTemplate(new HttpComponentsClientHttpRequestFactory()); |
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
| public class ComparingUtils { | |
| public static <T extends Comparable<T>> ComparisonBuilder<T> is(T comparable) { | |
| return new ComparisonBuilder<>(comparable); | |
| } | |
| public static class ComparisonBuilder<T> { | |
| private Comparable<T> subject; |
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
| import org.joda.time.DateTime; | |
| public class StartEndTimeWithJodaTime { | |
| private DateTime startTime; | |
| private DateTime endTime; | |
| public void process() { | |
| startTime = DateTime.now(); |
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
| import lombok.AllArgsConstructor; | |
| import lombok.Data; | |
| @Data | |
| @AllArgsConstructor | |
| public class LazyDeveloper { | |
| private String firstName; | |
| private String lastName; |
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
| ServletRequestAttributes servletRequestAttributes = (ServletRequestAttributes) RequestContextHolder.currentRequestAttributes(); | |
| HttpServletRequest httpServletRequest = servletRequestAttributes.getRequest(); | |
| HttpServletResponse httpServletResponse = servletRequestAttributes.getResponse(); |
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
| import lombok.Builder; | |
| import lombok.Getter; | |
| import lombok.Setter; | |
| @Getter | |
| @Setter | |
| public class Child extends Parent { | |
| private String childField_1; |
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
| import ...BaseEntity; | |
| import org.apache.commons.lang.math.RandomUtils; | |
| import org.hibernate.Session; | |
| public class EntityBuilder<T extends BaseEntity> extends ObjectBuilder<T> { | |
| @Override | |
| public EntityBuilder<T> set(String fieldName, Object value) { | |
| return (EntityBuilder<T>) super.set(fieldName, value); | |
| } |