Skip to content

Instantly share code, notes, and snippets.

View mehmetkurt's full-sized avatar
🏛️
B2B & B2C Pro

Mehmet KURT mehmetkurt

🏛️
B2B & B2C Pro
View GitHub Profile
@hkulekci
hkulekci / solve.md
Last active October 5, 2023 20:08
Elasticsearch "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)" error

If u are getting below error while indexing:

{
  "error": {
    "root_cause": [
      {
        "type": "cluster_block_exception",
        "reason": "blocked by: [FORBIDDEN/12/index read-only / allow delete (api)];"
 }
@gbzarelli
gbzarelli / .OnBackPressedInFragment_ActivityUtils.kt
Last active January 29, 2024 02:50
Android - Adicionando onBackPressed com dois clicks no Fragment - Clicking the back button twice to exit in fragment
import android.os.CountDownTimer
import androidx.activity.OnBackPressedCallback
import androidx.fragment.app.FragmentActivity
import java.util.concurrent.atomic.AtomicBoolean
fun FragmentActivity.addOnBackPressedCallbackWithInterval(
millisToBack: Long,
firstPressed: () -> Unit
) {
onBackPressedDispatcher.addCallback(