Skip to content

Instantly share code, notes, and snippets.

View MurhafSousli's full-sized avatar

Murhaf Sousli MurhafSousli

View GitHub Profile
@MurhafSousli
MurhafSousli / html-sanitizer.pipe.ts
Last active August 26, 2024 05:43
HTML Dom Sanitizer Pipe
import { Pipe, PipeTransform } from '@angular/core';
import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
@Pipe({
name: 'sanitizeHtml'
})
export class HtmlSanitizerPipe implements PipeTransform {
constructor(private sanitizer: DomSanitizer) {
}
@MurhafSousli
MurhafSousli / window photo viewer.reg
Created January 30, 2017 20:12
Get windows photo viewer back to windows 10
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell]
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open]
"MuiVerb"="@photoviewer.dll,-3043"
[HKEY_CLASSES_ROOT\Applications\photoviewer.dll\shell\open\command]
@MurhafSousli
MurhafSousli / flatten.js
Last active August 23, 2016 06:20
Javascript array flattening
/**
* Flattens an array of arbitrarily nested arrays into
* a flat array. e.g. [[1,2,[3]],4] -> [1,2,3,4]
*
* @param items - source array
* @return - flat array
*/
function flatten(items) {
const flat = [];