Skip to content

Instantly share code, notes, and snippets.

View mansourcodes's full-sized avatar
😋

Mansour Hussain Alnasser mansourcodes

😋
View GitHub Profile
@mansourcodes
mansourcodes / mime-type.validators.ts
Created October 3, 2020 16:27 — forked from LalanaChami/mime-type.validators.ts
typescript mime type validator to a file picker in order pick png and jpg images
import { AbstractControl } from '@angular/forms';
import { Observable, Observer } from 'rxjs';
export const mimeType =(
control: AbstractControl
): Promise<{[key: string]:any}> | Observable<{[key: string]:any}> =>{
const file =control.value as File;
const fileReader = new FileReader();
const frObs = Observable.create((observer : Observer<{[key: string]:any}>)=>{
fileReader.addEventListener("loadend", ()=>{
# Install OpenSSL
apt-get install openssl
# Create a directory for your certificates
mkdir /etc/apache2/ssl/
# Create the certificates