Skip to content

Instantly share code, notes, and snippets.

View ImaginativeShohag's full-sized avatar
🍟
Already hungry...

Md. Mahmudul Hasan Shohag ImaginativeShohag

🍟
Already hungry...
View GitHub Profile

Keybase proof

I hereby claim: * I am imaginativeshohag on github. * I am imshohag (https://keybase.io/imshohag) on keybase. * I have a public key ASCmrYOpcYqJupNMG5Nj3rbTq-HU8UZdd5MdN8qEKoHNkAo To claim this, I am signing this object:

{   "body": {     "key": {       "eldest_kid": "0120a6ad83a9718a89ba934c1b9363deb6d3abe1d4f1465d77931d37ca842a81cd900a",       "host": "keybase.io",       "kid": "0120a6ad83a9718a89ba934c1b9363deb6d3abe1d4f1465d77931d37ca842a81cd900a",       "uid": "292f8d4922673dd8de6b11fc0ff28c19",       "username": "imshohag"     },     "merkle_root": {       "ctime": 1535416578,       "hash": "14050c214ae3d0747bd429a0f51f9f326b8279c0c586712e891b146facef0066d6e120a88450c47a95f396d71071d115abd95a3657efc643e1330db028d34f45",       "hash_meta": "87171f405f2f23e6564c408c50989bda54d8c362675dfcc91f979813bb708231",       "seqno": 3523929     },     "service": {       "entropy": "c+rm4FckA5p/3aVJ+hpZ5PWi",       "name": "github",       "username": "imaginativeshohag"     },     
<?php
/**
* Gist by:
* Md. Mahmudul Hasan Shohag
* imaginativeshohag@gmail.com
*
* Help Doc:
* - https://firebase.google.com/docs/cloud-messaging/http-server-ref
*
* How to get FCM Server Kay:
<?php
/**
* Gist by:
* Md. Mahmudul Hasan Shohag
* imaginativeshohag@gmail.com
*
* Help Doc:
* - https://firebase.google.com/docs/cloud-messaging/http-server-ref
*
* How to get FCM Server Kay:
@ImaginativeShohag
ImaginativeShohag / Retrofit2ApiClient.java
Last active June 30, 2019 17:07
Retrofit 2 Api Client Class
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class ApiClient {
private static Retrofit retrofit = null;
private static OkHttpClient buildClient() {
@ImaginativeShohag
ImaginativeShohag / Retrofit2MultiPartFileUploadApiInterface.java
Created June 30, 2019 19:07
Retrofit2 Multi Part File Upload ApiInterface class
import java.util.List;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.Call;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
public interface ApiInterface {
@ImaginativeShohag
ImaginativeShohag / ubuntu_change_resolution.sh
Created July 13, 2019 03:49
Ubuntu: Change monitor resolution of Unknown Display
#!/bin/bash
xrandr --newmode $(cvt 1920 1080 60 | grep Mode | sed -e 's/.*"/1920x1080/') 2> /dev/null
xrandr --addmode VGA-1 1920x1080
xrandr --output VGA-1 --mode 1920x1080
@ImaginativeShohag
ImaginativeShohag / push-to-multi-repository.sh
Last active August 6, 2019 12:31
Script for Pushing Source Code to Multiple Git Repository.
#!/bin/bash
# ================================================================================
# This script will push source code to other repository.
# Version: 1.0
#
# Coded by:
# Md. Mahmudul Hasan Shohag
# imaginativeshohag@gmail.com
# github.com/ImaginativeShohag
@ImaginativeShohag
ImaginativeShohag / push-same-commit-to-multi-repository.sh
Last active August 18, 2019 12:30
This script will push source code to two repositories at a time to maintain the same commit history.
#!/bin/bash
# ================================================================================
# This script will push source code to two repositories at a time to maintain the
# same commit history.
# Version: 1.0
#
# Coded by:
# Md. Mahmudul Hasan Shohag
# imaginativeshohag@gmail.com
@ImaginativeShohag
ImaginativeShohag / event_overlap_checker_algorithm.kt
Last active December 29, 2019 17:22
Check if an event overlaps with other events. https://pl.kotl.in/3G0a6x1fz
private val appointmentEventList = mutableListOf<AppointmentEvent>()
/**
* Note: Time should be 24 hours.
**/
fun main() {
appointmentEventList.add(AppointmentEvent(230, 300)) // 02:30 - 03:00
appointmentEventList.add(AppointmentEvent(600, 700)) // 06:00 - 07:00
appointmentEventList.add(AppointmentEvent(700, 800)) // 07:00 - 08:00