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 / diff_of_run_let_also_apply.kt
Last active January 13, 2022 18:21
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 / 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
[Desktop Entry]
Type=Application
Encoding=UTF-8
Name=Shutdown
Comment=Shutdown the System
Icon=system-shutdown
Exec=shutdown -P now
Terminal=false
Categories=Utility
@ImaginativeShohag
ImaginativeShohag / how_to_connect_with_softether_vpn_client_in_linux.md
Last active February 19, 2021 22:05
How to connect with softether vpn client in linux
# ----------------------------------------------------------------
# Start and create vpn connection
# ----------------------------------------------------------------

# Download from https://www.softether-download.com/en.aspx?product=softether
# Select Software: SoftEther VPN (Freeware)
# Select Component: SoftEther VPN Client
# Select Platform: Linux
# Select CPU: Intel x64/AMD64 (64bit)
@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
@ImaginativeShohag
ImaginativeShohag / jetbrains-studio-rc.desktop
Last active March 8, 2021 05:41
Android Studio Release Candidate launch Icon: ~/.local/share/applications/jetbrains-studio-rc.desktop (https://developer.gnome.org/integration-guide/stable/desktop-files.html.en)
[Desktop Entry]
Categories=Development;IDE;
Comment=Everything you need to build on Android
Exec="/mnt/SourceCode/Software/Android/android-studio-rc/bin/studio.sh" %f
Icon=/mnt/SourceCode/Software/Android/android-studio-rc/bin/studio.png
Name=Android Studio RC
StartupWMClass=android-studio-rc
Terminal=false
Type=Application
Version=1.0
@ImaginativeShohag
ImaginativeShohag / generate_android_assets.sh
Last active June 20, 2021 21:03
Generate Android assets for different pixel density
#---------------------------------------------------------------
# Given an xxxhdpi image, this script
# creates different dpis resources and the necessary folders
# if they don't exist
#
# Place this script, as well as the source image, inside res
# folder and execute it passing the image filename as argument
#
# Example:
# ./drawables_dpis_creation.sh my_cool_xxhdpi_image.png
@ImaginativeShohag
ImaginativeShohag / TabLayout_bottom_line_custom_color.xml
Created March 18, 2020 09:18
Custom color for Android TabLayout bottom line
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:left="-10dp"
android:right="-10dp"
android:top="-10dp">
<shape android:shape="rectangle">
<solid android:color="@android:color/transparent" />
<stroke
android:width="2dp"