Skip to content

Instantly share code, notes, and snippets.

View ashishkharcheiu's full-sized avatar

Ashish Kharche ashishkharcheiu

View GitHub Profile
@ashishkharcheiu
ashishkharcheiu / DigitalOcean Django
Last active February 25, 2020 10:00
DigitalOcean Django Postgres Nginx unicorn ubuntu 18.0.4
https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-18-04
https://www.digitalocean.com/community/tutorials/how-to-install-the-django-web-framework-on-ubuntu-18-04
https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-18-04
https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-18-04
https://www.digitalocean.com/community/tutorials/how-to-set-up-object-storage-with-django
@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 / webwhatsapptextchrome
Created July 24, 2019 08:01
when tried to open web whatsapp chrome
This file has been truncated, but you can view the full file.
/*! Copyright (c) 2019 WhatsApp Inc. All Rights Reserved. */
webpackJsonp([0],{baaaeiafec:function(e,t){e.exports={muted:"yQFcY",item:"X7YrQ"}},babadgcffh:function(e,t){e.exports={muted:"_3IgiV",title:"_2XH7W"}},babbeaeffj:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(t,"__esModule",{value:!0});var r=n("ddeihcgfbg"),o=a(r),i=n("bdiiahhjbe"),l=a(i),c=function(e,t){l.default.assert(t.focusNode,"serializeTextBeforeCursor requires selection.focusNode")();var n=document.createRange();n.setStart(e,0),n.setEnd(t.focusNode,t.focusOffset);var a=n.cloneContents();return(0,o.default)(a,[])};t.default=c},babhhabdgf:function(e,t,n){"use strict";function a(e){return e&&e.__esModule?e:{default:e}}function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}func
@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 / paginationAndroidRecyclerView
Created July 4, 2019 11:56
paginationAndroidRecyclerView
package com.example.wingstestpaytm.Fragments;
import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.Editable;
@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:

package com.example.wingstestpaytm.Activities;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.design.widget.NavigationView;
certifi==2019.3.9
chardet==3.0.4
defusedxml==0.5.0
dj-database-url==0.5.0
Django==2.1.7
django-bootstrap3==11.0.0
django-braces==1.13.0
django-oauth-toolkit==1.2.0
django-rest-framework-social-oauth2==1.1.0
djangorestframework==3.9.2