Skip to content

Instantly share code, notes, and snippets.

View madan712's full-sized avatar

Madan Chaudhary madan712

View GitHub Profile
@madan712
madan712 / gestures_handler.js
Created February 9, 2022 16:02
React native swipe gestures handler example
import GestureRecognizer, {swipeDirections} from 'react-native-swipe-gestures';
.
.
.
onSwipeUp(gestureState) {
this.setState({myText: 'You swiped up!'});
}
onSwipeDown(gestureState) {
this.setState({myText: 'You swiped down!'});
@madan712
madan712 / dragable_swipeable.js
Last active April 28, 2024 16:13
React native draggable and swipeable list
import DraggableFlatList, { ScaleDecorator } from 'react-native-draggable-flatlist'
import SwipeableItem from 'react-native-swipeable-item'
.
.
.
const itemRefs = React.useRef(new Map())
<DraggableFlatList
activationDistance={15}
data={getCategoriesFromTaskList()}
@madan712
madan712 / Receiver.java
Created May 31, 2020 10:01
Receiver.java - Spring boot ActiveMQ example
package com.javaxp.testjmsclient;
import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;
@Component
public class Receiver {
@JmsListener(destination = "myQueue")
public void readMessage(String message) {
@madan712
madan712 / TestJmsClientApplication.java
Created May 31, 2020 10:01
TestJmsClientApplication.java - Spring boot ActiveMQ example
package com.javaxp.testjmsclient;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class TestJmsClientApplication {
public static void main(String[] args) {
SpringApplication.run(TestJmsClientApplication.class, args);
@madan712
madan712 / pom.xml
Created May 31, 2020 10:00
pom.xml - Spring boot ActiveMQ server
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
@madan712
madan712 / application.properties
Created May 31, 2020 09:55
application.properties - Spring boot ActiveMQ example
spring.activemq.broker-url=tcp://localhost:61616
spring.activemq.user=admin
spring.activemq.password=admin
@madan712
madan712 / TestJmsServerApplication.java
Last active June 1, 2020 12:04
TestJmsServerApplication.java - Spring boot ActiveMQ example
package com.javaxp.testjmsserver;
import java.time.LocalDateTime;
import javax.jms.Queue;
import org.apache.activemq.command.ActiveMQQueue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
@madan712
madan712 / pom.xml
Created May 31, 2020 09:51
pom.xml - Spring boot ActiveMQ server
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.4.RELEASE</version>
</parent>
@madan712
madan712 / application.yml
Created June 29, 2019 15:41
Spring Boot + Jasypt example to encrypted database password in property file
spring:
datasource:
driverClassName: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://localhost:3306/schema
username: user
password: ENC(xEOLuBn9FuLgpYl6O8qGwY5MVjr4w2Av)
@madan712
madan712 / Application.java
Last active June 29, 2019 12:03
My Sql + Spring Boot JPA - One to many, many to one example
package com.javaxp;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import com.javaxp.model.Department;