Skip to content

Instantly share code, notes, and snippets.

🙈
Just do it!

Hossain Khan amardeshbd

🙈
Just do it!
View GitHub Profile
@amardeshbd
amardeshbd / RoundedTransformation.java
Created Jul 25, 2016 — forked from aprock/RoundedTransformation.java
Rounded Corner Image Transformation for square's Picasso
View RoundedTransformation.java
import android.graphics.Bitmap;
import android.graphics.Bitmap.Config;
import android.graphics.BitmapShader;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.RectF;
import android.graphics.Shader;
/**
View resume.json
{
"basics": {
"name": "Hossain Khan",
"label": "Sr. Android Developer at Quickplay",
"phone": "",
"website": "",
"summary": "Consultant - Android Application Development\n\nSpecialties: \n\n * Android Development (Hybrid, Native [Mobile/Phablet/Tablet], TV)\n * Server Side Scripting Language (PHP - ZendFramework/Symfony, JSP)\n * Database Management System (MySQL, Oracle, SQLite - Android)\n * Version Control System (SVN, Git [Github, Bitbucket, Stash])\n * Project Management/Collaboration (Trac, Bugzilla, JIRA, Trello)\n * Crash reporting platform (Crashlytics, Bugsense)\n * Build server (Jenkins, Travis CI)\n * IDE/Tools (Android Studio (IntelliJ IDEA), ADT, Eclipse, Aptana, Netbeans)\n * Unix/Linux OS Management",
"location": {
"address": "North York, Ontario, Canada",
"postalCode": "",
@amardeshbd
amardeshbd / MockSharedPreference.java
Last active Mar 13, 2020
Android Mock Shared Preference for unit testing. (NOTE: The intention here is to avoid mocking lots of API related to `SharedPreferences`, as outcome from interacting with `SharedPreferences` is not relevant in the unit test.). Please comment if there is a cleaner way of doing this.
View MockSharedPreference.java
import android.content.SharedPreferences;
import android.support.annotation.Nullable;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
@amardeshbd
amardeshbd / livetemplate.groovy
Last active Sep 14, 2019
Kotlin - Timber Log Live Template
View livetemplate.groovy
/*
Go to Android Studio Preferences
Editor > Live Template > Kotlin
Duplicate "soutp" and use following template for `$FORMAT`.
```
timber.log.Timber.d($FORMAT$)
```
Applicable in kotlin statement (it should be pre-selected for you, since you copied `soutp`)
@amardeshbd
amardeshbd / kml-to-android-maps-v2.php
Last active Jul 19, 2019
Snippet for parsing KML file and then converting to polygon shapes of Android Google Maps V2
View kml-to-android-maps-v2.php
<?php
/**
* Dirty way to parse the KML file and create equivalent polygons for android maps V2
*
* What it does:
* - Reads local KML file and looks for "Polygon" data, and converts them
* to equivalent simple polygon data for Android Maps V2
*
* What it does NOT do / Limitations:
* - Consider all possible DOM tree structure
View express-simple-api.js
/**
* Say hello API
* Try: https://mock-apis-server.firebaseapp.com/say/hello
*/
app.get('/say/hello', (req, res) => {
// Return success response
return res.status(200).json({"message":"Hello there... Welcome to mock server."});
});
/* [END `/say/hello` ] - must be added before `exports.api = ...` */
@amardeshbd
amardeshbd / express-and-firebase.js
Created Mar 13, 2019
Firebase and express barebone.
View express-and-firebase.js
'use strict';
// [START import]
const functions = require('firebase-functions');
const express = require('express');
const app = express();
// [END import]
// [START middleware]
const cors = require('cors')({origin: true});
@amardeshbd
amardeshbd / update-npm.sh
Created Mar 13, 2019
Update npm modules
View update-npm.sh
cd functions
npm install
cd ..
View firebase-use-project.sh
firebase use --add your-project-id-23d6x
You can’t perform that action at this time.