Skip to content

Instantly share code, notes, and snippets.

View shihabmi7's full-sized avatar
🎯
Focusing

Muhammad Shihab Uddin shihabmi7

🎯
Focusing
  • Dhaka, Bangladesh
View GitHub Profile
@shihabmi7
shihabmi7 / Privacy Policy
Created June 3, 2021 17:14
Privacy Policy Batikrom Shop
**Privacy Policy**
Md Shihab Uddin built the Batikrom Shop app as a Free app. This SERVICE is provided by Md Shihab Uddin at no cost and is intended for use as is.
This page is used to inform visitors regarding my policies with the collection, use, and disclosure of Personal Information if anyone decided to use my Service.
If you choose to use my Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that I collect is used for providing and improving the Service. I will not use or share your information with anyone except as described in this Privacy Policy.
The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Batikrom Shop unless otherwise defined in this Privacy Policy.
^(?:(?:\+|00)?88)?01[15-9]\d{8}$
https://stackoverflow.com/questions/15088518/validate-mobile-number-using-regular-expression
@shihabmi7
shihabmi7 / gist:d2dced293cb6ccebfb962a56e001a9ce
Created February 4, 2021 04:35
Singleton Shared Preference
object AppPreferences {
private const val NAME = "SpinKotlin"
private const val MODE = Context.MODE_PRIVATE
private lateinit var preferences: SharedPreferences
// list of app specific preferences
private val IS_FIRST_RUN_PREF = Pair("is_first_run", false)
fun init(context: Context) {
preferences = context.getSharedPreferences(NAME, MODE)
}
@shihabmi7
shihabmi7 / AirportMapper.kt
Last active September 23, 2020 06:33
Get Airport Details from IATA provided JSON file (airports.json) in Android
import android.os.Parcelable
import kotlinx.android.parcel.Parcelize
@Parcelize
data class AirportMapper(
val codeIcaoAirport: String? = null,
val geonameId: String? = null,
val airportId: Int? = null,
val timezone: String? = null,
val codeIso2Country: String? = null,
package net.sharetrip.ui.holiday.booking.view.summary
import android.content.res.Resources
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Rect
import android.view.View
import android.view.animation.AccelerateDecelerateInterpolator
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
@shihabmi7
shihabmi7 / api_module.kt
Created August 12, 2020 07:10
Sent Plain JSON as String with Moshi & Retrofit
want to sent plain json as post request, with retrofit and moshi converter ???
{"id":1,"firstName":"Lokesh","lastName":"Gupta","roles":["ADMIN","MANAGER"]}
Retrofit.Builder()
.client(client)
.baseUrl(baseUrl)
.addConverterFactory(ScalarsConverterFactory.create()) // you need to add this for sending plain json object
.addConverterFactory(MoshiConverterFactory.create(moshi))
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
@shihabmi7
shihabmi7 / MainActivity
Last active April 7, 2020 21:12
Location Updates in Kotlin
/*
Copyright 2017 Google Inc. All Rights Reserved.
<p>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
<p>
http://www.apache.org/licenses/LICENSE-2.0
<p>
Unless required by applicable law or agreed to in writing, software
@shihabmi7
shihabmi7 / MySQL_macOS_Sierra.md
Last active October 24, 2019 08:14 — forked from nrollr/MySQL_macOS_Sierra.md
Install MySQL on Hi-Sierra using Homebrew : Tested

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :

/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software