Skip to content

Instantly share code, notes, and snippets.

View thatfiredev's full-sized avatar
🧙
hidden wizard behind the curtain

Rosário P. Fernandes thatfiredev

🧙
hidden wizard behind the curtain
View GitHub Profile
@thatfiredev
thatfiredev / MainActivity.kt
Created June 11, 2020 14:47
Load images from Cloud Firestore on an Android App using firecoil
val imageView: ImageView
val imageRef = storageRef.child("users/me/profile.png")
imageView.load(imageRef)
@thatfiredev
thatfiredev / MainActivity.kt
Created June 11, 2020 14:18
Load images from Cloud Storage for Firebase using Coil
val imageView: ImageView
val storageRef = FirebaseStorage.getInstance().reference
val imageRef = storageRef.child("users/me/profile.png")
imageRef.downloadUrl.addOnSuccessListener { url ->
imageView.load(url)
}.addOnFailureListener {
// Handle any errors
}
@thatfiredev
thatfiredev / build.gradle
Last active June 11, 2020 13:56
Gist showing how to enable Java 8 on an Android App
android {
// ... all the other configurations
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
@thatfiredev
thatfiredev / AuthActivity.kt
Created April 25, 2020 19:53
What's New in Firebase 01
val firebaseAuth = Firebase.auth // Equivalent to FirebaseAuth.getInstance()
// Update a user's profile
// https://firebase.google.com/docs/auth/android/manage-users#update_a_users_profile
firebaseAuth.currentUser?.updateProfile(userProfileChangeRequest {
displayName = "Jane Doe"
photoUri = Uri.parse("https://profile.picture.url")
})
// Passing state/continue URL in email actions

How to use this code

  1. Add the build_pull_request.sh to the root of your git repository;
  2. Add the android.yml file to .github/workflows/;
  3. Make build_pull_request.sh executable using: chmod +x build_pull_request.sh;
  4. Commit your code and push the changes

LICENSE

# MIT License

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
{
"utilizadores":{
"uid1":{
"nome":"Rosário"
},
"uid2":{
"nome":"Paulo"
},
"uid3":{
"nome":"Superman"
public class NotificationJobService extends JobService{
private final String TAG = NotificationJobService.class.getSimpleName();
private AsyncTask backgroundTask;
@Override
public boolean onStartJob(JobParameters job) {
//Executar todo trabalho no background
backgroundTask = new AsyncTask()
{
@thatfiredev
thatfiredev / MyJobService.java
Last active January 9, 2018 22:28
Utilizado no artigo O job dos Jobs - JobServices https://medium.com/@rosariopfernandes/job2-fbf022368795
public class MyJobService extends JobService{
@Override
public boolean onStartJob(JobParameters job) {
jobFinished(job,false);
return false; //Ainda há algo a ser executado?
}
@Override
public boolean onStopJob(JobParameters job) {
@thatfiredev
thatfiredev / BaseDados.java
Created July 17, 2017 01:01
Utilizado no artigo Android Architecture Components - LiveData: https://medium.com/@rosariopfernandes/aac6-b46de8513df8
package io.github.rosariopfernandes.aac;
import android.arch.persistence.room.Database;
import android.arch.persistence.room.Room;
import android.arch.persistence.room.RoomDatabase;
import android.content.Context;
/**
* Created by rosariopfernandes on 6/15/17.
*/