Skip to content

Instantly share code, notes, and snippets.

View jflavio11's full-sized avatar
💻
Developing

Jose Flavio Quispe Irrazábal jflavio11

💻
Developing
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active June 22, 2024 15:43
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.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@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 24, 2024 13:18
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 23, 2022 18:03
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
@kamikat
kamikat / layout.xml
Last active September 1, 2021 17:40
NestedScrollView + SwipeRefreshLayout + RecyclerView
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/refreshLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout