This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const route = '/products/:id'; | |
type Split<S extends string> = S extends '' | |
? [] | |
: S extends `${infer C}${infer R}` | |
? [C, ...Split<R>] | |
: never | |
type RequestHandler<TRoute extends string> = { | |
params: TRoute extends `${infer _}:${infer R}` ? { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"estados": [ | |
{ | |
"sigla": "AC", | |
"nome": "Acre", | |
"cidades": [ | |
"Acrelândia", | |
"Assis Brasil", | |
"Brasiléia", | |
"Bujari", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface Person { | |
name: string; | |
age: number; | |
extraInformation: { | |
salary: number; | |
role: string; | |
} | |
} | |
type Stringify<T> = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Database (Firestore) | |
* Authentication | |
* Functions | |
* Triggers | |
Registrando objetos com AngularFire2 - See docs | |
Estrutura do banco |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- https://developer.mozilla.org/pt-BR/docs/Web/API/MutationObserver --> | |
<ion-content> | |
<div> | |
<message *ngFor></message> | |
</div> | |
</ion-content> | |
<script> | |
const llist = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as functions from 'firebase-functions'; | |
import { app } from '../../../utils/admin'; | |
import { ERRORS } from '../../../consts/errors'; | |
| |
const getCountCommentsByPost = async (post: FirebaseFirestore.QueryDocumentSnapshot): Promise<number> => { | |
const comments = await post.ref.collection('comments').get(); | |
const postComments = comments.size; | |
const subCommentsPromises = comments.docs.map(comment => comment.ref.collection('subcomments').get()); | |
const subComments = await Promise.all(subCommentsPromises); | |
const totalSubcomments = subComments.map(subComment => subComment.size).reduce((prev, curr) => prev + curr, 0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Routes | |
const routes: Routes = [ | |
{ | |
canActivate: [UnauthenticatedGuard], | |
path: 'signin', | |
loadChildren: './pages/signin/signin.module#SigninPageModule', | |
}, | |
{ | |
canActivate: [AuthenticatedGuard], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AngularFirestore, QueryFn } from '@angular/fire/firestore'; | |
import { Injectable } from '@angular/core'; | |
import { Observable } from 'rxjs-compat'; | |
import { map } from 'rxjs/operators'; | |
import * as firebase from 'firebase'; | |
@Injectable() | |
export class FirebaseService<T> { | |
constructor( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ $TILIX_ID ] || [ $VTE_VERSION ]; then | |
source /etc/profile.d/vte.sh | |
fi | |
# If you come from bash you might have to change your $PATH. | |
# export PATH=$HOME/bin:/usr/local/bin:$PATH | |
# Path to your oh-my-zsh installation. | |
export ZSH=/home/mduraes1994/.oh-my-zsh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ion-datetime | |
displayFormat="DD/MM/YYYY" | |
pickerFormat="DD/MMM/YYYY" | |
formControlName="dtBirth" | |
cancelText="Cancelar" | |
doneText="Ok" | |
monthShortNames='JAN, FEV, MAR, ABR, MAI, JUN, JUL, AGO, SET, OUT, NOV, DEZ'> | |
</ion-datetime> |