Skip to content

Instantly share code, notes, and snippets.

View jaganathanb's full-sized avatar
💭
I may be slow to respond.

Jaganathan B jaganathanb

💭
I may be slow to respond.
View GitHub Profile
@jaganathanb
jaganathanb / BasicTests.cs
Created May 13, 2020 11:07 — forked from jelster/BasicTests.cs
ASP.NET Core 2.1 - Setting up functional integration tests with authentication middleware
using Microsoft.AspNetCore.Mvc.Testing;
using System.Net;
using System.Threading.Tasks;
using Xunit;
using System.Net.Http;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace Api.FunctionalTests
{
@jaganathanb
jaganathanb / safeHtml.js
Last active July 14, 2016 13:02
Escape the html string with whitelist tags
/*
Function to escape the html with specified whitelist tags & spl chars
@param htmlString string string to be escaped
@param tags string comma separated tag list to be unescaped
@param splChars string comma separated spl char list to be unescaped
@example
var exTags = 'b,p,strong, i';
var exSplChars = '?,!';
document.querySelector('#editor').innerHTML = safeHTML("<strong> Need</strong> tips? <i> Visit </i> <b> W3Schools! </b>", exTags, exSplChars);
*/