Skip to content

Instantly share code, notes, and snippets.

@ekirastogi
ekirastogi / springSecurity.html
Created April 1, 2016 07:40
Spring Security
<a href="#">In memory Authentication</a>
@ekirastogi
ekirastogi / Question.java
Last active January 19, 2016 08:01
Spring Hibernate - One to Many Mapping
package com.ekiras.domian;
import javax.persistence.*;
/**
* @author ekansh
* @since 19/1/16
*/
@Entity
public class Question {
public class ActivityOne extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Person person = new Person("Ekansh","[email protected]","New Delhi, India");
Intent intent = new Intent(ActivityOne.this, ActivityTwo.class);
intent.putExtra(DataUtil.PERSON, person);
startActivity(intent);
}
package com.ekiras.test;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
public class TestApi {
@ekirastogi
ekirastogi / TestCASRest.java
Created November 17, 2015 19:49
Test CAS Rest API from Java Code
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
@ekirastogi
ekirastogi / FileDemo
Created November 11, 2015 17:04
How to create a File in Java using FileWriter
package com.ekiras.demo;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Date;
class FileDemo {
public static void main(String args[]) {
package com.ekiras.demo;
import com.hazelcast.client.HazelcastClient;
import com.hazelcast.client.config.ClientConfig;
import com.hazelcast.core.HazelcastInstance;
/**
* Created by ekansh on 1/11/15.
*/
@ekirastogi
ekirastogi / Bootstrap.java
Created October 30, 2015 23:09
Spring Boot : How to create a Bootstrap class.
package com.ekiras.bootstrap;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import java.util.logging.Logger;
/**
* Created by ekansh on 31/10/15.
@ekirastogi
ekirastogi / SecurityFilter.java
Created October 27, 2015 13:30
How to register a Filter in spring boot application
package com.ekiras.filter;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.servlet.*;
import java.io.IOException;
/**
* Created by ekansh on 22/10/15.
@ekirastogi
ekirastogi / SecurityFilter.java
Last active June 10, 2018 04:57
How to define Filter order in Filter Chain in Spring Boot
package com.ekiras.filter;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;
import javax.servlet.*;
import java.io.IOException;
/**
* Created by ekansh on 22/10/15.