Skip to content

Instantly share code, notes, and snippets.

View silentsudo's full-sized avatar

Ashish Agre silentsudo

  • Bangalore
View GitHub Profile
@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 / 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 / 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 / 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 / ubuntu-sound-help.md
Created December 16, 2020 14:52
ubuntu-sound-help.md
@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 / 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 / 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 / HibernateEventEntityListener.java
Created March 21, 2021 16:07
hibernate-entity-event-listener
package com.example.samplejdbctemplatecall;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;
import org.hibernate.boot.Metadata;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.event.service.spi.EventListenerGroup;
@silentsudo
silentsudo / twitter-input-plugin.conf
Created May 20, 2021 06:41
logstash twitter input plugin
input {
twitter {
consumer_key => "${TWITTER_KEY}"
consumer_secret => "${TWITTER_SECRET}"
oauth_token => "${TWITTER_OAUTH_TOKEN}"
oauth_token_secret => "${TWITTER_OAUTH_SECRET}"
ignore_retweets => true
full_tweet => true
keywords=> ["java", "springboot"]
}