Skip to content

Instantly share code, notes, and snippets.

View evlymn's full-sized avatar
🏠
Working from home

Evelyn Mendes evlymn

🏠
Working from home
View GitHub Profile
@evlymn
evlymn / emulators-persist-data.sh
Created October 24, 2022 13:28
Firebase Emulators Persist Data
firebase emulators:start --import=./emulators-data --export-on-exit
@evlymn
evlymn / cleanString-hashcode.ts
Last active September 10, 2022 03:39
Clean String and Hash Code Typescript
cleanString = (str: string) => str.replace(/[^\w ]/g, '').replace(/\s/g, '');
hash = (str: string) => str.split('').reduce((prev, curr) => (((prev << 5) - prev) + curr.charCodeAt(0)) | 0, 0);
@evlymn
evlymn / install-remove-firebase-tools-with-curl.txt
Created June 19, 2022 16:15
install and remove firebase-tools with curl
curl -sL firebase.tools | upgrade=true bash
curl -sL firebase.tools | uninstall=true bash
<html>
<head>
<style>
html,
body {
width: 100%;
height: 100%;
padding: 0px;
margin: 0px;
@evlymn
evlymn / storage.service.ts
Last active April 12, 2023 14:44
Storage Service Modular Firebase 9
import {Injectable} from '@angular/core';
import {
deleteObject,
getDownloadURL,
percentage,
ref,
Storage,
StringFormat,
uploadBytes,
uploadBytesResumable,
@evlymn
evlymn / authentication.service.ts
Last active October 20, 2022 07:03
Authentication Service Modular Firebase 9
import { Injectable, NgZone } from '@angular/core';
import {
Auth, signOut, user, signInWithEmailAndPassword, createUserWithEmailAndPassword,
updateProfile, sendEmailVerification, sendPasswordResetEmail, User, authState, onAuthStateChanged,
ActionCodeSettings
// getAdditionalUserInfo,
// OAuthProvider,
// linkWithPopup,
// unlink,
// updateEmail,
@evlymn
evlymn / firestore.service.ts
Last active August 29, 2023 19:29
Firestore Basics, Modular Firebase 9
import { Injectable } from '@angular/core';
import { Firestore, collectionData, collection, QueryConstraint } from '@angular/fire/firestore';
import { addDoc, CollectionReference, deleteDoc, doc, getDoc, query, setDoc, updateDoc } from '@firebase/firestore';
import { enableIndexedDbPersistence } from 'firebase/firestore';
@Injectable({
providedIn: 'root'
})
export class FirestoreService {
@evlymn
evlymn / index.ts
Created May 26, 2021 22:11
initialize app
const serviceAccountKey = require('./firebaseConfig');
const admin = require('firebase-admin');
admin.initializeApp({
credential: admin.credential.cert(serviceAccountKey),
databaseURL: 'https://simplesapp-realtime.firebaseio.com',
});
@evlymn
evlymn / firebaseConfig.ts
Created May 26, 2021 22:08
firebase config
module.exports = {
type: 'service_account',
project_id: 'project_id',
private_key_id: 'private_key_id',
private_key: 'private_key',
client_email: 'client_email',
client_id: 'client_id',
auth_uri: 'https://accounts.google.com/o/oauth2/auth',
token_uri: 'https://oauth2.googleapis.com/token',
auth_provider_x509_cert_url: 'https://www.googleapis.com/oauth2/v1/certs',
@evlymn
evlymn / default.json
Created July 5, 2020 18:00
iTerm Default Theme
{
"Ansi 6 Color" : {
"Red Component" : 0,
"Color Space" : "sRGB",
"Blue Component" : 0.78166204690933228,
"Alpha Component" : 1,
"Green Component" : 0.77425903081893921
},
"Tags" : [