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
// ==UserScript== | |
// @name github-style | |
// @namespace http://springsource.org | |
// @description Adds manual merge commands to pull requests | |
// @include https://github.com/*/* | |
// @include http://github.com/*/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== |
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 java.util.EnumSet; | |
import java.util.Objects; | |
import java.util.Optional; | |
import java.util.function.Function; | |
public class Enums { | |
public static <E extends Enum<E>, T> Optional<E> lookup(Class<E> elementType, Function<E, T> extractor, T value) { | |
return EnumSet.allOf(elementType).stream() | |
.filter(candidate -> Objects.equals(extractor.apply(candidate), value)).findFirst(); |
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
package com.example.demo; | |
import java.util.Collection; | |
import org.springframework.beans.factory.ObjectProvider; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.context.annotation.Bean; | |
import org.thymeleaf.context.IExpressionContext; | |
import org.thymeleaf.dialect.IDialect; |
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/sh | |
function migrate { | |
sed -i.bak \ | |
-e 's|import static org.mockito.Mockito.when;|import static org.mockito.BDDMockito.given;|g' \ | |
-e 's|import org.mockito.runners.MockitoJUnitRunner;|import org.mockito.junit.MockitoJUnitRunner;|g' \ | |
-e 's|import org.mockito.Matchers;|import static org.mockito.ArgumentMatchers.*;|g' \ | |
-e 's|import static org.mockito.Mockito.doThrow;|import static org.mockito.BDDMockito.willThrow;|g' \ | |
-e 's|Matchers.any(|any(|g' \ | |
-e 's|doThrow(|willThrow(|g' \ |
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
Mon Jun 6 04:09:08 UTC 2016 |
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
@Controller | |
@SessionAttributes(types = Owner.class) | |
public class OwnerController { | |
private final ClinicService clinicService; | |
@Autowired | |
public OwnerController(ClinicService clinicService) { | |
this.clinicService = clinicService; | |
} |
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
@RequestMapping("/") | |
public ResponseEntity<String> hello() { | |
return ResponseEntity.ok().header("X-foo", "bar").body("Hi"); | |
} |
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
package sample; | |
import javax.persistence.EntityManagerFactory; | |
import javax.sql.DataSource; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
import org.springframework.boot.autoconfigure.orm.jpa.EntityManagerFactoryBuilder; |
I hereby claim:
- I am philwebb on github.
- I am philwebb (https://keybase.io/philwebb) on keybase.
- I have a public key whose fingerprint is 857C C843 87E0 6EC1 97ED D1A6 56E7 0051 2485 74F7
To claim this, I am signing this object:
NewerOlder