Skip to content

Instantly share code, notes, and snippets.

View silentsudo's full-sized avatar

Ashish Agre silentsudo

  • Bangalore
View GitHub Profile
@silentsudo
silentsudo / kotlin-post-and-via-rest-template.txt
Created March 8, 2021 11:23
kotlin-sample-post-and-rest-template
package com.examlples.spring.kotlin.kotlinspringsamples
import org.springframework.boot.web.client.RestTemplateBuilder
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.web.client.RestTemplate
@Configuration
class AppConfig {
@Bean
@silentsudo
silentsudo / custom-hibernate-class-type-validator.java
Created January 8, 2021 05:25
custom-hibernate-class-type-validator
package com.example.demo.validation;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@silentsudo
silentsudo / spring-boot-zip-code-validator-example.java
Created December 31, 2020 06:33
spring-boot-zip-code-validator-example
package com.example.demo.validation;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@silentsudo
silentsudo / ubuntu-sound-help.md
Created December 16, 2020 14:52
ubuntu-sound-help.md
@silentsudo
silentsudo / neo4j_cypher_cheatsheet.md
Created July 5, 2020 11:43 — forked from DaniSancas/neo4j_cypher_cheatsheet.md
Neo4j's Cypher queries cheatsheet

Neo4j Tutorial

Fundamentals

Store any kind of data using the following graph concepts:

  • Node: Graph data records
  • Relationship: Connect nodes (has direction and a type)
  • Property: Stores data in key-value pair in nodes and relationships
  • Label: Groups nodes and relationships (optional)
@silentsudo
silentsudo / time.sql
Created June 5, 2020 11:10
convert time store in sql to hh:mm
create table total_minutes(
id bigint(20) NOT NULL AUTO_INCREMENT,
total_time int,
primary key(id)
);
insert into total_minutes(total_time) values(35);
insert into total_minutes(total_time) values(95);
insert into total_minutes(total_time) values(69);
insert into total_minutes(total_time) values(392);
@silentsudo
silentsudo / pruneRemote.sh
Created February 18, 2018 18:37 — forked from lkopocinski/pruneRemote.sh
Git command for pruning remote branches
git remote prune origin
@silentsudo
silentsudo / pruneDryRun.sh
Created February 18, 2018 18:37 — forked from lkopocinski/pruneDryRun.sh
Git command for reporting what would be pruned
git remote prune origin --dry-run
@silentsudo
silentsudo / deleteMerged.sh
Created February 18, 2018 18:37 — forked from lkopocinski/deleteMerged.sh
Git command for deleting merged branches
git branch --merged | grep -E -v "master|develop" | xargs git branch -d
@silentsudo
silentsudo / gitconfig
Created February 18, 2018 18:37 — forked from lkopocinski/gitconfig
Git branches aliases
[alias]
po = !git remote prune origin
dm = !git branch --merged | grep -E -v \"master|develop\" | xargs git branch -d