Skip to content

Instantly share code, notes, and snippets.

View ranraj's full-sized avatar
🏠
Working from home

Ranjithrajd ranraj

🏠
Working from home
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<style id="jsbin-css">
.control-label{
float:left;
margin:5px;
}
@ranraj
ranraj / gist:741bcc2f22ec57ac9e58
Created October 15, 2014 05:47
Liferay portlet session error iterator
<%@page import="java.util.Iterator"%>
<%@page import="com.liferay.portal.kernel.servlet.SessionErrors"%>
<%
Iterator<String> itErrors = SessionErrors.iterator(renderRequest);
while (itErrors.hasNext()){
String errorKey = itErrors.next();
%>
<%=errorKey%>
<%
}
@ranraj
ranraj / liferay-hint.jsp
Created October 15, 2014 09:33
override the liferay session message [your request completed successfuly]
SessionMessages.add(actionRequest, "requestProcessed", successMessage);
@ranraj
ranraj / custom_project.vm
Created October 15, 2014 11:22
Access services in the liferay theme project # velocity template
$serviceLocator.findService("com.liferay.portal.service.UserLocalService"))
@ranraj
ranraj / portlet-plugin-package.properties
Created October 15, 2014 12:47
liferay : adding portal class path dependency jar files in the custom plugin portlet
name=sample-portlet
module-group-id=liferay
module-incremental-version=1
...
portal.dependency.jars=commons-logging.jar,commons-io.jar
@ranraj
ranraj / mysql.sql
Last active August 29, 2015 14:07
Queries
##Select duplicate key on an column in mysql table with count
SELECT name, COUNT(*) c FROM CAT GROUP BY name HAVING c > 1;
## Simple table join queries
select a.* from CAT a,TAX b where b.name like '%Tax%' and a.PARENT_TAX_PKEY=b.pkey;
## Safe mode update Enable / Disable
SET SQL_SAFE_UPDATES = 0;
## Delete duplicate name records and keep lowest id record
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>JS Bin</title>
<script src="http://cdn.alloyui.com/1.0.3/aui/aui.js"></script>
<link
href="http://cdn.alloyui.com/1.0.3/aui-skin-classic/css/aui-skin-classic-all-min.css"
rel="stylesheet">
</head>
@ranraj
ranraj / jira_Search.txt
Last active August 29, 2015 14:07
Jira serch with query
text~"converted"
Developer = currentUser()
project = ProjectA
assignee = currentUser()
resolutiondate >=-3w
ORDER BY updated DESC
## Finding current unresolved and assigned
assignee = currentUser() AND resolution = Unresolved ORDER BY updatedDate DESC
@ranraj
ranraj / EntityAPI.java
Last active August 29, 2015 14:08
Webservice
@GET
@Path("/v1/market/{key}")
@Produces(MediaType.APPLICATION_JSON)
public Response getMarketByKey(@PathParam("key") String key) throws ApplicationException {
}
/*when the variable present in the requested url path then the parameter need to be specified using @PathParam*/
@ranraj
ranraj / log4j.xml
Created October 31, 2014 05:42
Console Appender as default log appender
<appender name="default.console" class="org.apache.log4j.ConsoleAppender">
<param name="target" value="System.out" />
<param name="threshold" value="debug" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d{ISO8601} %-5p [%c{1}] - %m%n" />
</layout>
</appender>
<root>
<level value="INFO" />