This file contains 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
// define a global function to execute | |
function $_global_onMDSPageLoad() { | |
// code to execute on page load goes here | |
} | |
ExecuteOrDelayUntilScriptLoaded(function () { | |
if (typeof asyncDeltaManager != "undefined") | |
asyncDeltaManager.add_pageLoaded($_global_onMDSPageLoad); // execute on MDS page load | |
else | |
$_global_onMDSPageLoad(); // execute on non-MDS page load |
This file contains 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
using System.IO; | |
using System.Text; | |
public static class StreamExtensions | |
{ | |
public static string ToEncodedString(this Stream stream, Encoding enc = null) | |
{ | |
enc = enc ?? Encoding.UTF8; | |
byte[] bytes = new byte[stream.Length]; |
This file contains 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
// This example depends on jQuery().on and _.debounce | |
// Create a MutationObserver to trigger a callback function | |
// when the element located via document.querySelector(elementSelector) changes | |
function getMutationObserver(elementSelector, callback) { | |
var observer = new MutationObserver(callback); | |
var config = { attributes: true, childList: true, characterData: false }; | |
observer.observe(document.querySelector(elementSelector), config); | |
return observer; |
This file contains 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
param( | |
[Parameter(Mandatory = $true)] | |
[string]$ListTitle, | |
[Parameter(Mandatory = $true)] | |
[int]$ItemId, | |
[Parameter(Mandatory = $true)] | |
[string]$Path | |
) |
This file contains 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
$imagePath = "$home\AppData\Local\Packages\Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy\LocalState\Assets\*" | |
$destinationPath = "$home\OneDrive\Pictures\Lock screen" | |
Add-Type -AssemblyName System.Drawing | |
# get images from lock screen folder | |
$items = Get-ChildItem -Path $imagePath | |
foreach($item in $items) { | |
$fileName = $item.Name |
This file contains 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 objectToQueryString(paramsObject) { | |
return Object.keys(paramsObject).reduce((accumulator, currentKey) => { | |
const prefix = accumulator === "" ? "?" : "&"; | |
return `${accumulator}${prefix}${currentKey}=${encodeURIComponent(paramsObject[currentKey])}`; | |
}, ""); | |
} |
This file contains 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
<!--ASP.NET--> | |
<asp:Textbox runat="server" ClientIdMode="Static" type="password" id="PasswordTextbox" name="PasswordTextbox" pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).{8,}$" validationmessage="Please enter a password which is at least 8 characters long and contains a lowercase character, an uppercase character and a number" required /> | |
<!--HTML--> | |
<input type="password" id="PasswordTextbox" name="PasswordTextbox" pattern="^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).{8,}$" validationmessage="Please enter a password which is at least 8 characters long and contains a lowercase character, an uppercase character and a number" required /> | |
<!--Kendo UI Validator: http://demos.telerik.com/kendo-ui/validator/index --> |
This file contains 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
using Microsoft.Azure.WebJobs; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace LS.DurableFunctions.Examples | |
{ | |
public static class DurableOrchestrationContextExtensions | |
{ | |
/// <summary> |
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Threading.Tasks; | |
using OfficeDevPnP.Core; | |
using Microsoft.SharePoint.Client; | |
using System.IO; | |
using CsvHelper; | |
using File = Microsoft.SharePoint.Client.File; | |
using CsvHelper.Configuration.Attributes; |
This file contains 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
# Original code from https://github.com/slavizh/OMSSearch/blob/master/OMSSearch.psm1 | |
# - Updated/fixed authentication method calls | |
# - Ensure ADAL DLL is loaded | |
Function Get-AADToken { | |
<# | |
.SYNOPSIS | |
Get token from Azure AD so you can use the other cmdlets. | |
.DESCRIPTION | |
Get token from Azure AD so you can use the other cmdlets. |