Skip to content

Instantly share code, notes, and snippets.

View ani03sha's full-sized avatar
👨‍💻
Web 2.0 --> Web 3.0

Anirudh Sharma ani03sha

👨‍💻
Web 2.0 --> Web 3.0
View GitHub Profile
@ani03sha
ani03sha / CurlExecutor.java
Created January 22, 2018 10:51
This gist is a sample use case of getting the bundle details in an AEM instance via a java based cURL command
package org.anirudh.redquark.curl;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;
import org.apache.commons.codec.binary.Base64;
import org.json.JSONArray;
@ani03sha
ani03sha / ReverseLinkedList.java
Last active February 3, 2018 21:46
LinkedList's implementation in Java
package org.anirudh.redquark.datastructures;
/**
*
* @author anirshar This class reverses a Linked List if head of the input list
* is given
*/
public class ReverseLinkedList {
/**
@ani03sha
ani03sha / TagEventListener.java
Created February 21, 2018 17:43
Adobe Experience Manager event handler that responds to JCR events, such as when a node is created.
package org.anirudh.redquark.eventing;
import java.util.Arrays;
import javax.jcr.Node;
import javax.jcr.RepositoryException;
import javax.jcr.Session;
import javax.jcr.observation.Event;
import javax.jcr.observation.EventIterator;
import javax.jcr.observation.EventListener;
@ani03sha
ani03sha / ReadSerFile.java
Last active May 10, 2018 05:39
This class deserializes the content of an unknown class
package org.anirudh.redquark.serialization;
import java.io.File;
import java.io.FileInputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
public class ReadSerFile {
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0">
<channel>
<atom:link type="application/rss+xml" rel="self"
href="https://timesofindia.indiatimes.com/rssfeedstopstories.cms" />
<title>Times of India</title>
<link>https://timesofindia.indiatimes.com</link>
<description>
The Times of India: Breaking news, views, reviews, cricket from across
India
</description>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.4.0</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-simplexml</artifactId>
<version>2.4.0</version>
package org.redquark.retrofit.xmlparser.model;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.Root;
/**
* @author Anirudh Sharma
*
* The 'Article' class represents one single article and only stores the title, link and description of it.
*/
/**
*
*/
package org.redquark.retrofit.xmlparser.model;
import java.util.List;
import org.simpleframework.xml.Element;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Path;
package org.redquark.retrofit.xmlparser.api;
import org.redquark.retrofit.xmlparser.model.Feed;
import retrofit2.Call;
import retrofit2.http.GET;
/**
* @author Anirudh Sharma
*
package org.redquark.retrofit.xmlparser.api;
import static org.redquark.retrofit.xmlparser.constants.AppConstants.URL;
import org.redquark.retrofit.xmlparser.model.Feed;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;