Skip to content

Instantly share code, notes, and snippets.

View aftabsikander's full-sized avatar

Aftab aftabsikander

  • Karachi,Pakistan
View GitHub Profile
@aftabsikander
aftabsikander / ImageCompression
Created August 22, 2017 23:19 — forked from vipulasri/ImageCompression
Whatsapp Like Image Compression
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Matrix;
import android.graphics.Paint;
import android.media.ExifInterface;
import android.os.AsyncTask;
import android.os.Environment;
@aftabsikander
aftabsikander / git.migrate
Created November 27, 2017 21:36 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@aftabsikander
aftabsikander / proguard
Created January 11, 2018 13:46
Proguard Rule
-dontwarn com.google.android.gms.**
-dontwarn com.github.siyamed.shapeimageview.**
-keepattributes Signature
-keepattributes *Annotation*, EnclosingMethod
-dontwarn com.google.android.gms.**
-dontwarn android.support.**
-optimizationpasses 25
-dontusemixedcaseclassnames
-dontpreverify
@aftabsikander
aftabsikander / ProjectUtil.java
Last active June 14, 2018 11:27
Common Utilities
package com.app.example.util;
import android.Manifest;
import android.app.Activity;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.content.DialogInterface;
@aftabsikander
aftabsikander / FetchUserLocationService.java
Last active June 21, 2018 09:25
Location Services Utilities
package com.app.example.location;
import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.os.AsyncTask;
import com.app.example.interfaces.FusedLocationResultCallback;
import com.app.example.model.location.LocationModel;
@aftabsikander
aftabsikander / FragmentUtils.java
Created January 11, 2018 14:03
Fragment Util
package com.app.example.util;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentActivity;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.app.AppCompatActivity;
import com.app.advanceautoparts.R;
@aftabsikander
aftabsikander / .eslintrc
Created May 16, 2018 18:24 — forked from radiovisual/.eslintrc
React Native AirBnB ESLint Config
{
"parser": "babel-eslint",
"plugins": [
"react",
"react-native"
],
"parserOptions": {
"ecmaFeatures": {
"jsx": true,
"modules": true
@aftabsikander
aftabsikander / ProjectUtils.java
Created June 20, 2018 14:27
MediaScanner Sample
public class ProjectUtils {
/***
* Force MediaScanner to update its media database for recently added files.
* @param context the calling context.
* @param filePathForScan File path which will request the media scanner to rescan and add it
* to the media database.
*/
public static void forceUpdateMediaScanner(Context context, String filePathForScan) {
if (context != null) {
new SingleMediaScanner(context, new File(filePathForScan));
@aftabsikander
aftabsikander / GeoCoderUtil.java
Created July 31, 2018 10:56
Reverse Geo Code
package com.boloro.boloromobileapp.util;
import android.content.Context;
import android.location.Address;
import android.location.Geocoder;
import android.util.Log;
import java.io.IOException;
import java.util.List;
import java.util.Locale;
@aftabsikander
aftabsikander / git_submodules.md
Created August 18, 2018 06:28 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.