Skip to content

Instantly share code, notes, and snippets.

View Denuwanhh's full-sized avatar
🎯
Focusing

Denuwan Himanga Hettiarachchi Denuwanhh

🎯
Focusing
View GitHub Profile
@Denuwanhh
Denuwanhh / HelloWorld.java
Last active March 20, 2017 18:25
Create for testing purpose.
class HelloWorld{
public static void main(String args[]){
System.out.println("Hello World !");
}
}
@Denuwanhh
Denuwanhh / stringExample.java
Created March 21, 2017 16:52
String Example
public static String stringExample(){
String nameArray [] = {"Brown","Mike","Jhone"};
String nameList = "";
for(String name : nameArray){
nameList += name+",";
}
return nameList;
@Denuwanhh
Denuwanhh / stringBufferExample.java
Created March 21, 2017 17:02
StringBuffer Example
public static String stringBufferExample(){
String nameArray [] = {"Brown","Mike","Jhone"};
StringBuffer stringBuffer = new StringBuffer();
for(String name : nameArray){
stringBuffer.append(name+",");
}
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"
xmlns:a="http://www.w3.org/2005/08/addressing"
xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<a:Action s:mustUnderstand="1">http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue</a:Action>
<a:ReplyTo>
<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
</a:ReplyTo>
<a:To s:mustUnderstand="1">https://login.microsoftonline.com/extSTS.srf</a:To>
<o:Security s:mustUnderstand="1"
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package sharepoint.online.rest.demo;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import org.apache.http.HttpResponse;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Xml;
namespace GmailReader
{
class MailController
{
List<Mail> Mails = new List<Mail>();
@Denuwanhh
Denuwanhh / Mail.cs
Last active December 10, 2017 20:05
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace GmailReader
{
class Mail
{
<accessibility-mode>UserSession.accessibilityMode</accessibility-mode>
import com.auth0.jwt.JWT;
import com.auth0.jwt.interfaces.DecodedJWT;
public class ApplicationSessionBean{
/**
* Inorder to avoid misusages of JWT key, this Method use to validate JWT.
* Validate JWT key issued within 30s or not.
* @param jwt
* @return true/false
public Date converterSerialToDate(int serialNumber){
Calendar calender;
calender = Calendar.getInstance();
calender.clear();
calender.set(1899, 11, 31);
calender.add(Calendar.DATE, serialNumber);
return calender.getTime();
}