Skip to content

Instantly share code, notes, and snippets.

View herman-peralta-ben's full-sized avatar
🧐

Herman Peralta herman-peralta-ben

🧐
  • Mexico City
View GitHub Profile
@herman-peralta-ben
herman-peralta-ben / ExampleInitializers.kt
Created September 18, 2025 21:15
Example usage of Initializer, skip initializations on Application class.
package com.example
import android.content.Context
import android.util.Log
import androidx.startup.Initializer
/*
* Add in Manifest:
* ```xml
* <application...>
@herman-peralta-ben
herman-peralta-ben / TestUsingAndroidLog.kt
Created September 18, 2025 20:54
Example using Android's Log in unit tests using Mockk
package com.example
import android.util.Log
import io.mockk.confirmVerified
import io.mockk.every
import io.mockk.mockk
import io.mockk.mockkStatic
import io.mockk.unmockkAll
import io.mockk.verify
import org.junit.After

🇫🇷🇫🇷 Notas de Francés 🇫🇷🇫🇷

PP: Pronombres Personales - Pronom Personnels

PR: Pronombre Reflexivo

e.g. para el verbo Llamar los PP son [me, te] en ["Yo me llamo", "Tu te llamas"].

No todos los verbos lo tienen: e.g. Cantar: "Yo canto", "Tú cantas".

|Pronoms Personnels|Pronombre Reflexivo|Terminación|

@herman-peralta-ben
herman-peralta-ben / git_cheatsheet.md
Last active June 25, 2025 02:30
Git utility commands cheat sheet

Git cheatsheet

Aliases

  • Edit the [alias] block of your ~/.gitconfig file.
  • Run the alias with git <alias>, e.g. git cl.
[alias]
    # Basics
@herman-peralta-ben
herman-peralta-ben / git-reset-author.sh
Created February 10, 2024 00:02 — forked from bgromov/git-reset-author.sh
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@herman-peralta-ben
herman-peralta-ben / flutter_cubit_snippets.dart
Last active July 11, 2023 17:15
Example about how to create a Flutter Cubit.
///
/// Example about how to create a Flutter Cubit.
///
/// VSCode Region comment extension: https://marketplace.visualstudio.com/items?itemName=maptz.regionfolder
///
/// pubspec.yaml:
/// ...
/// dependencies:
/// ...
/// # cubit, bloc
// usage: $ gradle -b coffee.gradle -q blackCoffee
// Create a sample task graph for creating a coffee.
// usage of dependsOn and finalizedBy
// https://learn.udacity.com/courses/ud867/lessons/248c0ed2-87d0-40aa-9389-4eecef99a674/concepts/50003b1d-cbd5-4776-94a3-b0a946d14555/instructions
// blackCofee: create a coffee
// sweetCoffee: add sweet to created cofee
// run $gradle tasks and verify output. Gradle < 3.3 shows an "Other tasks" section for tasks in the graph.
// Gradle >= 3.3 requires the tasks to be part of a group
@herman-peralta-ben
herman-peralta-ben / CoroutinesParallelVsConcurrent.kt
Last active February 20, 2022 15:30
Kotlin coroutines parallel vs concurrent execution
import kotlin.system.measureTimeMillis
import kotlinx.coroutines.async
import kotlinx.coroutines.delay
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withContext
import java.math.BigInteger
@herman-peralta-ben
herman-peralta-ben / fatality.sh
Last active October 4, 2018 01:03
Android Studio clean fatality (KILL IT)
#!/bin/sh
#########################
# Usage:
# Android Studio force clean script.
# Run from project root.
# Follow instructions printed by script.
#
# Requirements:
# JAVA_HOME variable set.
@herman-peralta-ben
herman-peralta-ben / .gitignore
Created August 3, 2018 02:13
.gitignore python
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]