Skip to content

Instantly share code, notes, and snippets.

View kdabir's full-sized avatar
👨‍💻
go git it

Kunal Dabir kdabir

👨‍💻
go git it
View GitHub Profile
@kdabir
kdabir / settings.xml
Created March 12, 2012 11:01
setting proxy in maven
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>host.domain.com</host>
<port>8080</port>
<nonProxyHosts>*.domain.com</nonProxyHosts>
</proxy>
</proxies>
@kdabir
kdabir / ExtractTags.java
Created March 12, 2012 13:22
Extract tags from string
List<String> tags = Arrays.asList(INPUT_STRING.split(",( )*"));
// splits by comma followed by zero or more spaces
@kdabir
kdabir / log4j.properties
Created March 14, 2012 14:17
a minimal log4j config file
log4j.rootLogger=INFO, CONSOLE
# CONSOLE is set to be a ConsoleAppender using a PatternLayout
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=[%-5p] %m%n
# a more detailed PatternLayout: %d [%t] %-5p %c - %m%n
# adjust specific logger levels as per the need to control the verbosity of logs
@kdabir
kdabir / jstl_core.jsp
Created March 14, 2012 14:21
including jstl core taglib in jsp
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
@kdabir
kdabir / minimal_xhtml.html
Created March 14, 2012 14:27
Minimal xhtml document with doctype
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Title goes here</title>
</head>
<body>
<h1>Hello World</h1>
</body>
</html>
@kdabir
kdabir / recursive_sum.c
Created March 14, 2012 14:30
Sum of first n numbers (recursive)
/** sum of first n number */
int add(int num){
return (num)?num + add(num-1):num;
}
@kdabir
kdabir / grape_behind_proxy.cmd
Created March 15, 2012 10:41
Install a library with Groovy Grape when behind a proxy
grape -Dhttp.proxyHost=proxy.corp.com -Dhttp.proxyPort=8080 install org.seleniumhq.selenium selenium-firefox-driver 2.15.0
@kdabir
kdabir / regex_notes.txt
Created March 15, 2012 15:23
general notes on regular expressions
declaring case insensitive regex inline "(?i)hello"
matching words "\w"
@kdabir
kdabir / netbeans_shortcuts.md
Created March 16, 2012 11:34
Netbeans shortcuts on WIndows

CTRL SHIFT ARROW - up/down to copy line

ALT SHIFT ARROW - keys to move line Up/Down/Left/Right

ALT SHFT O - Go to File

@kdabir
kdabir / js_css_template.html
Created March 19, 2012 12:47
Including external and inline javascript and css in html file
<!doctype html>
<html>
<head>
<title>Including javascript and css in html</title>
<script type="text/javascript" src="jquery-1.7.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
alert('hello world!');