Skip to content

Instantly share code, notes, and snippets.

View ramesh-lingappan's full-sized avatar
🎯
Focusing

Ramesh Lingappan ramesh-lingappan

🎯
Focusing
View GitHub Profile
@ramesh-lingappan
ramesh-lingappan / hmac-sha1
Created January 30, 2015 14:03
Calculate HMAC-SHA1 value of payload
/**
* @param key - client secret key
* @param data - can be any data (eg: http request or response payload)
* @return
*/
public static String calculateHmacSHA1(String key, byte[] data) {
if (key == null || data == null || data.length <= 0)
return null;
String HMAC_SHA1_ALGORITHM = "HmacSHA1";
@ramesh-lingappan
ramesh-lingappan / appengine-gradle-intellij-demo_build.gradle
Last active January 25, 2017 09:45
appengine-gradle-intellij-demo
group 'com.rameshl.demos'
version '1.0-SNAPSHOT'
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'appengine'
sourceCompatibility = 1.7
repositories {
<?xml version="1.0" encoding="utf-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
version="2.5">
<servlet>
<servlet-name>hello</servlet-name>
<servlet-class>com.rameshl.demos.helloworld.HelloWorldServlet</servlet-class>
</servlet>
<servlet-mapping>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>YOUR-PROJECT-ID</application>
<version>YOUR-VERSION-ID</version>
<threadsafe>true</threadsafe>
</appengine-web-app>
@ramesh-lingappan
ramesh-lingappan / gae-modules-intellij-demo_dependencies.gradle
Last active August 21, 2017 10:07
Gradle file to have all application dependencies listed
ext {
//used libraries versions
libVersions =
[
servletApi : '3.1.0',
junit : '4.12',
gae : '1.9.54',
googleGradlePlugin: '1.3.2',
]
@ramesh-lingappan
ramesh-lingappan / gae-modules-intellij-demo_build.gradle
Created August 21, 2017 08:45
Root build.gradle file configuration
// dependencies version and config definitions
apply from: 'gradle/dependencies.gradle'
// project configurations
allprojects {
group 'com.rameshl.demos'
version '1.0'
}
subprojects {
group 'com.rameshl.demos'
version '1.0'
repositories {
mavenCentral()
}
dependencies {
compileOnly libs.servletApi
@ramesh-lingappan
ramesh-lingappan / gae-modules-intellij-demo_webapp_build.gradle
Last active October 9, 2017 12:53
WebApp Module build.gradle configuration
group 'com.rameshl.demos'
version '1.0'
buildscript {
repositories {
jcenter()
mavenCentral()
}
dependencies {
// latest App Engine Gradle tasks
package com.rameshl.demo.servlets;
import com.rameshl.demos.service.GreetingService;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public enum AppMode {
// different types of environment
DEV, STAGING, LIVE;
}