Skip to content

Instantly share code, notes, and snippets.

View jflavio11's full-sized avatar

Jose Flavio Quispe Irrazábal jflavio11

View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active June 17, 2025 18:57
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@leonardoaramaki
leonardoaramaki / Debouncer.kt
Created November 16, 2021 16:59
Add click debouncing logic to Jetpack Compose
/**
* Wraps an [onClick] lambda with another one that supports debouncing. The default deboucing time
* is 1000ms.
*
* @return debounced onClick
*/
@Composable
inline fun debounced(crossinline onClick: () -> Unit, debounceTime: Long = 1000L): () -> Unit {
var lastTimeClicked by remember { mutableStateOf(0L) }
val onClickLambda: () -> Unit = {
@sagar-viradiya
sagar-viradiya / Trie.kt
Created December 30, 2018 12:08
Trie data structure in kotlin
class Trie {
data class Node(var word: String? = null, val childNodes: MutableMap<Char, Node> = mutableMapOf())
private val root = Node()
fun insert(word: String) {
var currentNode = root
for (char in word) {
if (currentNode.childNodes[char] == null) {
@bmaupin
bmaupin / free-backend-hosting.md
Last active June 16, 2025 07:39
Free backend hosting
@arnaudgiuliani
arnaudgiuliani / JavaApp.java
Created February 27, 2018 16:04
Koin for Android Java app
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
// Call helper to start Koin
JavaAppKoinKt.start(this);
}
}
@ironic-name
ironic-name / EmailValidator.kt
Last active September 30, 2024 09:12
Kotlin regex email validator function
fun isEmailValid(email: String): Boolean {
return Pattern.compile(
"^(([\\w-]+\\.)+[\\w-]+|([a-zA-Z]|[\\w-]{2,}))@"
+ "((([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\."
+ "([0-1]?[0-9]{1,2}|25[0-5]|2[0-4][0-9])\\.([0-1]?"
+ "[0-9]{1,2}|25[0-5]|2[0-4][0-9]))|"
+ "([a-zA-Z]+[\\w-]+\\.)+[a-zA-Z]{2,4})$"
).matcher(email).matches()
}
@mohsin
mohsin / KEYSTORE.md
Last active January 4, 2021 22:05
Using Keystore properties in Android Projects
  1. Add to project-level build.gradle:
allprojects {
    ...
    afterEvaluate { project ->
        def propsFile = rootProject.file('keystore.properties')
        def configName = 'release'

        if (propsFile.exists() && project.hasProperty("android") && project.android.signingConfigs.hasProperty(configName)) {
@JosiasSena
JosiasSena / DeCryptor.java
Last active September 12, 2023 12:40
Encryptor and Decryptor for data encryption.decryption using the Android KeyStore.
/**
_____ _____ _
| __ \ / ____| | |
| | | | ___| | _ __ _ _ _ __ | |_ ___ _ __
| | | |/ _ \ | | '__| | | | '_ \| __/ _ \| '__|
| |__| | __/ |____| | | |_| | |_) | || (_) | |
|_____/ \___|\_____|_| \__, | .__/ \__\___/|_|
__/ | |
|___/|_|
*/
@gabornovakp
gabornovakp / AnimationUtils.java
Created January 5, 2017 19:17
Final version of AnimationUtils
public class AnimationUtils {
public interface AnimationFinishedListener {
void onAnimationFinished();
}
public static int getMediumDuration(Context context) {
int duration;
if (isAnimationEnabled()) {
duration = context.getResources().getInteger(android.R.integer.config_mediumAnimTime);
} else {
/*
* Copyright 2016 Google Inc.
*
* 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