Skip to content

Instantly share code, notes, and snippets.

View kranthilakum's full-sized avatar
🚀
Focusing

Kranthi Lakum kranthilakum

🚀
Focusing
View GitHub Profile
@kranthilakum
kranthilakum / MyMarkdown.markdown
Last active December 10, 2015 00:49
An example of Markdown mark-up language

Lorem Ipsum

A simple example of using Markdown mark-up language.

Headers

H1 Header

H2 Header

H3 Header

H4 Header

H5 Header
H6 Header
@kranthilakum
kranthilakum / TestWatch.java
Created December 23, 2012 13:13
An implementation of a Rule overriding TestWatcher methods. A class only to be used for logging test cases activities.
/**
* An implementation of a {@link Rule} overriding {@link TestWatcher} methods.
* A class only to be used for logging test cases activities.
*
* @author Kranthi Lakum
*
*/
public class TestWatch extends TestWatcher
{
// SLF4J Logger instance for this class.
@kranthilakum
kranthilakum / FileTransfer.java
Created December 23, 2012 13:42
A class to illustrate the use of Apache Commens Net FTP connection. The FTPClient verifies and establishes a connection to an FTP server.
/**
* A class to illustrate the use of Apache Commens Net FTP connection.
*
* @author Kranthi Lakum
*/
public class FileTransfer
{
private static FTPClient theFtpClient = new FTPClient();
private static int theCode;
private static Logger myLogger = LoggerFactory.getLogger(FileTransfer.class);
@kranthilakum
kranthilakum / Git_SCM.markdown
Last active December 11, 2015 02:49
Tips and Tricks on Git SCM

Clone existing repository

git clone <link to repository>

Changes in working directory

git status -s
@kranthilakum
kranthilakum / RandomDifference.md
Last active December 12, 2015 09:19
A program that computes the difference between large integers.
package com.java.difference;

import java.math.BigInteger;
import java.util.Random;
import java.util.Scanner;

/**
 * Difference between large random numbers.
 */
@kranthilakum
kranthilakum / tree.sh
Created February 20, 2013 00:50
This script is a recursive directory listing program that produces a depth indented listing of files. For windows, download tree.exe file from http://gnuwin32.sourceforge.net/packages/tree.htm
#!/bin/sh
#######################################################
# UNIX TREE #
# Version: 2.3 #
# File: ~/apps/tree/tree.sh #
# #
# Displays Structure of Directory Hierarchy #
# ------------------------------------------------- #
# This tiny script uses "ls", "grep", and "sed" #
# in a single command to show the nesting of #
@kranthilakum
kranthilakum / today.html
Last active December 14, 2015 04:49
Display current day of the week using JavaScript getDay()
<!DOCTYPE html>
<html>
<head>
<script>
function today()
{
var day = new Date();
var dayNames = new Array ("Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday");
var x = document.getElementById("myDay");
<!DOCTYPE html>
<html>
<head>
<meta charset=utf-8 />
<title>Round-Cornered Square</title>
<style type="text/css">
.polygon {
margin: 5px 0 5px 20px;
width: 150px;
height: 150px;
@kranthilakum
kranthilakum / ReadInput.java
Created April 10, 2013 17:32
A simple example to read input from console using BufferedReader and InputStreamReader.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ReadInput {
public static void main(String[] args)throws IOException {
int age = 0;
boolean married = false;
String gender = null;
@kranthilakum
kranthilakum / windows.sh
Created June 13, 2013 12:00
Open windows explorer anywhere. To open current working directory use < start . > or < explorer . > in cygwin
# !/bin/bash
# author: Robert Mark Bram
# link: http://robertmarkbramprogrammer.blogspot.se/2007/06/cygwin-bash-script-open-windows.html
usage ()
{
echo "Open Windows Explorer"
echo "Usage: $0 [-help] [path]"
echo " [path]: folder at which to open Windows Explorer, will"
echo " default to current dir if not supplied."