Skip to content

Instantly share code, notes, and snippets.

@shadow1349
shadow1349 / errors.ts
Created September 12, 2019 22:42
These are all the possible auth error codes with a custom title and message attached. This will allow us to easily implement a custom auth catching mechanism
export const Errors = [
{
code: 'auth/expired-action-code',
title: 'Your token is expired',
message: 'Your verification token has expired!'
},
{
code: 'auth/invalid-action-code',
title: 'This action code is invalid',
message:
namespace Grader.Service
{
public class GradeConverter
{
/// <summary>
/// This function will take in a positive integer representing a grade percentage
/// and return the letter grade corresponding to that percentage.
/// </summary>
public char GetLetterGrade(int grade)
{
@shadow1349
shadow1349 / GraderService.Tests.cs
Created August 23, 2019 17:17
Grader service tests
using NUnit.Framework;
using Grader.Service;
namespace Tests
{
public class Tests
{
private GradeConverter gc = new GradeConverter();
[TestCase(90)]
namespace Grader.Service
{
public class GradeConverter
{
/// <summary>
/// 90 and above = 'A'
/// 80 - 90 = 'B'
/// 70 - 80 = 'C'
/// 60 - 70 = 'D'
/// 60 and below = 'F'
@shadow1349
shadow1349 / authService.ts
Last active May 1, 2020 07:55
Simple way to separate classes of users with Firebase
/**
* I like Angular, so this is the example I'll give you. It should
* still be relatively easy to read
*/
import { Injectable } from '@angular/core';
import { AngularFireAuth } from '@angular/fire/auth';
import { switchMap } from 'rxjs/operators';
import { HttpClient } from '@angular/common/http';