Skip to content

Instantly share code, notes, and snippets.

View cutiko's full-sized avatar

Erick Navarro cutiko

View GitHub Profile
@cutiko
cutiko / GeoExecutor.java
Created December 12, 2018 16:05
ThreadPoolExecutor java example
import android.os.Process;
import android.util.Log;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
/**
* Created by cutiko on 30-11-17.
@cutiko
cutiko / Readme.md
Last active November 8, 2023 22:09
Firebase CLI Cheat Sheet

functions and admin are for the functions project, same folder containing package.json

npm install firebase-functions@latest firebase-admin@latest --save

firebase-tools is the cli and should be global with sudo

@cutiko
cutiko / Readme.md
Created November 6, 2018 00:09
How to multi email login with Firebase

General Logic

1 user see an email input 2 onCall to Functions, it will check users/{userEmailInput}:secretPushKey 2.a if the node don't exist it means is a sign up, onCall will reply the same email 2.b if the node exist onCall will check registrations/{secretPushKey}/{userEmailInput}, the object on secretPushKey is like this:

   {
 email1:true,
@cutiko
cutiko / drawable_example.xml
Created October 5, 2018 20:14
Android what is a drawable
<!--
Look in android we can use drawables written on xml
Like this:
-->
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<solid android:color="@android:color/white" />
<corners android:radius="4dp" />
<stroke android:width="1.7dp" android:color="@color/colorAccent" />
@cutiko
cutiko / BodyPager.java
Created August 28, 2018 17:44
Self measuring view pager
package io.livetolearn.livetolearn.views.profile.combined;
import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.View;
public class BodyPager extends ViewPager {
@cutiko
cutiko / readme.md
Last active August 16, 2018 20:19
Cambio de fecha en la presentación proyecto G6

Introducción

El cambio de fecha para la entrega del proyecto no es general sino que hay que postular a ello.

Postulación

El alumno debe enviar al mail indicado en el documento del proyecto aldoagallardo@gmail.com su avance:

  • apk de debugeo
  • repositorio.

La fecha de la postulación es hasta la fecha original el 23 de Agosto.

@cutiko
cutiko / activity_login_pretty.xml
Last active May 16, 2018 23:59
Logins examples using RelativeLayout
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context=".InfoActivity">
<ImageView
@cutiko
cutiko / Readme.md
Last active April 4, 2018 00:27
Como inicializar un repo en Android Studio

Instale git https://git-scm.com/

En el menu superior VCS/Enable Version Control Integration

Seleccione git

Si es que hay algún error el problema más probable es que git no se haya configurado con Android Studio, vaya a las opciones y busque "git". En las opciones de git, tiene que hacer referencia a un archivo que se llama git que quedó instalado dentro de la carpeta donde se instaló git, dentro de una carpeta que se llama bin

Si le resultó el Enable Version Control Integration entonces va a ver que en la parte inferior hay un nuevo tab que se llama "Version Control"

@cutiko
cutiko / HostActivity.java
Created March 30, 2018 00:50
Comunicar Fragment con Activity
public class HostActivity extends AppCompatActivity implements TheInterface {
//TODO skipping other methods for simplicity
@Override
public void innerInterfaceMethod(String example) {
//That string is from the Fragment, get it and do anything with it
}
}
@cutiko
cutiko / example.md
Created March 21, 2018 22:38
Retrofit array querymap

The non-Map-based annotations support both List and array types for repetition. From @Query:

@GET("/list")
void list(@Query("category") String... categories);
Calling with foo.list("bar", "baz") yields /list?category=foo&category=bar.

Just use a[] as the key.