Skip to content

Instantly share code, notes, and snippets.

Erick Navarro cutiko

Block or report user

Report or block cutiko

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cutiko
cutiko / Copier.kt
Last active Sep 10, 2019
How does copy works on Kotlin
View Copier.kt
package copier
import java.util.*
class Copier {
companion object {
@JvmStatic
fun main(args: Array<String>) {
println("lets see default behaviour")
@cutiko
cutiko / JavaAdapter.java
Created Jul 20, 2019
Adapter template for Android Studio
View JavaAdapter.java
#if (${PACKAGE_NAME} && ${PACKAGE_NAME} != "")package ${PACKAGE_NAME};#end
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
#set($model = $NAME.replace('sAdapter', ''))
#set($holder = $model+'Holder')
#set($item = $model.toLowerCase())
@cutiko
cutiko / RestartAppAdb.md
Created Jul 3, 2019
Restart Android App using ADB
View RestartAppAdb.md

Remember to replace com.domain.appname with your actual app package name

adb shell am force-stop com.domain.appname
adb shell am start -n com.domain.appname/com.domain.appname.MainActivity
@cutiko
cutiko / infinity.kt
Created Jun 6, 2019
Inifinity is a double
View infinity.kt
fun main(args: Array<String>) {
System.out.println("Lets buy beer")
buyBeer(1.0)
buyBeer(2.0)
buyBeer("Infinity".toDouble())
}
fun buyBeer(beer : Double) = System.out.println("You are buying $beer beers and is more than one beer ${beer > 1}")
@cutiko
cutiko / index.js
Created May 2, 2019
Functions custom claims example
View index.js
exports.userCreationListener = functions.auth.user().onCreate(user => {
const admins = {
"first@admin.com": true
};
const email = user.email;
if (!admins[email]) {
return false;
}
const uid = user.uid;
return admin.auth().setCustomUserClaims(uid, {superAdmin: true}).then(
@cutiko
cutiko / Timezones.md
Last active Mar 15, 2019
All the TimeZone IDS
View Timezones.md
@cutiko
cutiko / AvailableBox.java
Last active Feb 6, 2019
How to create forms
View AvailableBox.java
public class AvailableBox extends Checkbox implements FormField, OnCheckChangeListener {
private ErrorCallback errorCallback;
private User user;
//use the constructor with 1 argument for using only on java and the constructor with 2 arguments for using on xml
public AvailableBox(...) {
//you can add any MUST HAVE behaviour in the constructor
setOnCheckChangedListener(this);
}
@cutiko
cutiko / README.md
Last active Feb 1, 2019
Simple script for spelling correction from a file
View README.md

This scripts use LanguageTool for english spelling you can change it if you want to

This scripts also use Pando please make sure installing it before continue

  1. Copy the script to your bin directory, on mine is called spelling
  2. sudo chmod 755 FILENAME
  3. Use it :)
@cutiko
cutiko / Readme.md
Last active Jan 30, 2019
Interactive commit with text prompt for bash
View Readme.md

This project has moved to a Github repo

igit repo

icommit

Simple command for an interactive commit with an input prompt in the bash terminal

icommit demo gif

  1. open terminal
@cutiko
cutiko / regexCheatsheet.js
Created Jan 10, 2019 — forked from sarthology/regexCheatsheet.js
A regex cheatsheet 👩🏻‍💻 (by Catherine)
View regexCheatsheet.js
let regex;
/* matching a specific string */
regex = /hello/; // looks for the string between the forward slashes (case-sensitive)... matches "hello", "hello123", "123hello123", "123hello"; doesn't match for "hell0", "Hello"
regex = /hello/i; // looks for the string between the forward slashes (case-insensitive)... matches "hello", "HelLo", "123HelLO"
regex = /hello/g; // looks for multiple occurrences of string between the forward slashes...
/* wildcards */
regex = /h.llo/; // the "." matches any one character other than a new line character... matches "hello", "hallo" but not "h\nllo"
regex = /h.*llo/; // the "*" matches any character(s) zero or more times... matches "hello", "heeeeeello", "hllo", "hwarwareallo"
You can’t perform that action at this time.