Skip to content

Instantly share code, notes, and snippets.

View lfalck's full-sized avatar

Ludvig Falck lfalck

View GitHub Profile
function createServiceBusOrEventHubsSASToken(resourceUri, sasKeyName, sasKey) {
if (!resourceUri || !sasKeyName || !sasKey) {
throw "Missing required parameter";
}
const encoded = encodeURIComponent(resourceUri);
const now = new Date();
const minute = 60;
const ttl = Math.round(now.getTime() / 1000) + minute;
const signature = encoded + '\n' + ttl;
const hash = CryptoJS.HmacSHA256(signature, sasKey)
using System.IO;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Azure.WebJobs;
using Microsoft.Azure.WebJobs.Extensions.Http;
using Microsoft.AspNetCore.Http;
using PgpCore;
using System.Threading.Tasks;
using System.Net.Http;
using System;
using System.Text;
SUBSTRING((DT_STR,30, 1252) GETDATE(), 1, 10)
<Tag>((?!0).)</Tag>
Find: (<.*?>)(.*?)(</.*?>)
Replace: $1$3
//Sort first
^(.*\r?\n)\1+
// Not empty or whitespace
^\S+$