Skip to content

Instantly share code, notes, and snippets.

View girish3's full-sized avatar
🎯
Focusing

Girish Budhwani girish3

🎯
Focusing
View GitHub Profile
@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):
var easing = {
linear : function (t){
return t;
},
easeInQuad: function (t) {
return t*t;
},
easeOutQuad: function (t) {
return -1 *t*(t-2);
},
@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 / speed_up.md
Last active April 5, 2020 05:11
[[Deprecated] Android studio/Gradle performance tips] #android

[Deprecated] migrated to notion

Gradle tweaks

Open or create a file called gradle.properties in .gradle directory. Inside the file, add following

  • org.gradle.parallel=true: Allow you to build multiple modules in the same project at the same time
  • org.gradle.daemon=true will turn on daemon so that every time we build the application, it doesn’t need to rerun the entire Gradle application every time.

Memory Allocation tweaks

@girish3
girish3 / LaunchMode.md
Last active June 17, 2019 03:38
[Activity Launch Mode] Understanding Activity's launch mode #android #android_tutorial #tutorial

Since each Activity is made to work in different purpose. Some is designed to work separately with each Intent sent for example an Activity for email composing in email client. While some is designed to work as a singleton for example an email's inbox Activity. That's why it does matter to specify whether Activity is needed to be created a new one or to use the existed one. launchMode is designed for this specifically.

launchMode can be assigned directly as an attribute tag

<activity
    android:name=".SingleTaskActivity"
    android:label="singleTask launchMode"
    android:launchMode="singleTask">
@girish3
girish3 / poodir-notes.md
Last active June 16, 2019 04:24 — forked from speric/poodir-notes.md
[Notes From Practical Object-Oriented Design In Ruby" by Sandi Metz] #design_pattern
@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 / basics.md
Last active May 31, 2019 13:51
[Regex and Grep tool] #tutorial

regex for finding text with 2 substrings

Ex. 'git' and 'rm'

grep "git.*rm"

@girish3
girish3 / streams.md
Last active May 31, 2019 13:50
[What is InputStream & Output Stream in Java? Why and when do we use them?] #java

The goal of InputStream and OutputStream is to abstract different ways to input and output: whether the stream is a file, a web page, or the screen shouldn't matter. All that matters is that you receive information from the stream (or send information into that stream.)

InputStream is used for many things that you read from.

OutputStream is used for many things that you write to.

Here's some sample code. It assumes the InputStream instr and OutputStream osstr have already been created:

int i;
@girish3
girish3 / markdown.md
Last active May 31, 2019 13:50
[Markdown basics] #tutorial
  1. The following line is bold
    Hi, I am Bold (**Hi, I am Bold**)

  2. The following line is given emphasis
    I am cooool. (*I am cooool.*)

  3. To write something on the new line, give two spaces and hit enter
    Yay! we are on the next line

  4. Now comes the Headline