a typescript wrapper for Application Insights
import { trackException } from './appinsights-helper'
trackException({ exception: error })
<h2> Hello World! </h2> | |
<script> | |
function iframeResize() { | |
var body = document.body, html = document.documentElement; | |
var height = Math.max(body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight); | |
var location = document.location.href; | |
window.parent.postMessage(["setHeight", height, location], "*"); | |
} | |
iframeResize(); | |
$(window).resize(iframeResize); |
const { ServiceBusClient, ReceiveMode } = require('@azure/service-bus') | |
const connectionString = process.env['servicebus-connection'] | |
async function send () { | |
const sbClient = ServiceBusClient.createFromConnectionString(connectionString) | |
const client = sbClient.createTopicClient('topic-name') | |
const sender = client.createSender() | |
// set label=TEST for use in subscription filter | |
const msg = { label: 'TEST', body: { foo: 'bar', ts: new Date() } } |
import * as rp from 'request-promise-native' | |
function convertTable (columns: any[], rows: any[]): any[] { | |
return rows.map((row: any[]) => columns.reduce((obj, col, idx) => { | |
obj[col.name] = row[idx] | |
return obj | |
}, {})) | |
} | |
// API reference @ https://dev.applicationinsights.io/reference |
Orange dots = landing
Blue dots = takeoff
var landingColor = '#fe761e';
Object.getOwnPropertyNames(Date.prototype) | |
.filter(name => name.startsWith('to')) | |
.map(method => `${method}: ${(new Date())[method]()}`) |