Skip to content

Instantly share code, notes, and snippets.

View ravindranathakila's full-sized avatar

Ravindranath Akila ravindranathakila

View GitHub Profile
@ravindranathakila
ravindranathakila / ElasticArray.java
Created January 29, 2012 16:42
Elastic Array In Java
package ai.ilikeplaces.util;
import ai.ilikeplaces.doc.License;
import java.util.Arrays;
/**
* Please let us know if you have a faster/memorable :P implementation.
*
* I doubt if this approach is consistent, but over time, there are no complains :)
@ravindranathakila
ravindranathakila / ElementComposer.java
Created January 29, 2012 16:53
W3C Element Composer For DOM
package ai.ilikeplaces.util;
import ai.ilikeplaces.doc.License;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.Text;
/**
* Created by IntelliJ IDEA.
* User: <a href="http://www.ilikeplaces.com"> http://www.ilikeplaces.com </a>
@ravindranathakila
ravindranathakila / EventType.java
Created January 29, 2012 16:55
DOM Event Types To Be Used With ItsNat
package ai.ilikeplaces.util;
import ai.ilikeplaces.doc.License;
/**
* DOM event types
* <p/>
* User: <a href="http://www.ilikeplaces.com"> http://www.ilikeplaces.com </a>
* Date: Dec 8, 2009
* Time: 11:17:06 PM
@ravindranathakila
ravindranathakila / Pair.java
Created January 29, 2012 16:58
Java Simple Key Value Pair
package ai.ilikeplaces.util;
import ai.ilikeplaces.doc.License;
/**
* Simple Key Value Pair.
* <p/>
* <p/>
* Example Usage:
* <p/>
@ravindranathakila
ravindranathakila / Return.java
Created January 29, 2012 17:00
Java Return Framework - Return Results From Different Tiers Properly. This has been used a lot on www.ilikeplaces.com to perfect effect.
package ai.ilikeplaces.util;
import ai.ilikeplaces.doc.License;
import ai.ilikeplaces.rbs.RBGet;
/**
* Created by IntelliJ IDEA.
* User: <a href="http://www.ilikeplaces.com"> http://www.ilikeplaces.com </a>
* Date: Jan 1, 2010
* Time: 4:26:30 PM
@ravindranathakila
ravindranathakila / SmartLogger.java
Created January 29, 2012 17:06
Smart Logger (Accumulative Logger)
package ai.ilikeplaces.util;
import ai.ilikeplaces.doc.*;
import java.io.PrintWriter;
import java.io.StringWriter;
import static ai.ilikeplaces.util.Loggers.LEVEL;
/**
@ravindranathakila
ravindranathakila / Memory.jsp
Created January 29, 2012 17:13
Simple Memroy Status Display JSP
<%@page import="java.lang.management.*" %>
<%@page import="java.util.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="refresh" content="10" />
</head>
<body>
JVM Memory Monitor
@ravindranathakila
ravindranathakila / StringBuilderHelper.java
Created February 9, 2012 03:10
StringBuilder Helper
package ai.ilikeplaces.util;
import ai.ilikeplaces.doc.License;
/**
* Just a wrapper around StringBuilder, which gives 2 additional features.
* New line in HTML, and Java.
* <p/>
* <p/>
* Example Usage:
http://gist.io
@ravindranathakila
ravindranathakila / summarize-webpage.js
Created November 12, 2012 06:27
Easy Tool To Summarise Webpages On The Fly
javascript: (function userSel(){if(document.getElementById('ilp_summarize_box') == undefined){ilp_para_id = 0;ilp_box = document.createElement('div');ilp_box.id = 'ilp_summarize_box';ilp_box.style.position='absolute';ilp_box.style.backgroundColor='#ffffff';ilp_box.style.zIndex = 99999;document.childNodes[1].insertBefore(ilp_box,document.childNodes[1].firstChild);ilp_button = document.createElement('a');ilp_button.appendChild(document.createTextNode('[close]'));ilp_button.name='close';ilp_closed = 'Done';ilp_button.href ='javascript:(function(){document.childNodes[1].removeChild(ilp_box)})();';ilp_box.appendChild(document.createElement('hr'));ilp_box.appendChild(ilp_button);ilp_box.appendChild(document.createElement('hr'));} if (window.getSelection) { txt = window.getSelection(); } else if (document.getSelection) { txt = document.getSelection(); } else if (document.selection) { txt = document.selection.createRange().text; } e