Skip to content

Instantly share code, notes, and snippets.

View girish3's full-sized avatar
🎯
Focusing

Girish Budhwani girish3

🎯
Focusing
View GitHub Profile
var easing = {
linear : function (t){
return t;
},
easeInQuad: function (t) {
return t*t;
},
easeOutQuad: function (t) {
return -1 *t*(t-2);
},
@girish3
girish3 / doubly_linked_list.js
Last active August 29, 2015 14:04
Doubly Linked List
var Node = function ( data ) {
this.data = data;
this.next = null;
this.previous = null;
}
var LinkedList = function () {
this.first = null;
@girish3
girish3 / migrating to mongolab
Last active August 29, 2015 14:18
how to migrate local mongdb database to mongolab(or any remote server)
# your backup folder
cd /backup
# make sure mongod instance is running
mongodump --db dbname --out ./
# above line will create a folder dbname
cd dbname
# migrate to mongolab
@girish3
girish3 / ResizeAnimation.java
Last active August 29, 2015 14:27 — forked from rafali/ResizeAnimation.java
Resize animation on Android
public class ResizeAnimation extends Animation {
final int startWidth;
final int targetWidth;
View view;
public ResizeAnimation(View view, int targetWidth) {
this.view = view;
this.targetWidth = targetWidth;
startWidth = view.getWidth();
}
@girish3
girish3 / RecyclerViewTemplate.md
Last active May 24, 2020 11:05
[[Deprecated] Recycler view] Its too much work when I need a simple list to experiment some stuff in Android. This file to my rescue. #android_snippet #android

Adapter

// Adapter code
public class CustomAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> {

    ArrayList<String> mItems;

    public CustomAdapter(Context context, ArrayList<String> items) {
@girish3
girish3 / .gitignore
Last active June 6, 2019 01:28
[gitignore for android project] Taken from Github gitignore repo https://github.com/github/gitignore/blob/master/Android.gitignore #android
# Built application files
*.apk
*.ap_
*.aab
# Files for the ART/Dalvik VM
*.dex
# Java class files
*.class
@girish3
girish3 / avl_tree.py
Created February 15, 2016 18:33
AVL tree implementation in python
#import random, math
outputdebug = False
def debug(msg):
if outputdebug:
print msg
class Node():
def __init__(self, key):
class DoubleList(object):
head = None
tail = None
size = 0
def append(self, data):
new_node = Node(data)
if self.head is None:
self.head = self.tail = new_node
class DoubleList(object):
head = None
tail = None
size = 0
def append(self, data):
new_node = Node(data)
if self.head is None:
self.head = self.tail = new_node
# Here is the working code of the naive approach.
def bruteSearch(W, T):
# edge case check
if W == "":
return -1
# getting the length of the strings
wordLen = len(W)
textLen = len(T)