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
@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
# [email protected]
@ImaginativeShohag
ImaginativeShohag / diff_of_run_let_also_apply.kt
Last active July 1, 2024 18:51
Difference between with, run, let, also and apply in Kotlin.
/**
* Difference between with, run, let, also and apply in Kotlin.
*
* Official doc: https://kotlinlang.org/docs/scope-functions.html#functions
*
* Awesome blog posts:
* - https://www.journaldev.com/19467/kotlin-let-run-also-apply-with
* - https://medium.com/@fatihcoskun/kotlin-scoping-functions-apply-vs-with-let-also-run-816e4efb75f5
* - https://medium.com/@elye.project/mastering-kotlin-standard-functions-run-with-let-also-and-apply-9cd334b0ef84
*/
@ImaginativeShohag
ImaginativeShohag / RealPathUtil.java
Last active December 8, 2022 04:49
Real Path Utility class for Android. Tested till API 29. Kotlin version: https://gist.github.com/ImaginativeShohag/4e53572141c017369941bbbaac538576
import android.annotation.SuppressLint;
import android.content.ContentUris;
import android.content.Context;
import android.database.Cursor;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
@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
# [email protected]
# github.com/ImaginativeShohag
@ImaginativeShohag
ImaginativeShohag / How to Create and Use a VeraCrypt Container.md
Last active December 29, 2024 12:34
How to Create and Use a VeraCrypt Container

Create a VeraCrypt container

Step 1: Install VeraCrypt from https://www.veracrypt.fr

Step 2: Open VeraCrypt and Click Create Volume

Step 3: Selete what type of container you want to create

Encrypted file container

To create a file as a encrypted container select Create an encrypted file container.

@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 / 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 / android_libraries_and_tools.md
Last active March 1, 2022 08:22
Android Libraries & Tools
<?php
/**
* Gist by:
* Md. Mahmudul Hasan Shohag
* [email protected]
*
* Help Doc:
* - https://firebase.google.com/docs/cloud-messaging/http-server-ref
*
* How to get FCM Server Kay: