Skip to content

Instantly share code, notes, and snippets.

View deveshmittal's full-sized avatar

Devesh deveshmittal

View GitHub Profile
@deveshmittal
deveshmittal / ViewExt.kt
Last active November 11, 2023 13:56
Debounce using coroutines on a view
object ViewExt{
fun View.setDebounceClickListener(
duration: Duration = 300.milliseconds,
action: (View) -> Unit
) {
this.setDebounceClickListener(duration.inWholeMilliseconds, action)
}
private fun View.setDebounceClickListener(
timeInMillis: Long,
action: (View) -> Unit
@deveshmittal
deveshmittal / gradle.properties
Created November 11, 2023 12:07
Use level gradle (~/.gradle/gradle.properties) settings for devesh's macbook pro M3 MAX 36 GB unified memory
org.gradle.jvmargs=-Xms8g -Xmx16g -XX:+UseG1GC -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1g -XX:+TieredCompilation -XX:+UseStringDeduplication -XX:ParallelGCThreads=8 -XX:+AggressiveOpts -Dfile.encoding=UTF-8
org.gradle.parallel=true
org.gradle.configureondemand=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn
org.gradle.caching=true
org.gradle.caching.debug=false
org.gradle.daemon.idletimeout=172800000
org.gradle.continuous.quietperiod=30
android.useAndroidX=true
@deveshmittal
deveshmittal / vm.options
Created November 11, 2023 11:46
vm.options (Devesh Mittal)
#Idea VM options for Devesh Mittal's M3MAX 36 Gig, which override idea.properties
-Xms8g -Xmx16g -XX:+UseG1GC -XX:MetaspaceSize=512m -XX:MaxMetaspaceSize=1g -XX:+TieredCompilation -XX:+UseStringDeduplication -XX:ParallelGCThreads=8 -XX:+AggressiveOpts
@deveshmittal
deveshmittal / README.md
Created July 21, 2019 19:26 — forked from lopspower/README.md
All Android Directory Path

All Android Directory Path

Twitter

1) System directories

⚠️ We can't write to these folers

Method Result
@deveshmittal
deveshmittal / convertGTMKeys.py
Created April 3, 2018 17:13
Convert GTM keys and values to RC
import json
import re
merge_json = open("mergedcontainers.json").read()
data = json.loads(merge_json)
dict_final_json = {}
dict_final_json['parameters']={}
for (key, value) in data.items():
def convert(obj):
Last login: Sat Mar 26 03:07:00 on ttys003
Deveshs-MacBook-Pro:~ devesh$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7766 100 7766 0 0 1348 0 0:00:05 0:00:05 --:--:-- 1836
=> Downloading nvm from git to '/Users/devesh/.nvm'
=> Cloning into '/Users/devesh/.nvm'...
remote: Counting objects: 4426, done.
remote: Total 4426 (delta 0), reused 0 (delta 0), pack-reused 4426
Receiving objects: 100% (4426/4426), 1.11 MiB | 525.00 KiB/s, done.
@deveshmittal
deveshmittal / FlowLayout.java
Last active March 12, 2016 17:02
FlowImplementation
public class FlowLayout extends ViewGroup {
public static final int HORIZONTAL = 0;
public static final int VERTICAL = 1;
private int horizontalSpacing = 0;
private int verticalSpacing = 0;
private int orientation = 0;
private boolean debugDraw = false;
public FlowLayout(Context context) {
@deveshmittal
deveshmittal / FlowLayout.java
Created March 12, 2016 16:55
FlowLayout.java
public class FlowLayout extends ViewGroup {
public static final int HORIZONTAL = 0;
public static final int VERTICAL = 1;
private int horizontalSpacing = 0;
private int verticalSpacing = 0;
private int orientation = 0;
private boolean debugDraw = false;
@deveshmittal
deveshmittal / mvp.java
Created December 16, 2015 14:57
Clean Architecture
//BasePresenter.java
public interface BasePresenter<V extends BaseView> {
/**
* Set or attach the view to this presenter
*/
public void attachView(V view);
/**
* Will be called if the view has been destroyed. Typically this method will
@deveshmittal
deveshmittal / mvp.java
Created December 16, 2015 14:57
Clean Architecture
//BasePresenter.java
public interface BasePresenter<V extends BaseView> {
/**
* Set or attach the view to this presenter
*/
public void attachView(V view);
/**
* Will be called if the view has been destroyed. Typically this method will