Skip to content

Instantly share code, notes, and snippets.

View NyaGarcia's full-sized avatar
🐈

Nya NyaGarcia

🐈
View GitHub Profile
@NyaGarcia
NyaGarcia / keybindings.json
Created March 31, 2022 10:59
Adding scss support
{
"key": "ctrl+s",
"command": "extension.multiCommand.execute",
"args": {
"sequence": ["postcssSorting.execute", "workbench.action.files.save"]
},
"when": "editorLangId == css || editorLangId == scss"
},
{
"key": "ctrl+meta+s",
@NyaGarcia
NyaGarcia / keybindings.json
Created March 31, 2022 10:58
Sort on save keybinding
{
"key": "ctrl+s",
"command": "extension.multiCommand.execute",
"args": {
"sequence": ["postcssSorting.execute", "workbench.action.files.save"]
},
"when": "editorLangId == css"
},
{
"key": "ctrl+meta+s",
@NyaGarcia
NyaGarcia / auth.service.ts
Created December 28, 2021 22:05
AuthService without types
import { Auth, signInWithEmailAndPassword } from '@angular/fire/auth';
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root',
})
export class AuthService {
constructor(private auth: Auth) {}
@NyaGarcia
NyaGarcia / login-data.interface.ts
Created December 28, 2021 22:01
the LoginData interface
export interface LoginData {
email: string;
password: string;
}
@NyaGarcia
NyaGarcia / dashboard.component.html
Last active December 28, 2021 14:16
Creating the dashboard component
<mat-toolbar></mat-toolbar>
<div class="background">
<h1>Welcome to the NgBytes Dashboard</h1>
<h2>Built with &lt;3 by Dottech</h2>
<a target="_blank" class="btn" href="https://github.com/puntotech/ngbytes-fireauth">
Click here to view the source code
</a>
</div>
@NyaGarcia
NyaGarcia / dashboard.component.ts
Created November 30, 2021 14:48
Adding a logout method to the dashboard
import { Component, OnInit } from '@angular/core';
import { AuthService } from '../../core/services/auth.service';
import { Router } from '@angular/router';
@Component({
selector: 'app-dashboard',
templateUrl: './dashboard.component.html',
styleUrls: ['./dashboard.component.css'],
})
@NyaGarcia
NyaGarcia / angular12-formcontrol.ts
Created November 10, 2021 12:30
The AbstractControl status property is typed as string in Angular 13
// Angular 12
export abstract class AbstractControl {
readonly status: string;
readonly statusChanges: Observable<any>;
}
export class FormControl extends AbstractControl { }
@NyaGarcia
NyaGarcia / angular13-formcontrol.ts
Last active November 10, 2021 12:28
The AbstractControl status property is typed with FormControlStatus in Angular 13
// Angular 13
export abstract class AbstractControl {
readonly status: FormControlStatus;
readonly statusChanges: Observable<FormControlStatus>;
}
export class FormControl extends AbstractControl { }
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
@NyaGarcia
NyaGarcia / login-page.component.ts
Created October 29, 2021 10:45
Adding google sign in
import { Component, OnInit } from '@angular/core';
import { AuthService } from 'src/app/core/services/auth.service';
import { LoginData } from 'src/app/core/interfaces/login-data.interface';
import { Router } from '@angular/router';
@Component({
selector: 'app-login-page',
templateUrl: './login-page.component.html',
styleUrls: ['./login-page.component.css'],