Skip to content

Instantly share code, notes, and snippets.

private store: Store<AprState>
apr$: Observable<AprViewModel>;
//replace snippet
this.apr$ = this.store.pipe(select(fromAprSelectors.selectedApr));
@mike1477
mike1477 / product.reducer.ts
Created August 17, 2020 15:16
36 - Adding additional entity state properties
//Snippet
@mike1477
mike1477 / app.module.ts
Last active March 23, 2020 12:56
Reactive Angular Unique Username Validator
//Import
import { HttpClientModule } from "@angular/common/http";
imports: [
...,
...,
...,
HttpClientModule
],
@mike1477
mike1477 / custom-validation.service.ts
Last active October 6, 2023 19:34
Password Validator
//import at top
import { FormGroup } from "@angular/forms";
//Paste with in class
passwordMatchValidator(password: string, confirmPassword: string) {
return (formGroup: FormGroup) => {
const passwordControl = formGroup.controls[password];
const confirmPasswordControl = formGroup.controls[confirmPassword];
@mike1477
mike1477 / product-list.ts
Last active February 20, 2020 00:46
Example for GM MG
//create a new action in action file
this.store.dispatch(
fromActions.selectProduct({ selectedProduct: user selected product})
);
@mike1477
mike1477 / AzureStorage.cs
Created November 11, 2019 00:10
Video 49 | Use SixLabors ImageSharp to resize image before saving in Azure storage
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using CI.SER.Interfaces;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Blob;
using SixLabors.ImageSharp;
@mike1477
mike1477 / EmployersController.cs
Last active November 11, 2019 00:07
Video 48 |Create update API and upload profile image to azure storage
// PUT api/employers/update/5
[HttpPut("update/{employerid}")]
[Authorize(Policy = "EmployerPolicy")]
public async Task<IActionResult> Put(string employerid, [FromForm] UpdateEmployerViewModel model)
{
if (employerid != User.FindFirst(ClaimTypes.NameIdentifier).Value)
{
return Unauthorized();
}
@mike1477
mike1477 / AzureStorage.cs
Created November 7, 2019 13:38
Video 47 | Refactor AzureStorage service
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using CI.SER.Interfaces;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Blob;
namespace CI.SER
@mike1477
mike1477 / AzureStorage.cs
Created November 5, 2019 14:55
Video 46 | Create service to use Azure Storage
using System;
using System.Collections.Generic;
using System.IO;
using System.Threading.Tasks;
using CI.SER.Interfaces;
using Microsoft.AspNetCore.Http;
using Microsoft.Azure.Storage;
using Microsoft.Azure.Storage.Blob;
namespace CI.SER
@mike1477
mike1477 / home.component.html
Created October 25, 2019 21:49
Video 43 | Generate home page component and create view
<div class="row home-main-row">
<div class="col-md-6 mt-4 pt-5 pl-5">
<h3>Time Tracker</h3>
<p>Our time tracking app will save you time and money</p>
<a [routerLink]="['register']"
routerLinkActive="router-link-active"
class="btn btn-info">Create Free Employer Account <i class="fas fa-user-plus"></i></a>
</div>
<div class="col-md-6 mt-4 home-image-wrapper">
<img src="assets/img/computer.png"