Skip to content

Instantly share code, notes, and snippets.

View skaveesh's full-sized avatar
❤😍😒🤦‍♂️😢🐱‍👤🤳🎶😎👍😁🤞🌹🎉

Samintha Kaveesh skaveesh

❤😍😒🤦‍♂️😢🐱‍👤🤳🎶😎👍😁🤞🌹🎉
View GitHub Profile
@skaveesh
skaveesh / one_confluence_no_format_macro_selector.user.js
Last active April 10, 2024 03:28
One Confluence No Format Macro Selector for Pearson
// ==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
@skaveesh
skaveesh / one_click_purchase_binary.user.js
Last active November 4, 2020 16:17
Binary trade purchase in one click
// ==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
@skaveesh
skaveesh / pom.xml
Last active January 3, 2021 04:37
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
<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>
@skaveesh
skaveesh / DownstreamService.java
Last active January 3, 2021 04:37
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
//code is omitted for brevity
@Service
public class DownstreamService {
//code is omitted for brevity
/**
* Response from this API call will not have a delay
*
@skaveesh
skaveesh / Controller.java
Last active January 3, 2021 04:36
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
//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);
@skaveesh
skaveesh / ApplicationResponseEntityExceptionHandler.java
Last active January 3, 2021 04:36
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
//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) {
@skaveesh
skaveesh / AOPComponentSample.java
Last active January 3, 2021 04:36
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
//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();
@skaveesh
skaveesh / EnableCircuitBreakerScan.java
Last active January 3, 2021 04:36
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
//code is omitted for brevity
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface EnableCircuitBreakerScan { }
@skaveesh
skaveesh / DownstreamServiceSample.java
Last active January 3, 2021 04:36
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
//code is omitted for brevity
@Service
public class DownstreamService {
private final CircuitBreaker circuitBreaker;
/**
* Instantiates a new Res 4 j service.
*/
public DownstreamService(CircuitBreakerRegistry circuitBreakerRegistry) {
@skaveesh
skaveesh / CircuitBreakerAOPConfig.java
Last active January 3, 2021 04:36
How I Decoupled Circuit Breaker from the Code with AOP in Spring Boot for Better Code Maintenance
//code is omitted for brevity
@Aspect
@Component
public class CircuitBreakerAOPConfig {
private static final Logger LOGGER = LoggerFactory.getLogger(CircuitBreakerAOPConfig.class);
private final CircuitBreaker circuitBreaker;