Skip to content

Instantly share code, notes, and snippets.

View 0001vrn's full-sized avatar
🎯
Focusing

Varun Thakur 0001vrn

🎯
Focusing
View GitHub Profile
@RestController
@RequestMapping("/crq")
public class ChgRequestController {
private final ChgRequestService chgRequestService;
@Autowired
public ChgRequestController(ChgRequestService chgRequestService) {
this.chgRequestService = chgRequestService;
}
class CassandraDbChgRequestRepositoryTest {
@Autowired
private SpringDataCassandraChgRequestRepository cassandraChgRequestRepository;
@Autowired
private ChgRequestRepository chgRequestRepository;
@AfterEach
void tearDown() {
public class CassandraDbChgRequestRepository implements ChgRequestRepository {
private final SpringDataCassandraChgRequestRepository chgRequestRepository;
@Autowired
public CassandraDbChgRequestRepository(SpringDataCassandraChgRequestRepository chgRequestRepository) {
this.chgRequestRepository = chgRequestRepository;
}
@Override
class ChgRequestServiceImplTest {
private ChgRequestServiceImpl chgRequestService;
@Mock
private ChgRequestRepository chgRequestRepository;
@BeforeEach
void setUp() {
MockitoAnnotations.initMocks(this);
public class ChgRequestServiceImpl implements ChgRequestService {
private final ChgRequestRepository chgRequestRepository;
public ChgRequestServiceImpl(ChgRequestRepository chgRequestRepository) {
this.chgRequestRepository = chgRequestRepository;
}
@Override
public List<ChgRequest> findAll() {
public interface ChgRequestRepository {
List<ChgRequest> findAll();
Optional<ChgRequest> findById(UUID id);
void save(ChgRequest chgRequest);
}
public class ChgRequest {
private UUID id;
private String app;
private String build;
private String jira;
private String environment;
private String releaseNotes;
private String status;
@0001vrn
0001vrn / Sync gh-pages + master branches
Created August 28, 2018 16:38 — forked from mandiwise/Sync gh-pages + master branches
Keep gh-pages up to date with a master branch
// Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
@0001vrn
0001vrn / PositiveNegativeSeperateUsingDNF.java
Created August 1, 2017 10:18
Given an array of positive and negative integers, re-arrange it so that you have positive integers on one end and negative integers on other
/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class PositiveNegativeSeperateUsingDNF
{
public static void main (String[] args) throws java.lang.Exception
@0001vrn
0001vrn / reverseWords.c
Created July 31, 2017 08:31
Reverse words in a given string Raw
/*
Given a String of length N reverse the words in it. Words are separated by dots.
By : Varun Thakur
Date : 31/07/2017
*/
#include <stdio.h>
void reverse(char *begin, char *end)
{