Skip to content

Instantly share code, notes, and snippets.

View ashishkharcheiu's full-sized avatar

Ashish Kharche ashishkharcheiu

View GitHub Profile
@ashishkharcheiu
ashishkharcheiu / BackPress.java
Created August 31, 2019 09:25 — forked from manishkpr/BackPress.java
Android - handle back press in Fragment More Details Visit: http://manishkpr.webheavens.com
This article describes how our FragmentBack works under the hood.
BaseFragment
First step to create back-sensitive fragments is to define interface that we can call to notify particular fragments about back-press. It contains only one method onBackPressed() which returns a value that indicates if back-press event was consumed by the fragment.
In this example we use base class, but you can define it via interface as well.
public class BaseFragment extends Fragment {
/**
* Could handle back press.
@ashishkharcheiu
ashishkharcheiu / BackPress.java
Created August 31, 2019 09:25 — forked from manishkpr/BackPress.java
Android - handle back press in Fragment More Details Visit: http://manishkpr.webheavens.com
This article describes how our FragmentBack works under the hood.
BaseFragment
First step to create back-sensitive fragments is to define interface that we can call to notify particular fragments about back-press. It contains only one method onBackPressed() which returns a value that indicates if back-press event was consumed by the fragment.
In this example we use base class, but you can define it via interface as well.
public class BaseFragment extends Fragment {
/**
* Could handle back press.
/**
* @param array A sorted array of ints to search through. This must be sorted.
* @param key an int to seach the array for
* @param start position where the arrays starts
* @param end position where the array ends
* @return wheter the key exists in the array
*/
public static boolean binarySearchRecursive(int[] array, int key, int start, int end) {
int middle = (start + end) / 2;
@ashishkharcheiu
ashishkharcheiu / introrx.md
Created July 20, 2019 07:16 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@ashishkharcheiu
ashishkharcheiu / README.md
Created July 3, 2019 10:43 — forked from lopspower/README.md
Hexadecimal color code for transparency

Hexadecimal color code for transparency

Twitter

How to set transparency with hex value ?

For example, you want to set 40% alpha transparence to #000000 (black color), you need to add 66 like this #66000000.

All hex value from 100% to 0% alpha:

@ashishkharcheiu
ashishkharcheiu / django_deploy.md
Created June 26, 2019 22:06 — forked from bradtraversy/django_deploy.md
Django Deployment - Digital Ocean

Django Deployment to Ubuntu 18.04

In this guide I will go through all the steps to create a VPS, secure it and deploy a Django application. This is a summarized document from this digital ocean doc

Any commands with "$" at the beginning run on your local machine and any "#" run when logged into the server

Create A Digital Ocean Droplet

Use this link and get $10 free. Just select the $5 plan unless this a production app.