This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function getSchemaDataForCurrentView() { | |
| var webPartKey = ''; | |
| var webPartComponent = null; | |
| var schemaData; | |
| // based on the current view id we can find our way to a WPQ<number>SchemaData variable which has the goodies we need to check in it! | |
| // First, get the web part component variable | |
| for (var key in _spWebPartComponents) { | |
| var a = _spWebPartComponents[key]; | |
| if (a.storageId && a.storageId == _spPageContextInfo.viewId.replace(/(\{|\})/g, '')) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Read these comments first. | |
| // Instructions for installing express here: https://expressjs.com/en/starter/installing.html | |
| // cd into project directory | |
| // run "npm init" | |
| // mash enter until it's finished | |
| // run "npm install express --save" | |
| const express = require("express"); | |
| var host = "127.0.0.1"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| List<IUser> users = ... // Get users from Azure AD Graph API in C# code | |
| foreach (IUser u in users) | |
| { | |
| // IMPORTANT - Casting from IUser to Microsoft.Azure.ActiveDirectory.GraphClient.User | |
| // gives us the ability to call .GetExtendedProperties(); | |
| Microsoft.Azure.ActiveDirectory.GraphClient.User usr = u as Microsoft.Azure.ActiveDirectory.GraphClient.User; | |
| var extProps = usr.GetExtendedProperties(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... other includes | |
| // FIRST - npm install pg | |
| var pg = require('pg'); | |
| // SECOND - get the full postgresql connection string. | |
| // You'll have to manually split it up into the various components required to build the | |
| // connection config object. | |
| // e.g. the connection string postgres://randomname:bigasspassword@some-host.compute-x.amazonaws.com:5432/lotsofcharacters |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Scale width and height dimensions to cover the screen | |
| function scaleDimensionsToCoverScreen(width, height, targetWidth, targetHeight) { | |
| let scaledWidth = width; | |
| let scaledHeight = height; | |
| let targetRatio = targetWidth / targetHeight; | |
| let imgRatio = width / height; | |
| // If the target is *more* portrait than the image | |
| // we must take targetHeight and calculate the scaledWidth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Yarn: | |
| yarn init <-- spam enter | |
| yarn add webpack webpack-cli webpack-merge css-loader style-loader file-loader html-webpack-plugin uglifyjs-webpack-plugin clean-webpack-plugin babel-core babel-preset-env babel-loader path --dev | |
| or | |
| NPM: | |
| npm init <-- spam enter | |
| npm install webpack webpack-cli webpack-merge css-loader style-loader file-loader html-webpack-plugin uglifyjs-webpack-plugin clean-webpack-plugin babel-core babel-preset-env babel-loader path --save-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require("path"); | |
| const HtmlWebpackPlugin = require("html-webpack-plugin"); | |
| const CleanWebpackPlugin = require("clean-webpack-plugin"); | |
| module.exports = { | |
| entry: { | |
| app: "./src/index.js" | |
| }, | |
| plugins: [ | |
| new CleanWebpackPlugin(["dist"]), |