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
// ==UserScript== | |
// @name One Confluence No Format Macro Selector | |
// @namespace https://gist.github.com/skaveesh | |
// @version 1.3 | |
// @description One Confluence No Format Macro Selector for Pearson | |
// @author Samintha Kaveesh | |
// @run-at document-idle | |
// @match https://one-confluence.pearson.com/* | |
// @grant none | |
// @require https://code.jquery.com/jquery-1.12.4.min.js |
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
// ==UserScript== | |
// @name One Click Purchase Binary | |
// @namespace http://tampermonkey.net/ | |
// @version 1.2 | |
// @description binary trade purchase in one click | |
// @author You | |
// @match https://webtrader.binary.com/* | |
// @grant none | |
// @author Samintha Kaveesh | |
// @require https://code.jquery.com/jquery-1.12.4.min.js |
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
<dependencies> | |
<!--to import spring http--> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-web</artifactId> | |
</dependency> | |
<!--to import aspect oriented--> | |
<dependency> | |
<groupId>org.springframework.boot</groupId> |
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
//code is omitted for brevity | |
@Service | |
public class DownstreamService { | |
//code is omitted for brevity | |
/** | |
* Response from this API call will not have a delay | |
* |
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
//code is omitted for brevity | |
@RestController("/") | |
public class Controller { | |
//code is omitted for brevity | |
@GetMapping(value = "calltest", produces = MediaType.APPLICATION_JSON_VALUE) | |
public ResponseEntity<Object> callTest(){ | |
return new ResponseEntity<>(downstreamService.callTest(), HttpStatus.OK); |
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
//code is omitted for brevity | |
@RestControllerAdvice | |
@Component | |
public class ApplicationResponseEntityExceptionHandler extends ResponseEntityExceptionHandler { | |
private static final Logger LOGGER = LoggerFactory.getLogger(ApplicationResponseEntityExceptionHandler.class); | |
@ExceptionHandler(CircuitBreakerDownstreamCallException.class) | |
public ResponseEntity<Map<String, Object>> handleException(final Exception exception, final HttpServletRequest request) { |
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
//code is omitted for brevity | |
@Aspect | |
@Component | |
public class CircuitBreakerAOPConfig { | |
@Around("@annotation(com.skaveesh.dcb.annotation.EnableCircuitBreakerScan)") | |
public Object around(ProceedingJoinPoint proceedingJoinPoint) throws Throwable { | |
Object[] args = proceedingJoinPoint.getArgs(); |
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
//code is omitted for brevity | |
@Retention(RetentionPolicy.RUNTIME) | |
@Target({ElementType.METHOD}) | |
public @interface EnableCircuitBreakerScan { } |
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
//code is omitted for brevity | |
@Service | |
public class DownstreamService { | |
private final CircuitBreaker circuitBreaker; | |
/** | |
* Instantiates a new Res 4 j service. | |
*/ | |
public DownstreamService(CircuitBreakerRegistry circuitBreakerRegistry) { |
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
//code is omitted for brevity | |
@Aspect | |
@Component | |
public class CircuitBreakerAOPConfig { | |
private static final Logger LOGGER = LoggerFactory.getLogger(CircuitBreakerAOPConfig.class); | |
private final CircuitBreaker circuitBreaker; |
OlderNewer