Skip to content

Instantly share code, notes, and snippets.

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

Leonel Elimpe leonelngande

🏠
Working from home
View GitHub Profile
@leonelngande
leonelngande / phone-number-validator.directive.ts
Created December 12, 2018 19:12
Custom phone number validator function for angular reactive forms
import {AbstractControl, ValidatorFn} from '@angular/forms';
import {CountryCode, isValidNumber} from 'libphonenumber-js';
export function phoneNumberValidator(countryCode: CountryCode = 'US'): ValidatorFn {
return (control: AbstractControl): { [key: string]: boolean } | null => {
if (control.value) {
return isValidNumber(control.value, countryCode) ? null : {notValid: true};
} else {
// do not validate if field is empty since it may not be a required field
return null;
@leonelngande
leonelngande / base64.service.ts
Last active May 31, 2019 20:23
An Angular service to convert and download base64 encoded string data (returned from api or other source) with appropriate file type.
import {Injectable} from "@angular/core";
@Injectable({
providedIn: 'root',
})
export class Base64Service {
constructor() { }
diff --git a/.env.example b/.env.example
index 9900c9fc..6f93b54d 100644
--- a/.env.example
+++ b/.env.example
@@ -25,6 +25,11 @@ QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120
+SAVED_RECEIVER_SYNC_ENABLED=false
+SAVED_RECEIVER_SYNC_QUEUE=