Skip to content

Instantly share code, notes, and snippets.

View nicemak's full-sized avatar
👨‍💻
Working

Mohsin Ahmed Khan nicemak

👨‍💻
Working
  • Sr. Android Developer @ Bosch Pharma Pvt. Ltd.
  • Karachi, Pakistan
View GitHub Profile
@danielcshn
danielcshn / fix-duplicate-class-android-studio.md
Created April 16, 2023 04:08
Fix Duplicate class kotlin.collections.jdk8.CollectionsJDK8Kt found in modules kotlin-stdlib-* Android Studio | 2022.2.1

📜 Info:

  • Android Studio Flamingo | 2022.2.1
  • Build #AI-222.4459.24.2221.9862592, built on March 31, 2023
  • Gradle JDK: jbr-17 (JetBrains Runtime version 17.0.6)
  • Windows 11 (version 10.0.22000.1817)

🐛 Bug/Error log:

@saikiran91
saikiran91 / BaseUpdateCheckActivity.kt
Last active May 12, 2022 17:13
Android officially announced the in-app updates. https://developer.android.com/guide/app-bundle/in-app-updates. This is the code sample for handling both IMMEDIATE and FLEXIBLE updates in a single activity; Kotlin way.
import android.app.Activity
import android.content.Intent
import android.content.IntentSender
import android.os.Bundle
import android.widget.Toast
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import com.google.android.material.snackbar.Snackbar
import com.google.android.play.core.appupdate.AppUpdateManager
import com.google.android.play.core.appupdate.AppUpdateManagerFactory
@JerryLokjianming
JerryLokjianming / Crack Sublime Text Windows and Linux.md
Last active July 20, 2024 18:39
Crack Sublime Text 3.2.2 Build 3211 and Sublime Text 4 Alpha 4098 with Hex

How to Crack Sublime Text 3.2.2 Build 3211 with Hex Editor (Windows | Without License) ↓

  1. Download & Install Sublime Text 3.2.2 Build 3211
  2. Visit https://hexed.it/
  3. Open file select sublime_text.exe
  4. Offset 0x8545: Original 84 -> 85
  5. Offset 0x08FF19: Original 75 -> EB
  6. Offset 0x1932C7: Original 75 -> 74 (remove UNREGISTERED in title bar, so no need to use a license)
@osrl
osrl / Call.kt
Last active September 9, 2020 08:41
A Kotlin extension function to Retrofit Call class
inline fun <T> Call<T>.enqueue(crossinline onResult: Result<T>.() -> Unit) {
enqueue(object : Callback<T> {
override fun onFailure(call: Call<T>?, t: Throwable?) {
onResult(Result.Error(ApiError("Network error")))
}
override fun onResponse(call: Call<T>?, response: Response<T>) {
onResult(response.result())
}
})
@scruffyfox
scruffyfox / VideoPlayer.kt
Last active February 1, 2023 12:57
Playing a video from Assets using ExoPlayer 2
/**
* It took me AGES to figure this out, seriously, exoplayer documentation IS SO BAD.
*/
package xxx
import android.net.Uri
import android.os.Bundle
import android.support.v7.app.AppCompatActivity
import com.cube.arc.R