Skip to content

Instantly share code, notes, and snippets.

View andrewconnell's full-sized avatar
🧰
Building

Andrew Connell andrewconnell

🧰
Building
View GitHub Profile
@andrewconnell
andrewconnell / AppInsights.js
Created September 9, 2015 10:41
Application Insights Snippet
<script type="text/javascript">
var appInsights=window.appInsights||function(config){
function s(config){t[config]=function(){var i=arguments;t.queue.push(function(){t[config].apply(t,i)})}}var t={config:config},r=document,f=window,e="script",o=r.createElement(e),i,u;for(o.src=config.url||"//az416426.vo.msecnd.net/scripts/a/ai.0.js",r.getElementsByTagName(e)[0].parentNode.appendChild(o),t.cookie=r.cookie,t.queue=[],i=["Event","Exception","Metric","PageView","Trace"];i.length;)s("track"+i.pop());return config.disableExceptionTracking||(i="onerror",s("_"+i),u=f[i],f[i]=function(config,r,f,e,o){var s=u&&u(config,r,f,e,o);return s!==!0&&t["_"+i](config,r,f,e,o),s}),t
}({
instrumentationKey:"c0a3dcd4-6b58-4f92-a053-54d65a1db105"
});
window.appInsights=appInsights;
// appInsights.trackPageView();
</script>
@andrewconnell
andrewconnell / office-ui-fabric-dropdown.html
Last active March 2, 2021 12:21
Office UI Fabric - Sample Dropdown List
<link rel="stylesheet" href="/public/fabric/css/fabric.min.css">
<link rel="stylesheet" href="/public/fabric/css/fabric.components.min.css">
<script src="/public/fabric/components/Dropdown/Jquery.Dropdown.js" type="application/javascript"></script>
<label class="ms-Label">Position</label>
<div class="ms-Dropdown">
<i class="ms-Dropdown-caretDown ms-Icon ms-Icon--caretDown"></i>
<select class="ms-Dropdown-select" data-ng-model="vm.pick.position">
<option value="">Choose a position...</option>
<option value="QB">quarterback</option>
@andrewconnell
andrewconnell / office-ui-fabric-table.html
Last active June 17, 2018 19:59
Office UI Fabric Table Example
<link rel="stylesheet" href="/public/fabric/css/fabric.min.css">
<link rel="stylesheet" href="/public/fabric/css/fabric.components.min.css">
<div class="ms-Grid">
<div class="ms-Grid-row">
<div class="ms-Grid-col ms-u-lg12">
<div class="ms-font-su">{{vm.teamName}} Roster</div>
<div class="ms-Table">
<div class="ms-Table-row">
<span class="ms-Table-cell ms-font-xl">Pos.</span>
@andrewconnell
andrewconnell / tasks.json
Created August 21, 2015 09:49
VSCode Task Configuration to Run Gulp Test Task
{
"version": "0.1.0",
"command": "gulp",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "run-tests",
"isTestCommand": true,
"isBuildCommand": false
@andrewconnell
andrewconnell / gulpfile.js
Created August 21, 2015 09:42
Gulp task to run all tests in the project using Mocha
'use strict';
var gulp = require('gulp');
var mocha = require('gulp-mocha');
/**
* Execute all tests.
*/
gulp.task('run-tests', function () {
return gulp.src('test/**/*.js', { read: false })
@andrewconnell
andrewconnell / launch.json
Created August 20, 2015 21:13
VSCode launch.json configuration to debug Yeoman generators
{
"version": "0.1.0",
"configurations": [
{
"name": "Launch yo",
"type": "node",
// NOTE: this should be the result of running `which yo` on your system...
// for the typical NPM install & config, this is usually /usr/local/bin/yo
// however others (as below) may have global NPM packages setup in a
// different path as common to avoid using sudo on OS X
@andrewconnell
andrewconnell / sharepoint.service.ts
Created March 8, 2015 16:49
ADAL JS + Angular: SharePoint Service
/**
* Get all all lists in the target SharePoint site.
*
* @param sharePointSiteApiUrl {string} URL of the REST API endpoint of the SharePoint site.
* @returns {IPromise<adalO365CorsClient.shared.ISpList[]>} Collection of all the lists in the specified SharePoint
* site.
*/
public getAllLists(sharePointSiteApiUrl:string) {
var deferred = this.$q.defer();
@andrewconnell
andrewconnell / app.routes.ts
Created March 8, 2015 16:47
ADAL JS + Angular: Loading the Routes
module adalO365CorsClient {
'use strict';
export class Routes {
/**
* Configures the routes for the application.
* @param $routeProvider
*/
static configure($routeProvider:ng.route.IRouteProvider):void {
var baseUrl = 'app/';
@andrewconnell
andrewconnell / app.adal.ts
Created March 8, 2015 16:46
ADAL JS + Angular: Initializing the ADAL provider
module adalO365CorsClient {
'use strict';
export class Adal {
/**
* Configures ADAL JS with required info for the registered app in Azure AD.
*
* @param $httpProvider Angular's $httpProvider (needed by ADAL)
* @param adalSettings Settings for ADAL
* @param adalProvider ADAL JS' Angular provider.
@andrewconnell
andrewconnell / app.module.ts
Created March 8, 2015 16:42
ADAL JS + Angular: Loading the ADAL module
var app = angular.module('adalO365CorsClient', [
'ngRoute',
'ngAnimate',
'AdalAngular' // <<<< loading the ADAL JS Angular module
]);