Skip to content

Instantly share code, notes, and snippets.

View andrewconnell's full-sized avatar
📺
Building courses for @Voitanos

Andrew Connell andrewconnell

📺
Building courses for @Voitanos
View GitHub Profile
@andrewconnell
andrewconnell / SpRestBatchRequestDelete
Last active May 20, 2019 20:24
Sample SharePoint Online REST Batch Request Deleting Items & Querying List
POST https://aconn-fe6c88f31b8e0b.sharepoint.com/sites/dev/SpRestBatchSample/_api/$batch HTTP/1.1
Host: aconn-fe6c88f31b8e0b.sharepoint.com
Connection: keep-alive
Content-Length: 3616
Accept: */*
Origin: https://aconn-fe6c88f31b8e0b.sharepoint.com
X-Requested-With: XMLHttpRequest
X-RequestDigest: 0x3F168AD947C57DCB851D5EFF0F7A9D8CFBB1DF3D1F574BC7D0AF2C7E38DF5AF28C9F311B1ADB8447D965F037657B4DF572C1F9DD139D9E6AE3A565B659134FA5,30 Nov 2014 12:55:26 -0000
User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36
Content-Type: multipart/mixed; boundary="batch_f7ee2f04-d4bb-4501-c8c8-af782b0ceace"
@andrewconnell
andrewconnell / jest.config.json
Created April 15, 2019 19:35
Jest v24.* configuration with code coverage for SPFx projects
{
"collectCoverage": true,
"collectCoverageFrom": [
"<rootDir>/**/*.{ts,tsx}",
"!<rootDir>/**/*.scss.*",
"!<rootDir>/loc/**/*.*"
],
"coverageDirectory": "<rootDir>/../temp/test",
"coverageReporters": [
"json",
@andrewconnell
andrewconnell / jest.config.json
Last active April 15, 2019 19:30
Jest v23.* configuration with code coverage for SPFx projects
{
"collectCoverage": true,
"coverageDirectory": "<rootDir>/../temp/test",
"coverageReporters": [
"json",
"lcov",
"text-summary"
],
"coverageThreshold": {
"global": {
@andrewconnell
andrewconnell / jest.config.json
Last active April 15, 2019 19:26
Jest basic configuration for SPFx projects
{
"moduleFileExtensions": [
"ts",
"tsx",
"js",
"json"
],
"moduleNameMapper": {
"\\.(css|scss)$": "identity-obj-proxy",
"^resx-strings/en-us.json": "<rootDir>/../node_modules/@microsoft/sp-core-library/lib/resx-strings/en-us.json"
npm install @microsoft/rush-stack-compiler-3.3@0.1.6 typescript@3.3 --save-dev --exact
npm install @types/react@16.7.22 --save-dev --exact
@andrewconnell
andrewconnell / drip-blogpost-autotagger.html
Created February 24, 2017 13:31
Drip script snippet used to auto tag visitors
<!-- drip auto-tagger -->
<!--
this script does four things:
1) finds all tags for a blog post & converts to tags in the format: interest-[pascalCasePostTag]
2) converts blog post title to drip tag in the format: read-[pascalCaseBlogPostTitle]
3) sends the tags to drip for the current user
4) registers "Read blog post" drip event on current user
-->
<p>
<script type="text/javascript">
@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 / 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.
const auth = {
token: '...', // get from your user settings in Drip admin
accountId: 007
};
const client = require('drip-nodejs')(auth);
const payload = {
subscribers:[{
email:'voitanosllc@contoso.com',
eu_consent:'granted'