Skip to content

Instantly share code, notes, and snippets.

Amit Saurav amitsaurav

Block or report user

Report or block amitsaurav

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
amitsaurav /
Last active Nov 28, 2016
A balanced tree with minimal rebalances.
package trees;
import java.util.LinkedList;
import java.util.Queue;
* There are bugs around odd and even array length and last element being not added but this is the
* general structure of the code.
* @author amitsaurav
amitsaurav /
Created Nov 23, 2016
List of Lists iterator.
package collections;
import java.util.Arrays;
import java.util.List;
* Created by amit.saurav on 11/23/16.
public class ListOfLists <T> {
private final List<List<T>> listOfLists;
amitsaurav /
Last active Nov 22, 2016
Code to generate "Palindrome Cover".
import java.util.*;
class Palindrome {
public static void main(String[] args) {
List<String> palindromes = Arrays.asList("gabbag", "baggab");
amitsaurav /
Last active Aug 29, 2015
Get Previous Date in Bash
year=`date +%Y`
month=`date +%m`
day=`date +%d`
if [ $((year%400)) -eq 0 ]; then
elif [ $((year%100)) -eq 0 ]; then
amitsaurav / boa.js
Created Jan 23, 2014
JQuery script to remove all non-parking/non-travel transactions from Bank Of America credit card transactions view.
View boa.js
jQuery("#transactions tbody tr").each(function() {
var row = jQuery(this);
if(row.text().indexOf("CHEVRON") === -1 && row.text().indexOf("U-PARK") === -1 && row.text().indexOf("GOOD2GO") === -1) {
jQuery("#transactions tfoot").remove();
You can’t perform that action at this time.